Nodes/ComfyUI Impact Pack/SEGSToImageList
ComfyUI Node Runs on cloud

SEGSToImageList

Pull the cropped regions out of a SEGS as images

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
SEGSToImageList
  • segs
  • fallback_image_opt
  • IMAGE

You've run a detector, maybe run a detailer, and now you're holding a SEGS - Impact Pack's bundle of detected regions. This node cracks it open and hands you the cropped images inside, as a normal ComfyUI image list you can preview, save, or feed into anything that eats images. It's the bridge from Impact Pack's private data type back to plain old IMAGE.

Quick grounding on SEGS, because half of Impact Pack revolves around it. A detector (a face or hand YOLO, SAM, a segmentation model) returns a SEGS: a header describing the source image, plus one "SEG" per detected thing. Each SEG carries a bounding box, a crop region, a mask, a confidence score, a label - and, after it's been through SEGSDetailer, the refined crop image itself. SEGSToImageList reaches into each SEG and emits that crop.

How it works

It walks the SEGS and produces one image per detected region, packaged as a list (not a batch). The distinction matters: a list runs downstream nodes once per item, so if you wire it into a Save Image you get separate files, one per face/hand/whatever. If a SEG has no stored image yet - which is the case before SEGSDetailer runs, when the SEGS only holds mask and box info - the node falls back to fallback_image_opt: give it the original image and it crops each region out of that instead. So it works both as a "show me the raw detected crops" tool and a "show me the refined crops" tool depending on where you put it.

The inputs and outputs that matter

  • segs (SEGS, required) - the detected regions to unpack.
  • fallback_image_opt (IMAGE, optional) - the original image. Connect it when the SEGS doesn't yet contain crop images, and each region gets cropped from here. If the SEGS does have images, this is ignored.

Output is IMAGE as a list - the per-region crops. Common next stops: a Preview/Save node to eyeball each detection, or Image List to Image Batch if a downstream node wants a batch instead.

How to install it

Install Impact Pack and this comes with it. Via ComfyUI Manager: search ComfyUI Impact Pack, Install, restart. Manual route:

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

then pip install -r requirements.txt in ComfyUI's Python env (portable: python_embeded\python.exe -m pip ...) and restart. It's ltdrdata's pack - the ComfyUI-Manager author - so it's a safe, mainstream install. On first launch the pack auto-fetches a small SAM model into ComfyUI/models/sams; that's for the detectors, not for this node.

Common issues & troubleshooting

The classic confusion: you get blank or full-frame images instead of tight crops. That's the "no image in the SEGS yet" case - you're upstream of SEGSDetailer, so there are no refined crops to emit. Connect the original into fallback_image_opt and you'll get proper crops of each region. Second, remember the output is a list, not a batch - if a downstream node chokes or only processes the first item, insert Image List to Image Batch (or the reverse) to match what it expects. And if the SEGS is empty because the detector found nothing, you'll get nothing out; that's not a bug, the detector just didn't fire - loosen its threshold or check you fed it the right image.

CategoryImpactPack/Util

Inputs (2)

NameTypeDefaultDescription
segsSEGS
fallback_image_optoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE