Image/Mask Preview (RMBG) 🖼️🎭
Eyeball the image and the mask in one node
- image
- mask
- IMAGE
- MASK
Half the work in a background-removal graph is squinting at the mask asking "did it actually catch the hair?" This node lets you do that mid-workflow without dead-ending your graph. It shows an image and a mask in the same node - and, crucially, passes both straight through so you can keep wiring downstream. Think of it as ComfyUI's built-in Preview Image, except it also displays the mask and doesn't stop the flow.
Why that matters: in a cutout pipeline the mask is the product. BiRefNet versus InSPyReNet, sensitivity, blur, offset - every knob you turn changes the mask, and the only way to judge it is to look. Native Preview Image is a terminal node with no outputs, so if you drop it mid-graph you have to branch around it. This one is a passthrough, so you can slot it inline anywhere, glance at what's happening at that point, and let the signal continue to the next stage. It's the debug node you leave scattered through a segmentation workflow while you're dialing it in.
How it works
It's an output node, which in ComfyUI means it renders a preview right on the node face - here, the image and the mask side by side. Both inputs are optional, so it happily previews just an image, just a mask, or both at once. Under the hood it isn't transforming anything; it displays what it receives and forwards the same tensors out. No model, no compute worth mentioning.
The inputs and outputs that matter
There are only two inputs and neither is required:
image(IMAGE, optional) - the image to preview. Leave it empty if you only care about the mask.mask(MASK, optional) - the mask to preview. This is usually the reason you dropped the node in - to see whether your segmentation is clean around hair, fur, or a fiddly edge before you commit to it.
The outputs mirror the inputs: IMAGE and MASK, passed through unchanged. Wire them onward to whatever comes next - an extractor, a compositor, another processing stage - and the node earns its place instead of being a dead end. If you leave the outputs unconnected, it still works fine as a plain inline preview.
How to install it
It's part of ComfyUI-RMBG, so you install the pack, not the node.
- ComfyUI Manager: search
Comfyui-RMBG, install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, then./ComfyUI/python_embeded/python -m pip install -r requirements.txt, and restart.
This node needs no weights and no GPU - but the pack it lives in is heavy, bundling every background remover and segmentation model 1038lab could fit, plus their dependencies. If you only want a preview node, that's a lot of baggage; if you're already using RMBG for the actual cutouts, it's free. Windows desktop crashing right after the requirements install? Set PYTHONUTF8=1 and retry, per the pack's install notes.
Common issues
The one you'll actually hit is a missing-input error along the lines of "Required input is missing" - that almost always means the upstream node feeding this one didn't run or didn't produce an output, not that the preview is broken. Check that the node above it executed successfully and that its output is wired in. Beyond that there's not much to go wrong: it's a display-and-forward node, so if you see something ugly in the preview, the bug is upstream in whatever made the mask, and this node just did you the favor of showing it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |