ComfyUI Node Runs on cloud

SEGSPreview

See what your detector actually found

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
SEGSPreview
  • segs
  • fallback_image_opt
  • IMAGE
alpha_modetrue
min_alpha0.20

When a detailer workflow gives you garbage, this is the node you add to find out why. SEGSPreview renders the regions a detector found - the crops and their masks - so you can actually see what got detected before it goes off and resamples. Nine times out of ten a bad FaceDetailer result is a detection problem (it grabbed the wrong thing, or nothing, or the whole frame), and you can't debug that blind. This node makes it visible.

A word on SEGS, since this node exists to inspect it. A detector hands you a SEGS: metadata plus one detected region per hit, each with a bounding box, a mask, a confidence, and a label. Before SEGSDetailer runs, those regions hold mask info but no picture. SEGSPreview knows this and handles both states.

How it works

It draws each SEG as an image, overlaying the mask so you can see both the crop and the exact area that'll be resampled. If the SEGS already contains images (you're previewing after SEGSDetailer, to check the refined crops before pasting them back), it uses those. If it doesn't (you're upstream, the SEGS is mask-only), it needs the original via fallback_image_opt and crops the previews from there. This is the standard way to preview improved crops before you commit them to the full image - catch a bad detail pass while it's still a preview, not after it's baked in.

The inputs and outputs that matter

  • segs (SEGS, required) - the detections to visualize.
  • fallback_image_opt (IMAGE, optional) - the source image, used to render crops when the SEGS carries no image of its own. Ignored if it does.
  • alpha_mode (BOOLEAN, default true) - show the mask as a translucent overlay rather than an opaque cutout, so you can see the region and its surroundings.
  • min_alpha (FLOAT, default 0.2) - the floor on that transparency, so masked-out areas dim but don't vanish to pure black. Nudge it up if the context is too dark to read.

It's an output node - it displays previews right in the graph - and also emits IMAGE as a list if you want to route the preview frames onward.

How to install it

Comes with Impact Pack. ComfyUI Manager: search ComfyUI Impact Pack, Install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack

then pip install -r requirements.txt in ComfyUI's Python environment (portable build: python_embeded\python.exe -m pip ...), restart. Pack's by ltdrdata, the ComfyUI-Manager maintainer - mainstream and safe. The detectors it previews may need models (SAM auto-downloads to ComfyUI/models/sams; YOLO detectors live in the separate Impact Subpack), but SEGSPreview itself needs nothing extra.

Common issues & troubleshooting

Black or empty previews almost always mean the SEGS has no image and you didn't connect fallback_image_opt - wire the original in and the crops appear. If the preview shows the whole frame masked as one giant region, your detector matched everything (common with an over-loose threshold or a SAM prompt that selected the background); tighten it. And if there are simply no previews, the detector found zero regions - that's the detector, not this node. This node is read-only: it doesn't change your SEGS or your image, so you can leave it wired in permanently as a monitor without affecting the result.

CategoryImpactPack/Util

Inputs (4)

NameTypeDefaultDescription
segsSEGS
alpha_modeBOOLEANtrue
min_alphaFLOAT0.200–1
fallback_image_optoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE