Checking Masks
MaskPreview Node

This is the mask version of the Preview Image node.
Convert Mask to Image Node

Converts a mask into a black-and-white Image.
Creating Masks
Load Image (as Mask) Node

Loads an image file directly as mask data.
- channel:
red/green/blue: For a black-and-white image, any of these works.alpha: Choose this to use the transparent areas of a transparent PNG as the mask.
Convert Image to Mask Node

Converts an IMAGE (RGB image) in the workflow to a MASK.
Think of it as the Load Image (as Mask) node split into its parts.
🪢 Color To Mask Node

Converts a specific color in an image (such as a green screen) into a mask. In other words, chroma keying.
There is a core node with the same kind of function, ImageColorToMask, but you can't adjust its threshold, which makes it awkward to use, so I use the following custom node instead.
- Kijai/ComfyUI-KJNodes:
Color To Masknode
Specify the target color in RGB, and use threshold (tolerance) to set how far the color can be off.
Create Solid Mask Node

Creates a rectangular mask of the specified size.
Use this when you need a fully filled (or empty) mask.
Mask Editor
A tool for painting parts of an image as a mask (black-and-white image) right inside ComfyUI.
- How to launch: Select a
Load Imagenode etc. → Click🌔(Open Mask Editor) in theNode Selection Toolbox.
Switch functions with the tabs on the left edge.
- Draw Mask: Draw a mask with a brush.
- Fill: Fills an area enclosed by a hand-drawn mask.
- Auto Select: Automatically masks areas with colors similar to the spot you click.
When you're done, click Save in the header to apply it.
For details on how to use it, see Mask Editor.
Utilizing Depth Maps
🪢 Depth Map

A depth map is a black-and-white gradient image, which means you can use it directly as a mask.
Smartphone apps that let you blur a photo's background after the fact work in basically the same way.
For how to create depth maps, see ControlNet Preprocessor.
Editing Masks
Resize Image/Mask Node
This is covered in detail in Resize Image/Mask Node, so see that page.

Here, I'll only cover match size.
When you resize an image, the image and mask sizes can end up out of sync, so they no longer line up.
With match size, you can resize the mask to match a reference image, so the two line up while keeping the shape (and positions) intact.
CropMask Node

Crops the mask to the specified range.
GrowMask Node

Expands the edges of the mask. A negative value shrinks it instead.
🪢 Gaussian Blur Mask Node

Blurs the mask. This matters for blending edges when compositing.
- Included in ComfyUI-Impact-Pack etc.
InvertMask Node

Inverts the mask, swapping black and white.
ThresholdMask Node

Converts a mask with intermediate values (gradients) into a binary (white or black) mask at the specified threshold.
🪢 Remap Mask Range Node
Adjusts how a gradient mask is applied. Combine it with the depth map from earlier, and you can shift which depth the effect focuses on, which gives some fun results.
Compositing Masks
MaskComposite Node

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





