Checking Masks
MaskPreview Node

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

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

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

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

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.
- Kijai/ComfyUI-KJNodes:
Color To Masknode
Specify the target color in RGB and adjust the color error with threshold.
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 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 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 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

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 ControlNet Preprocessor.
Editing Masks
Resize Image/Mask Node
It is covered in detail in Resize Image/Mask Node, so please refer to that.

Here, I will only touch on match size.
When you resize an image, the size of the image and the mask may become misaligned, making it impossible to maintain correspondence.
By using match size, you can resize the mask side to match the reference image, keeping the shape (positional relationship) aligned.
CropMask Node

Crops the mask to the specified range.
GrowMask Node

Expands the outline of the mask. If the value is negative, you can also narrow (thin) it.
🪢 Gaussian Blur Mask Node

Blurs the mask. Important for blending boundaries during composition.
- Included in ComfyUI-Impact-Pack etc.
InvertMask Node

Inverts the black and white of the mask.
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 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

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





