Preview Mask
Finally See the Grayscale Blob You're Diffusing Against
- masks
- MASK
What it is
Masks are the silent partner in half of ComfyUI's most useful tricks - inpainting, detailing, background removal - and they're infuriating to debug because a MASK tensor is just a single-channel grayscale array. You can't see it on screen the way you see an image. Preview Mask fixes that: it renders your mask batch as visible grayscale PNGs so you can actually check what you're about to feed into an inpaint or a detailer.
You know how it goes. The inpaint comes back with a mangled edge or a region that wasn't touched at all, and your first suspect is the mask - did it hug the subject, is it inverted, does it cover the right half of the image? Without a preview you're guessing. With this node, you're looking.
How it works
The mechanism is straightforward: take each mask in the batch, normalize it to 0β255, and save it as a grayscale (mode="L") PNG in ComfyUI's temp folder, where the UI picks it up and displays it. White is "apply here", black is "leave alone", and the mid-grays are the soft edges - the exact thing you need to eyeball when a mask's blur or padding looks wrong.
It handles the usual batch shapes, squeezing out singleton dimensions, and saves one PNG per mask. The output is the MASK passed through unchanged, so you can drop it anywhere in a mask pipeline purely to see what's there, without touching the data flow.
The inputs and outputs that matter
- masks (required) - the batch of masks to preview.
Output:
- MASK - the same masks, passed through. A genuine output node (always runs, cache works backward from it), and the pass-through means you can preview at a checkpoint in the middle of a mask chain.
When you'd use it
Any time a mask is doing something surprising. Feed it right after your mask generator - a segmentation detector, a SAM node, an auto-mask - to confirm the mask actually covers the region you think it does before you spend a sampling pass on it. It's also the fastest way to diagnose the classic detailing problems: a mask that's too tight (feathers visible after paste-back), too loose (bleeding into background), or inverted (your inpaint is working on everything except the face). See the masking/detailing doc for why getting the mask right is the whole game in automatic detailing - the re-render is just inpainting, and inpainting is only as good as its mask.
Installing it
Ships with ComfyUI_Eclipse:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse
pip install -r ComfyUI_Eclipse/requirements.txt
then restart, or use Manager and search "Eclipse". Note the pack's lineage if you're loading old graphs: it was previously RvTools_v2 and v4.0.0 deleted the legacy nodes, so the bundled migration tool is your friend there.
Common issues
The main trap is the same temp-folder one every preview has: the rendered mask PNGs live in temp, not output, so they're scratch - fine for looking, not for archiving. And if the preview shows nothing, it's almost always an empty mask batch. Beyond that there's little to go wrong; this node is about as close to "dumb viewer" as the pack gets, which is exactly why it's so useful.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | Batch of masks to preview |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | β |