ComfyUI > Nodes > ComfyUI-RMBG > Mask Combiner (RMBG) 🎭

ComfyUI Node: Mask Combiner (RMBG) 🎭

Class Name

AILab_MaskCombiner

Category
🧪AILab/🖼️IMAGE
Author
1038lab (Account age: 1116days)
Extension
ComfyUI-RMBG
Latest Updated
2026-02-03
Github Stars
1.89K

How to Install ComfyUI-RMBG

Install this extension via the ComfyUI Manager by searching for ComfyUI-RMBG
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-RMBG 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

Mask Combiner (RMBG) 🎭 Description

Combines multiple image masks using union, intersection, and difference for creative projects.

Mask Combiner (RMBG) 🎭:

The AILab_MaskCombiner node is a powerful tool designed to facilitate the combination of multiple image masks within the ComfyUI environment. This node is particularly useful for AI artists who need to manipulate and refine image masks for various creative projects. By offering operations such as union, intersection, and difference, the MaskCombiner allows you to merge multiple masks into a single output, providing flexibility in how masks are combined to achieve the desired effect. This capability is essential for tasks such as background removal, compositing, and other image processing workflows where precise mask manipulation is required. The node's design ensures that even users without a deep technical background can easily integrate it into their workflows, enhancing their ability to create complex and visually appealing compositions.

Mask Combiner (RMBG) 🎭 Input Parameters:

mask_1

This is the primary mask input and is required for the node to function. It serves as the base mask upon which additional masks can be combined. The quality and resolution of this mask will directly impact the final output, as it sets the reference shape for any additional masks.

mode

The mode parameter determines the method used to combine the masks. It offers three options: "combine," "intersection," and "difference." The "combine" mode merges masks by taking the maximum value at each pixel, effectively layering them. The "intersection" mode finds common areas between masks by taking the minimum value at each pixel. The "difference" mode calculates the absolute difference between masks, highlighting areas of change. The default value is "combine," which is suitable for most general purposes.

mask_2

This optional parameter allows you to input a second mask to be combined with the primary mask. If not provided, the node will only process the primary mask. When used, it should match the resolution of the primary mask to ensure accurate results.

mask_3

Similar to mask_2, this optional parameter lets you add a third mask into the combination process. It provides additional flexibility for more complex mask operations. If not used, it defaults to None.

mask_4

This optional parameter allows for the inclusion of a fourth mask. It is useful for advanced users who need to combine multiple masks simultaneously. Like the other optional masks, it defaults to None if not provided.

Mask Combiner (RMBG) 🎭 Output Parameters:

MASK

The output is a single combined mask that results from the specified operation mode applied to the input masks. This mask can be used in further image processing tasks, such as compositing or background removal. The output retains the resolution of the primary mask and reflects the combined characteristics of all input masks, providing a versatile tool for creative image manipulation.

Mask Combiner (RMBG) 🎭 Usage Tips:

  • Ensure that all input masks are of the same resolution to avoid unexpected results and to maintain the quality of the output mask.
  • Experiment with different modes to understand how each affects the final mask. The "combine" mode is generally useful for layering effects, while "intersection" is ideal for finding common areas, and "difference" can highlight changes or edges.
  • Use the node in conjunction with other image processing nodes in ComfyUI to create complex compositions and effects.

Mask Combiner (RMBG) 🎭 Common Errors and Solutions:

Error in combine_masks: <error_message>

  • Explanation: This error occurs when there is an issue during the mask combination process, possibly due to mismatched mask resolutions or invalid input data.
  • Solution: Check that all input masks are correctly formatted and have the same resolution. Ensure that the mode parameter is set to a valid option and that all required inputs are provided. If the problem persists, review the input data for any anomalies or inconsistencies.

Mask Combiner (RMBG) 🎭 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-RMBG
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.