GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - FuouM/ComfyUI-MatAnyone: MatAnyone in ComfyUI

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
checkpoint
checkpoint
 
 
example
example
 
 
src
src
 
 
workflow
workflow
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
__init__.py
__init__.py
 
 
constants.py
constants.py
 
 
mat_anyone.py
mat_anyone.py
 
 
mat_anyone2.py
mat_anyone2.py
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
run.py
run.py
 
 
utils.py
utils.py
 
 

Repository files navigation

ComfyUI-MatAnyone

MatAnyone in ComfyUI (Remove background)

Stable Video Matting with Consistent Memory Propagation: https://github.com/pq-yang/MatAnyone

Scaling Video Matting via a Learned Quality Evaluator: https://github.com/pq-yang/MatAnyone2

Download matanyone.pth from https://github.com/pq-yang/MatAnyone?tab=readme-ov-file#download-model

Download matanyone2.pth from https://github.com/pq-yang/MatAnyone2?tab=readme-ov-file#-inference

checkpoint/
    matanyone.pth
    matanyone2.pth
Matanyone.Compare.mp4

Workflow

The extension now includes the MatAnyone2Video node, which runs the improved MatAnyoneV2 model for higher-quality and more robust video matting.

Workflow: workflow/workflow_mat_anyone.json

matanyone_example (Not a workflow-embedded image)

Inputs:

  • src_video
  • forground_mask (IMAGE) or foreground_MASK (MASK): The input mask. IMAGE option will automatically convert a black/white image to a mask. At least one option must be given.
  • solid_color (optional): The solid color to create a screen. Defaults to Green Screen.
  • mask_frame: The input mask's index (defaults to 0). Support first (0), last and middle frame.
  • n_warmup: Number of iterations to warm up the model. Defaults to 10.

Memory Management Inputs:

  • max_internal_size (optional): Resizes the internal processing resolution to save memory (e.g., 360, 480). Default is -1 (full resolution).
  • max_mem_frames (optional): The number of key frames kept in high-resolution working memory. Default is 5.
  • use_long_term (optional): Limits active memory scaling by compressing older frames into long-term prototype memories, preventing OOM over time. Default is False. (Useful for long videos)

Your input mask won't actually be in the final matte. Instead, the warmup process generate a new input mask, which is then propagated throughout the video.

Additional Inputs for V2:

  • r_erode (optional): The radius for morphological erosion applied to the foreground_mask before processing (defaults to 0). Useful for refining rough masks.
  • r_dilate (optional): The radius for morphological dilation applied to the foreground_mask before processing (defaults to 0).

Credit

@InProceedings{yang2025matanyone,
    title     = {{MatAnyone}: Stable Video Matting with Consistent Memory Propagation},
    author    = {Yang, Peiqing and Zhou, Shangchen and Zhao, Jixin and Tao, Qingyi and Loy, Chen Change},
    booktitle = {arXiv preprint arXiv:2501.14677},
    year      = {2025}
}

@InProceedings{yang2026matanyone2,
   title     = {{MatAnyone 2}: Scaling Video Matting via a Learned Quality Evaluator},
   author    = {Yang, Peiqing and Zhou, Shangchen and Hao, Kai and Tao, Qingyi},
   booktitle = {CVPR},
   year      = {2026}
}

About

MatAnyone in ComfyUI

Resources

Readme
MIT license
Activity

Stars

108 stars

Watchers

3 watching

Forks

9 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.