ComfyUI > Nodes > ComfyUI-UniversalToolkit > Mask And (UTK)

ComfyUI Node: Mask And (UTK)

Class Name

MaskAnd_UTK

Category
UniversalToolkit/Mask
Author
whmc76 (Account age: 1110days)
Extension
ComfyUI-UniversalToolkit
Latest Updated
2026-03-16
Github Stars
0.07K

How to Install ComfyUI-UniversalToolkit

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

Performs logical AND on two masks to retain overlapping active areas for precise image editing.

Mask And (UTK):

The MaskAnd_UTK node is a powerful tool designed to perform logical AND operations on two mask inputs. This node is part of the UniversalToolkit, specifically under the Mask category, and is essential for combining two masks in a way that retains only the overlapping areas where both masks are active. This operation is particularly useful in image processing and AI art creation, where you might want to isolate specific regions of an image that meet multiple criteria. By applying a pixel-wise AND operation, the node ensures that only the pixels present in both masks are retained, effectively creating a new mask that highlights the intersection of the two input masks. This capability is crucial for tasks that require precise control over image regions, such as compositing, masking effects, or selective editing.

Mask And (UTK) Input Parameters:

mask1

mask1 is the first input mask for the AND operation. It serves as one of the two binary masks that will be combined to produce the output mask. The mask should be a binary image where the active areas are represented by non-zero values. The shape of mask1 must match that of mask2 to ensure a valid operation. There are no specific minimum, maximum, or default values, but it is crucial that the mask is correctly formatted as a binary image.

mask2

mask2 is the second input mask for the AND operation. Similar to mask1, this mask is a binary image that will be logically combined with mask1. The operation will only retain the pixels that are active in both mask1 and mask2. As with mask1, the shape of mask2 must match that of mask1, and it should be formatted as a binary image with no specific minimum, maximum, or default values.

Mask And (UTK) Output Parameters:

mask

The output parameter mask is the result of the logical AND operation between mask1 and mask2. This output is a new binary mask that highlights the intersection of the two input masks, meaning it contains only the pixels that were active in both mask1 and mask2. This output is crucial for applications that require precise masking of image regions, as it allows you to isolate areas that meet multiple conditions.

Mask And (UTK) Usage Tips:

  • Ensure that both mask1 and mask2 are of the same dimensions to avoid errors and ensure a successful AND operation.
  • Use this node when you need to combine multiple criteria for masking, such as when you want to apply effects only to areas that meet two separate conditions.

Mask And (UTK) Common Errors and Solutions:

输入的两个MASK尺寸不一致

  • Explanation: This error occurs when the input masks mask1 and mask2 do not have the same dimensions.
  • Solution: Verify that both masks are of the same size and shape before inputting them into the node. Resize or crop the masks as necessary to ensure they match.

Mask And (UTK) Related Nodes

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