Set Default Image for SEGS
Give your detections an image to stand on
- segs
- image
- SEGS
Here's a thing that confuses everyone the first time: a SEGS object fresh out of a detector doesn't contain any image. It's just detection info - where the boxes are, the masks, the labels, the confidence scores. As the node's own description puts it, "if the SEGS have not passed through the detailer, they contain only detection area information without an image." That's fine until some downstream node wants to look at the region, and then it has nothing to work with. Set Default Image for SEGS solves that by baking an image reference into the SEGS.
You'd reach for it mostly to make previews and pastes behave. SEGSPreview and SEGSPaste both need pixels to show or composite; setting a default image up front means you don't have to keep threading a fallback_image_opt into every node that asks.
How it works
The mechanism is exactly as unglamorous as it sounds. Each SEG in the SEGS gets pointed at the image you provide, so anything reading the SEGS later - a preview, a paste, a detailer that wants a base - has an image to fall back on instead of a blank. The README frames it as a convenience: "SEGS with images set this way do not need to have a fallback image set."
The one behavior worth understanding is the override toggle. When a SEG already carries an image (say it came through SEGSDetailer and holds the refined crop), override decides whether your new image replaces it. Per the README, "when override is set to false, the original image is preserved" - so leave it false when you want detailer results to survive, and set it true when you deliberately want to stamp a fresh base image over everything.
The inputs that matter
segs- the detections you're attaching an image to. Required.image- the image every SEG will reference. Usually your original generated image. It should match the dimensions the SEGS were detected on.override(default true) - replace any image a SEG already holds (true), or keep existing ones and only fill in the empty ones (false).
Output is a single SEGS, now image-aware, ready for SEGSPreview, SEGSPaste, or a detailer.
How to install it
ComfyUI Manager is the easy road: search ComfyUI Impact Pack, install, restart. Manual install: cd ComfyUI/custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack, then pip install -r requirements.txt into ComfyUI's Python (on Windows portable, ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt), and restart. The pack stopped auto-installing at v7.6, so run the requirements yourself. A small SAM model auto-downloads to ComfyUI/models/sams on first load.
Common issues
Size mismatch. The default image needs to line up with the frame the SEGS were detected on. Hand it a differently-sized image and downstream pastes will land in the wrong place or error. Use the same original image the detector ran on.
Your detailer results vanished. If you set this node with override true after a SEGSDetailer, you just overwrote the refined crops with the base image. Set override to false when you only mean to supply a fallback for SEGs that don't already have one - or better, place this node before the detailer, not after.
It's the sibling to Remove Image from SEGS. If you ever need the opposite - strip the stored image so a detailer works from the current pixels instead - that's the Remove Image from SEGS node, not this one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — | |
| image | IMAGE | — | |
| override | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SEGS | SEGS | — |