ComfyUI  >  Nodes  >  ComfyUI-Video-Matting >  BRIAAI Matting

ComfyUI Node: BRIAAI Matting

Class Name

BRIAAI Matting

Video Matting
Fannovel16 (Account age: 3132 days)
Latest Updated
Github Stars

How to Install ComfyUI-Video-Matting

Install this extension via the ComfyUI Manager by searching for  ComfyUI-Video-Matting
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Video-Matting 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

BRIAAI Matting Description

Sophisticated node for video matting using advanced deep learning for precise foreground extraction in complex backgrounds, automating professional-grade results.

BRIAAI Matting:

BRIAAI Matting is a sophisticated node designed to facilitate the process of video matting, which involves separating the foreground from the background in video frames. This node leverages advanced deep learning techniques to accurately identify and extract the foreground elements, providing a clean and precise matte. The primary benefit of using BRIAAI Matting is its ability to handle complex backgrounds and deliver high-quality results, making it an invaluable tool for AI artists working on video editing, compositing, and special effects. By automating the matting process, it significantly reduces the time and effort required to achieve professional-grade results, allowing you to focus on the creative aspects of your projects.

BRIAAI Matting Input Parameters:


This parameter represents the input video frames that you want to process. It is a batch of frames that the node will analyze to separate the foreground from the background. The quality and resolution of the input frames can impact the accuracy of the matting process.


This parameter specifies the version of the model to be used for matting. Different versions may offer improvements or optimizations, so selecting the appropriate version can affect the performance and quality of the output.


This boolean parameter determines whether to use 16-bit floating-point precision during processing. Enabling fp16 can speed up the computation and reduce memory usage, but it may slightly affect the precision of the results. The default value is typically False.


This parameter sets the background color to be used in the output video frames where the background is removed. It is important to choose a color that contrasts well with the foreground to achieve the best visual results.


This parameter defines the number of video frames to be processed in each batch. A larger batch size can speed up the processing but requires more memory. The optimal batch size depends on your hardware capabilities and the size of the input frames.

BRIAAI Matting Output Parameters:


This output parameter contains the foreground frames extracted from the input video. These frames have the background removed and are ready for further processing or compositing. The quality of the foreground extraction is crucial for achieving seamless integration with new backgrounds.


This output parameter provides the masks generated during the matting process. Each mask indicates the areas of the frame that belong to the foreground. These masks can be used for various purposes, such as refining the matte or applying additional effects.

BRIAAI Matting Usage Tips:

  • Ensure that the input video frames are of high quality and have a clear distinction between the foreground and background to achieve the best matting results.
  • Experiment with different versions of the model to find the one that offers the best performance and quality for your specific use case.
  • Use the fp16 parameter if you have limited computational resources or need to process a large number of frames quickly.
  • Choose a background color that contrasts well with the foreground to make the extracted foreground elements stand out.

BRIAAI Matting Common Errors and Solutions:

"Model file not found"

  • Explanation: This error occurs when the specified model version cannot be found in the expected directory.
  • Solution: Ensure that the correct model version is specified and that the model file is present in the designated directory.

"CUDA out of memory"

  • Explanation: This error indicates that the GPU does not have enough memory to process the input frames with the current batch size.
  • Solution: Reduce the batch size or use a machine with more GPU memory to avoid this error.

"Invalid background color"

  • Explanation: This error occurs when the specified background color is not in a valid format or range.
  • Solution: Ensure that the background color is specified in a valid format, such as an RGB tuple, and within the acceptable range of values.

"Input frames not properly formatted"

  • Explanation: This error indicates that the input video frames are not in the expected format or shape.
  • Solution: Verify that the input frames are correctly formatted and match the expected dimensions and data type.

BRIAAI Matting Related Nodes

Go back to the extension to check out more related nodes.

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.