ComfyUI Node Runs on cloud

SEGS Merge

Collapse many detected regions into one

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
SEGS Merge
  • segs
  • SEGS

Sometimes your detector hands back a fistful of separate regions when what you actually want is one. SEGS Merge takes a SEGS full of individual detections and fuses them into a single merged region - one combined mask, one bounding box that covers them all. Useful when you'd rather run one detail pass over the whole cluster than N passes over N tiny pieces.

Context: a SEGS is Impact Pack's detection container - a header plus one "SEG" per detected thing, each with a bounding box, a mask, a confidence, and a label. Most nodes process each SEG independently. This one deliberately does the opposite: it integrates several SEGs into a single merged SEG.

How it works

Per the pack's own description, it integrates the multiple SEGs into one. The merged region's label becomes merged, and its confidence is set to the minimum confidence among the inputs (the conservative choice - the fused region is only as trustworthy as its weakest member). Two things get dropped in the process: any applied ControlNet and the cropped image. So merge before you attach ControlNet or run SEGSDetailer, not after - anything image-side or control-side that was already on those SEGs won't survive the merge. What you're left with is a single detection spanning everything the inputs covered.

The input and output

  • segs (SEGS, required) - the multiple detections to merge. Only input.

Output is a SEGS that now contains one merged element. It flows on exactly like any other SEGS - into a detailer, a preview, a mask conversion - the difference being downstream nodes now see a single region instead of many.

How to install it

Ships inside Impact Pack. ComfyUI Manager: search ComfyUI Impact Pack, Install, restart. By hand:

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 author - trusted, mainstream, no drama. No extra models for this node.

Common issues & troubleshooting

The gotcha people hit: they merge, then wonder where the cropped image or the ControlNet they'd set went - the answer is the merge removes both, by design. Order your graph so merging happens early. Second, the merged confidence is the minimum of the inputs, so if you're filtering by confidence downstream, a single low-confidence member drags the whole merged region down; filter first if that's a problem. And be deliberate about whether you even want this - merging four faces into one region means one detail pass tries to resample all four at once, which usually defeats the point of detailing (small faces getting full-resolution attention individually). Merge is for when the regions genuinely belong together, like tiles or fragments of one object, not for batching unrelated detections.

CategoryImpactPack/Util

Inputs (1)

NameTypeDefaultDescription
segsSEGS

Outputs (1)

NameTypeDescription
SEGSSEGS