Preview Mask
Preview Mask
- mask
- images
Masks are invisible. That's the whole problem this node solves. A MASK in ComfyUI is a single-channel image that nothing displays for you by default, so when your inpaint or detailing result is wrong, you're often debugging blind - is the mask covering the region you think it is, or is it inverted, offset, or empty? preview_mask takes a MASK and renders it as a normal grayscale image you can actually look at.
Why you'd reach for it
Anytime you're building a workflow that generates masks - from a detector, a threshold, a "convert image to mask," a paint-on mask, whatever - you want to see the thing before you trust it. Half of all inpainting frustration comes from a mask that's subtly wrong: white where you meant black, a soft edge where you needed a hard one, or nothing at all because an upstream node found no region. Drop preview_mask on the mask line and the guesswork disappears. It's the mask equivalent of the standard Preview Image node, and once you've used it you'll leave one wired into every masking branch you build.
How it works
It converts the incoming MASK into a viewable image and saves it to your ComfyUI output directory so it shows up in the node's preview - that's literally what the node's description says it does under the hood. White pixels are the masked (selected) area, black is unselected, and any grey is a partial/feathered value. Seeing that gradient is exactly why the node is useful: a feathered edge that looks fine as a number is obvious as an image.
The inputs and outputs
There's really only one thing to wire:
- mask - the MASK you want to look at. That's the entire required input.
It's an output node, so it displays the render right on the node like Preview Image does. It also exposes an images output (IMAGE), so you can additionally route the visualized mask onward - into a Save Image node, or a comparison, or anywhere you'd want the grayscale version as an actual image rather than a mask.
Installing it
ComfyUI Manager → search antrobots ComfyUI Nodepack, install, restart. Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack
Nothing to download beyond the pack itself - it's a display utility.
Common issues
If the preview comes up totally black, your mask is empty - nothing selected. That's usually the real finding: an upstream detector or threshold produced no region, which is why your inpaint "did nothing." Fix the mask source, not this node.
If it comes up totally white, the mask is selecting everything, which often means an inversion somewhere upstream (a lot of mask nodes have an "invert" toggle that's easy to leave on). And if the shape is right but in the wrong place, you've got an offset or a resize mismatch earlier in the chain - the mask and image aren't the same dimensions. In every one of these cases the node is doing its job perfectly; it's just showing you the truth about a mask you couldn't see before.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |