Checking Masks

MaskPreview Node

MaskPreview.json

This is the mask version of the Preview Image node.

Convert Mask to Image Node

Convert_Mask_to_Image.json

Converts a mask to a black and white Image.


Creating Masks

Load Image (as Mask) Node

Load_Image_(as_Mask).json

Loads an image file directly as mask data.

  • channel:
    • red/green/blue: If using a black and white image, any choice is OK.
    • alpha: Select this if you want to use the "transparent part" of a transparent PNG as a mask.

Convert Image to Mask Node

Convert_Image_to_Mask.json

Converts an IMAGE (RGB image) in the workflow to a MASK.

It's like breaking down the Load Image (as Mask) node.

🪢 Color To Mask Node

Color_To_Mask.json

Converts a specific color of an image (such as a green screen) to a mask. This is so-called chroma key processing.

There is a core node called ImageColorToMask with similar functionality, but it is difficult to use because the threshold cannot be adjusted, so we use the following custom node.

Specify the target color in RGB and adjust the color error with threshold.

SolidMask Node

SolidMask.json

Creates a rectangular mask of the specified size.

Use this when you need a fully filled (or empty) mask.

Mask Editor

A tool that allows you to draw specific parts of an image as a mask (black and white image) on ComfyUI.

  • How to launch: Select a Load Image node etc. → Click 🌔 (Open Mask Editor) in the Node Selection Toolbox.

Switch functions with the tabs on the left edge.

  • Draw Mask: Draw a mask with a brush.
  • Fill: Fills the area enclosed by the handwritten mask.
  • Auto Select: Automatically masks the range of colors similar to the clicked point.

When editing is complete, click Save in the header to apply.

For detailed operation instructions, please see Mask Editor.


Utilizing Depth Maps

🪢 Depth Map

DepthmapAsMask.json

A depth map is a black and white gradient image. This means it can be diverted as a mask as it is.

Smartphone apps have processing to blur the background of photos later, and basically, it is the same mechanism.

For how to create depth maps, please see How to create control images (TBD).


Editing Masks

CropMask Node

CropMask.json

Crops the mask to the specified range.

GrowMask Node

GrowMask.json

Expands the outline of the mask. If the value is negative, you can also narrow (thin) it.

🪢 Gaussian Blur Mask Node

Gaussian_Blur_Mask.json

Blurs the mask. Important for blending boundaries during composition.

InvertMask Node

InvertMask.json

Inverts the black and white of the mask.

ThresholdMask Node

ThresholdMask.json

Converts a mask with intermediate values (gradients) into a binary (white or black) mask at the specified threshold.

🪢 Remap Mask Range Node

Remap_Mask_Range.json

Adjusts how the gradient mask is applied. Combining with the aforementioned "Depth Map", you can change "which position" in the depth to focus on, obtaining interesting effects.


Compositing Masks

MaskComposite Node

MaskComposite.json

Composites two masks in various modes (addition, subtraction, multiplication, etc.).


Sample Images