ComfyUI > Nodes > TrentNodes > MatAnyone Video Matte

ComfyUI Node: MatAnyone Video Matte

Class Name

MatAnyoneMatte

Category
Trent/Video
Author
TrentHunter82 (Account age: 0days)
Extension
TrentNodes
Latest Updated
2026-03-20
Github Stars
0.03K

How to Install TrentNodes

Install this extension via the ComfyUI Manager by searching for TrentNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter TrentNodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

MatAnyone Video Matte Description

MatAnyoneMatte provides flicker-free video matting with temporal consistency and fine detail preservation.

MatAnyone Video Matte:

MatAnyoneMatte is a sophisticated node designed for temporally-consistent video matting, leveraging advanced techniques from MatAnyone 2 (CVPR 2026) and MatAnyone (CVPR 2025). This node excels in creating flicker-free alpha mattes, ideal for green screen compositing, by propagating a single-frame mask across all video frames with memory-based temporal consistency. It automatically selects the best reference frame to ensure the clearest subject representation and employs person-aware auto-masking using BiRefNet, which includes filtering for the largest connected component to isolate the primary subject. The node also features guided filter edge refinement to preserve fine details such as hair, ensuring high-quality results. All processes are GPU-accelerated, making it efficient for handling video sequences.

MatAnyone Video Matte Input Parameters:

images

This parameter accepts a batch of input video frames, which are processed by MatAnyone to propagate the mask across all frames with temporal consistency. The quality of the input frames directly affects the accuracy and quality of the resulting matte.

model_version

This parameter specifies the version of the MatAnyone model to use, with options including "v2 (CVPR 2026)" and "v1 (CVPR 2025)". The default is "v2 (CVPR 2026)", which includes a learned quality evaluator for enhanced detail and robustness. Choosing the appropriate version can impact the detail and stability of the output.

mask

An optional parameter that allows you to provide an initial mask. If not provided, the node will automatically generate a mask using BiRefNet. Supplying a high-quality initial mask can improve the accuracy of the matte.

mask_frame_index

This parameter determines the index of the frame to use as the reference for mask propagation. A value of -1 indicates automatic selection of the best frame. Proper selection of this frame can enhance the clarity and consistency of the matte.

n_warmup

Specifies the number of warmup iterations for the model, with a default value of 10. Increasing this number can improve the model's performance at the cost of longer processing times.

bg_color

Defines the background color for compositing, with options such as "green", "blue", "aqua", "white", and "black". The choice of background color can affect the visual integration of the foreground with the background.

background_images

An optional parameter for providing custom background images for compositing. Using custom backgrounds can create more visually appealing results tailored to specific needs.

edge_mode

Determines the method for edge refinement, with "guided" as the default option. This setting influences how well fine details, like hair, are preserved in the matte.

edge_refine

Specifies the number of pixels for edge refinement, with a default value of 4. Adjusting this value can enhance the sharpness and detail of the matte edges.

mask_expand

Controls the expansion or contraction of the mask, with a default value of 0. Positive values expand the mask, while negative values contract it, allowing for fine-tuning of the matte's coverage.

MatAnyone Video Matte Output Parameters:

composite

This output provides the foreground composited over the selected background color or custom background. It is an RGBA (4-channel) image when the background color is set to transparent, allowing for seamless integration into various projects.

alpha_matte

The alpha matte output is a temporally-consistent mask from MatAnyone, where white represents the foreground. This output is crucial for achieving clean and precise separation of the subject from the background, especially in video editing and compositing tasks.

MatAnyone Video Matte Usage Tips:

  • Ensure high-quality input frames to maximize the accuracy and quality of the resulting matte.
  • Use the "v2 (CVPR 2026)" model version for better detail and robustness, especially when dealing with complex scenes.
  • Provide a well-defined initial mask if possible, to improve the accuracy of the matte propagation.
  • Experiment with the edge_refine parameter to achieve the desired level of detail preservation, particularly for intricate edges like hair.

MatAnyone Video Matte Common Errors and Solutions:

[ MatAnyone Video Matte] MatAnyone2 not available. Install: pip install omegaconf

  • Explanation: This error occurs when the MatAnyone2 model is not available due to missing dependencies.
  • Solution: Install the required package by running pip install omegaconf in your environment.

[ MatAnyone Video Matte] BiRefNet not available for auto-mask. Provide a mask input or install: pip install transformers

  • Explanation: This error indicates that the BiRefNet model is unavailable for generating an automatic mask.
  • Solution: Either provide a manual mask input or install the necessary package by running pip install transformers to enable automatic mask generation.

MatAnyone Video Matte Related Nodes

Go back to the extension to check out more related nodes.
TrentNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

MatAnyone Video Matte