🎭 Preview Mask
Actually see your mask on top of the image before you sample with it
- image
- mask
Masks are the most invisible thing in ComfyUI. You generate one, feed it into an inpaint or a control pass, and only find out it was inverted, shifted, or full of holes when the result comes back wrong. The 🎭 Preview Mask node is the "show me what I'm actually working with" step: it composites your mask over your image and previews the result so you can see exactly what a sampler is going to see.
How it works
It's built on ComfyUI's SaveImage, so the preview lands in your temp directory and shows up in the normal image preview area - no custom viewer needed. You feed it an image and a mask, pick how you want the preview drawn, and it saves a composited PNG. It's an output node: no outputs, it exists purely to render something for your eyes.
The interesting input is Preview, a dropdown with nine modes:
- none - the image with the mask as alpha (transparent where the mask is).
- image - just the image, unmodified.
- mask - the mask itself, rendered as a grayscale image.
- Black / White / Gray / Red / Green / Blue - the image shown through the mask, with the unmasked area filled with the chosen solid color. Red is the one you'll reach for: mask-as-red-overlay is the classic "show me where this is going to act" view.
There's also invert_mask, whose tooltip says it plainly: "Invert mask values (0->1, 1->0)". It does the inversion before compositing, so you can check what the inverted interpretation of your mask looks like without changing anything upstream - very handy for diagnosing the classic inverted-alpha mishap.
Honest limitations
The node normalizes masks (scales 0–1, crops/pads to the image size), which is convenient, but it silently truncates a mask that's larger than the image rather than erroring. And the tooltip attached to invert_mask is the most useful documentation in the whole node - believe it, not any assumption about which side of a mask is "the part that gets edited," because that convention varies between workflows.
When you'd use it
Any time a mask matters: inpaint workflows, background-removal passes, ControlNet area conditioning, or before you run that expensive re-denoise and wish you'd checked the mask alignment first. It's a debugging node, and it's exactly the kind of cheap sanity check that saves you a wasted render.
Install
Part of Light-x02 Nodes - ComfyUI Manager → search "ComfyUI-Lightx02-Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Light-x02/ComfyUI-Lightx02-Nodes
Restart ComfyUI, find it under 💡Lightx02/utilities. No extra dependencies beyond torch and torchvision, which ComfyUI already requires.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| invert_mask | BOOLEAN | false | Invert mask values (0->1, 1->0) |
| Preview | COMBO | 9 options: none, image, mask, Black, White, Gray, +3 | |
| image | IMAGE | — | |
| mask | MASK | — |
Outputs (0)
No outputs