ComfyUI > Nodes > ComfyUI-tbox > MaskAddNode

ComfyUI Node: MaskAddNode

Class Name

MaskAddNode

Category
tbox/Mask
Author
ai-shizuka (Account age: 3606days)
Extension
ComfyUI-tbox
Latest Updated
2025-04-22
Github Stars
0.02K

How to Install ComfyUI-tbox

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

MaskAddNode Description

Combines multiple mask inputs into a single composite mask for enhanced image processing.

MaskAddNode:

The MaskAddNode is designed to facilitate the combination of multiple mask inputs into a single, unified mask. This node is particularly useful in scenarios where you need to overlay or combine different mask layers to create a composite mask that incorporates features from each input. By adding masks together, you can enhance or modify specific areas of an image, allowing for more complex and nuanced image processing tasks. The primary function of this node is to take a base mask and incrementally add up to six additional masks, ensuring that the resulting mask is a seamless blend of all inputs. This process is crucial for tasks that require precise control over image regions, such as inpainting, compositing, or any application where mask manipulation is essential.

MaskAddNode Input Parameters:

mask

The mask parameter is the primary input mask that serves as the base for the addition process. It is a required parameter and represents the initial mask to which other masks will be added. This mask defines the starting point of the composite mask and its dimensions and values will influence the final output. The mask should be a valid mask format, typically a binary or grayscale image where pixel values indicate the presence or absence of a feature.

src1

The src1 parameter is an optional mask input that can be added to the base mask. When provided, this mask will be reshaped and added to the mask, allowing for the combination of features from both masks. This parameter is useful for incrementally building up the composite mask by adding additional layers.

src2

Similar to src1, the src2 parameter is another optional mask input. It provides an additional layer that can be added to the composite mask. This allows for further customization and refinement of the mask by incorporating more features.

src3

The src3 parameter is an optional mask input that can be added to the composite mask. It serves the same purpose as src1 and src2, offering another layer to enhance the mask's complexity and detail.

src4

The src4 parameter is an optional mask input that can be added to the composite mask. It allows for the inclusion of additional features, providing more flexibility in mask creation.

src5

The src5 parameter is an optional mask input that can be added to the composite mask. This parameter is useful for adding even more layers to the mask, enabling intricate and detailed mask compositions.

src6

The src6 parameter is an optional mask input that can be added to the composite mask. It is the final optional input, allowing for the maximum number of additional layers to be combined with the base mask.

MaskAddNode Output Parameters:

MASK

The output of the MaskAddNode is a single composite mask, denoted as MASK. This output represents the result of adding the base mask with all provided optional masks. The composite mask is clamped to ensure that all pixel values remain within a valid range, typically between 0.0 and 1.0, ensuring that the mask is suitable for further processing or application in image manipulation tasks. The output mask retains the dimensions of the input masks and reflects the cumulative effect of all additions.

MaskAddNode Usage Tips:

  • Ensure that all input masks have the same dimensions to avoid shape mismatches during the addition process.
  • Use the optional mask inputs strategically to build up complex masks incrementally, allowing for precise control over the final composite mask.
  • Consider normalizing input masks to ensure consistent results, especially if the masks originate from different sources or have varying intensity scales.

MaskAddNode Common Errors and Solutions:

Shape mismatch error

  • Explanation: This error occurs when the input masks have different dimensions, preventing them from being added together.
  • Solution: Ensure that all input masks are resized or reshaped to have the same dimensions before using them in the MaskAddNode.

NoneType error for optional masks

  • Explanation: This error can occur if an optional mask input is not provided and the code attempts to process a None value.
  • Solution: Check that optional masks are either provided or handled correctly in the code to avoid processing None values.

MaskAddNode Related Nodes

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