ComfyUI > Nodes > WAS Node Suite > Masks Add

ComfyUI Node: Masks Add

Class Name

Masks Add

Category
WAS Suite/Image/Masking
Author
WASasquatch (Account age: 4688days)
Extension
WAS Node Suite
Latest Updated
2024-08-25
Github Stars
1.07K

How to Install WAS Node Suite

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

Masks Add Description

Combine mask images by adding pixel values to create composite masks, highlighting areas of interest while preventing overflow/underflow.

Masks Add:

The Masks Add node is designed to combine two mask images by adding their pixel values together. This operation is particularly useful in image processing and AI art creation, where you might want to merge different mask regions to create a composite mask. By adding the masks, you can highlight areas of interest from both input masks, effectively combining their features. This node ensures that the resulting mask values are clamped within a valid range, preventing any overflow or underflow issues. The main goal of this node is to facilitate the creation of complex masks by leveraging the additive properties of the input masks.

Masks Add Input Parameters:

masks_a

This parameter represents the first mask to be added. It is a tensor of type MASK. The mask should be a multi-dimensional array where each element corresponds to a pixel value. The values in this mask will be added to the corresponding values in the second mask. This parameter is crucial as it forms one half of the input for the addition operation.

masks_b

This parameter represents the second mask to be added. Similar to masks_a, it is a tensor of type MASK. The values in this mask will be added to the corresponding values in the first mask. This parameter is equally important as it forms the other half of the input for the addition operation.

Masks Add Output Parameters:

MASKS

The output parameter MASKS is a tensor of type MASK. This represents the resulting mask after the addition of masks_a and masks_b. The values in this mask are clamped to ensure they remain within a valid range, typically between 0 and 255. This output is essential for further image processing tasks, as it combines the features of the input masks into a single composite mask.

Masks Add Usage Tips:

  • Ensure that both input masks, masks_a and masks_b, are of the same dimensions to avoid any shape mismatch errors.
  • Use this node to combine masks that highlight different regions of interest in your image, creating a more comprehensive mask for subsequent processing.
  • If the input masks have different value ranges, consider normalizing them before using the Masks Add node to ensure a balanced addition.

Masks Add Common Errors and Solutions:

Shape mismatch error

  • Explanation: This error occurs when the input masks masks_a and masks_b have different dimensions.
  • Solution: Ensure that both input masks have the same dimensions before feeding them into the Masks Add node. You can resize or crop the masks to match their dimensions.

Value overflow error

  • Explanation: This error occurs when the resulting mask values exceed the valid range (typically 0-255) after addition.
  • Solution: The node automatically clamps the values to prevent overflow. However, if you encounter this issue, ensure that the input masks have values within a reasonable range before addition.

Unsupported data type error

  • Explanation: This error occurs when the input masks are not of type MASK.
  • Solution: Ensure that the input masks are correctly formatted as tensors of type MASK. Convert any other data types to the appropriate format before using the node.

Masks Add Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© 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.