Preview Mask
Finally, a way to actually see your masks
- masks
Here's a ComfyUI gap that will drive you quietly insane once you notice it: the stock Preview Image node doesn't accept MASK type, and neither does Save Image. So every time a segmentation or masking node hands you a mask, you either convert it to an image to look at it, or you just... trust it. Preview Mask fixes that with exactly one input and no outputs - it's an output node that renders your masks to the UI.
You'd think this would be core. The author clearly thought so too; it's in the same pack as a Coordinates From Mask and a Distance Map, both of which produce masks you'd very much like to inspect before wiring them into an inpainting or compositing pipeline. This node is the eyeball for that whole family.
How it works
Nothing clever, which is the compliment: it takes a batch of masks, converts each to a PIL image, saves it as a temporary JPG in ComfyUI's temp directory (filenames prefixed qtmp_ plus a timestamp), and returns them to the frontend as ui images - the same mechanism every preview node uses. You wire a MASK in, you run, you see grayscale images in the UI. Masks display as grayscale because that's what they are: single-channel values where white is "selected."
Because it's an output node, it appears in your graph as a terminal - nothing downstream, and it always executes (output nodes always run, which is what makes ComfyUI's cache-busting work the way it does). Slap it on the end of a mask-producing branch and every run shows you what that branch actually produced.
The input
One input, masks (MASK). Single 2D mask or a whole batch - both fine. That's the entire node.
Install
From the Quasimondo pack. ComfyUI Manager → search ComfyUI-QuasimondoNodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Quasimondo/ComfyUI-QuasimondoNodes
cd ComfyUI-QuasimondoNodes
pip install -r requirements.txt
No models. Depends only on torch and PIL - the pack's OpenCV/moderngl extras aren't involved.
Where people get burned
Honestly, the main "issue" is people not knowing it exists and converting masks to images by hand every time. The two things to remember: it's a preview, so it writes to the temp directory - don't rely on it for persistence, use it for inspection (or feed the mask into a Save node if you need the file). And it has no outputs by design, so if you're mid-workflow and want to both see a mask and keep using it, drop this node on a duplicate branch rather than expecting it to pass the mask through.
One more: like most mask utilities in this pack, it renders masks as plain grayscale. If a mask looks "empty" because it's a very small or very dim value, that's the mask, not the node - worth checking your upstream before assuming a bug.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — |
Outputs (0)
No outputs