OFF SEGS to Image
Get a Face Crop Out of SEGS Without a Detector SDK
- segs
- fallback_image_opt
- IMAGE
SEGS is a tidy data structure - until you want an actual image out of it and realize the detector's crops are hiding inside objects you can't easily slice into in the graph. This node pulls the cropped image out for you. Feed it a SEGS stream, get an IMAGE back.
It's part of ComfyUI-off-suite, and it's a small piece of plumbing that makes SEGS-based workflows dramatically less fiddly. The one thing you have to remember is written all over the source: despite the plural-friendly name, you get one image out.
What you plug in
- segs - required. Any SEGS stream (Impact Pack detector output, SAM, etc.).
- fallback_image_opt - optional. The original image to crop from, used when a segment has no pre-cropped image baked in. Some detectors store the crop on the segment; some don't, in which case this node crops the region out of your provided image instead.
What comes out and the ordering surprise
Output is an IMAGE. Here's the mechanism: the node loops over every segment, grabbing each one's cropped image (or cropping from the fallback), and collects them into a list - then returns only results[0], the first one. If your detector found four faces, you get face #1's crop. It's not a bug that will error; it's a design choice that will confuse you the first time you feed it a batch and expect a batch back.
If you want a specific face rather than just the first, the pack's other node - SEGS to Face Crop Data - is the one: it takes a face_index and hands back both the crop image and the CROP_DATA needed to paste it home.
Also worth knowing: if a segment has no cropped image and no fallback is provided, you get a small black placeholder (a 64×64 empty image) rather than an error. That's the pack's consistent "fail soft instead of crash" style, and it can silently give you black squares if you're not watching.
Where it fits
Any graph where you've detected something and want to do a focused pass on the detected region: crop the face out here, run a detail or inpaint pass on it, paste it back with Paste Face Segment to Image. It's the "get me an image out of SEGS" half of the classic detect-crop-refine loop that Impact Pack's FaceDetailer automates, but here you control the steps yourself.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Off-Live/ComfyUI-off-suite
# or: ComfyUI Manager → search "ComfyUI-off-suite"
No extra Python dependencies. You do need Impact Pack installed for the SEGS type itself, plus a detector to produce the stream. Pack's been quiet since mid-2024, and this node is the kind of utility that just keeps working.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — | |
| fallback_image_optopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |