Nodes/NH-Nodes/Segs Preview (NH)
ComfyUI Node

Segs Preview (NH)

See every instance drawn on your own photo

By jetthuangai·Created 6 months ago·Updated about 12 hours ago· 7
Segs Preview (NH)
  • image
  • segs
  • preview

The most common wasted hour in a segmentation workflow is debugging the wrong thing. The mask comes out wrong, so you fiddle with thresholds, when actually SAM 3 found the right object and something downstream combined labels wrong. Segs Preview is the node that stops that happening: it draws the instances on the picture they came from, each tinted, outlined and labelled with its label and score, at the full size of the image.

What it is

Two inputs, one output. image is the picture the segs were found in, segs is the instances from SAM3 Segment, Garment Segment, Portrait Segment, Body Segment or Segs Select. What comes back on preview is an IMAGE - the original with the instances drawn over it.

That IMAGE output is the useful part. It's an ordinary image, so it goes into Preview Image, Save Image, an Image Compare, or a batch of comparisons if you're testing several concept strings against one photo.

Why you'd wire it up

SAM3 Segment already draws a preview on its own node card. The differences that make this worth a node slot:

Full resolution. The on-node preview is capped at 1536 px on the longer side, which on a 6000 px photo means you can't see whether the window frame edge is clean. Segs Preview draws at the size of the picture - an 8K photo gives you an 8K preview.

After a selection. Drop it after Segs Select and you see exactly what survived the filter, which is how you confirm "the second person from the left" is really the second person from the left rather than the second one SAM 3 happened to return.

Readable instance identity. Colours follow the order of the instances, each label sits above the highest point of its instance, and the label size scales with the picture. On a photo with fifteen detections that's how you spot that two of them are the same chair at two thresholds.

If you're just checking whether a concept found anything, the node card is fine. If you're deciding whether a mask edge is good enough to inpaint against, you want this.

How it works, in one line

It walks the instances, tints each mask inside its box, outlines it, and lays the label and score above the box. Nothing clever, nothing that changes the picture content. The one thing to know is the colour assignment is positional, not semantic: the same person isn't guaranteed the same colour between two runs if the instance order shifted. Read the labels, not the colours.

Installing it

ComfyUI Manager, search NH-Nodes, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/jetthuangai/NH-Nodes.git
cd NH-Nodes
python -m pip install -r requirements.txt

No models, no downloads. The pack's requirements are numpy, Pillow, scipy, opencv-python, scikit-image, transformers, tqdm and huggingface_hub - all installed by that last command - and it targets a recent ComfyUI (tested on 0.41) with Python 3.10+. The heavy lifting (Sapiens2, SAM 3) belongs to the segmentation nodes, not this one.

Common issues

"Sizes don't match" or a mismatched image count error. The node compares the picture against the segs and stops if they disagree. This is nearly always wiring: you passed the processed image (resized, cropped, upscaled) instead of the one that went into the segmentation node. Wire the same IMAGE to both.

Nothing drawn, but no error. You have no instances. That's not a failure - count on SAM3 Segment would be 0 too. Read the report there and lower threshold.

Colours look wrong after Segs Select. Expected: the palette is assigned by instance order, and Segs Select reorders. It's a preview node, not a stable visual index.

It's not an output node. It passes an IMAGE on and doesn't force the graph to run by itself - put a Preview Image or Save Image after it, or nothing appears.

CategoryNH-Nodes/Vision

Inputs (2)

NameTypeDefaultDescription
imageIMAGE—
segsNH_SEGS—

Outputs (1)

NameTypeDescription
previewIMAGE—