Nodes/ComfyUI-RMBG/Mask Preview (RMBG) 🎭
ComfyUI Node Runs on cloud

Mask Preview (RMBG) 🎭

Actually see your mask mid-graph

By 1038lab·Created 2 years ago·Updated 8 days ago· 2,051
Mask Preview (RMBG) 🎭
  • mask
  • MASK

A mask is invisible until you look at it, and half the time your workflow is misbehaving because the mask isn't what you think. Mask Preview renders a mask right there in the graph so you can see it - where it's solid, where it's soft, where the model missed. It's the single most useful debugging node in any masking pipeline, and yes, that's not hype: you will spend far less time confused if you look at your masks.

Masks are grayscale selection data, not regular images, so you can't just wire one into an image preview and expect it to display sensibly. This node handles the mask type directly and shows it as a proper black-and-white visualization - white where selected, black where not, gray at the soft edges.

How it works

It's an output node: connect a mask, run the graph, and the mask renders in the node body. Because it's an output node, ComfyUI executes the branch that feeds it even if nothing downstream consumes the mask - so dropping a Mask Preview on a side-branch forces that branch to run, which is exactly what you want when you're checking a mask that isn't wired into anything yet.

The input and output that matter

  • mask (required) - the mask to display. Connect it from whatever produced or processed the mask: a segmentation node, a combiner, an enhancer.

Output: MASK, passed straight through, so you can insert this inline in a mask chain without breaking it - preview here, keep going there.

How to install it

  • ComfyUI Manager: search Comfyui-RMBG, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then pip install -r requirements.txt, and restart.

No model - it's a viewer.

How to actually use it

Put one after every mask-producing step while you build: after the segmentation, after a combine, after an enhance. When the final cutout looks wrong, you walk the previews back until you find the one where the mask went bad - that's the node with the problem. It turns "the output is wrong somewhere" into "the mask broke here."

One practical note: a mask that looks solid white in the preview but produces a weak effect downstream might be soft (gray) in places the preview's contrast makes hard to see, so if the visual says "fine" but the result says "not fine," suspect partial values at the edges. And don't confuse this with Image Preview - that one's for IMAGE, this one's for MASK; feed a mask to the image previewer and it won't display right, which is the whole reason this dedicated node exists.

Category🧪AILab/🖼️IMAGE

Inputs (1)

NameTypeDefaultDescription
maskMASK

Outputs (1)

NameTypeDescription
MASKMASK