Decompose (SEGS)
Split a SEGS into its header and individual elements
- segs
- SEGS_HEADER
- SEG_ELT
This is the "open up the box and let me touch the parts" node. A SEGS is normally opaque - you pass the whole bundle from detector to detailer and never look inside. Decompose cracks it into two pieces: the header (the shared metadata) and a list of the individual elements. Once they're separated you can inspect, tweak, or rebuild them by hand, then reassemble the whole thing with AssembleSEGS.
It's flagged experimental in the pack, and fairly, because you're rarely doing this in a normal detailing workflow. It's for the cases where you need surgical control - reading exact coordinates off one detection, editing a single element's label or mask, reordering, dropping one - the stuff the higher-level filter nodes don't expose.
How it works
A SEGS is really a header plus a list of SEG elements. The header holds the frame-level info shared by every element (the source image dimensions), and each element (SEG_ELT) holds one detection's own data - its bounding box, crop region, mask, confidence, and label. Decompose just returns those two halves as separate outputs. The elements come out as a list, so downstream nodes iterate over them one at a time, which is exactly what you want when you're extracting or editing per-detection detail. The intended loop is: Decompose → pull data with From SEG_ELT (bbox, crop region) or change it with Edit SEG_ELT → AssembleSEGS to put a valid SEGS back together using the original header.
The input and outputs
segs(SEGS, required) - the bundle to take apart. Only input.
Two outputs:
SEGS_HEADER- the shared metadata. Hold onto it; AssembleSEGS needs it to rebuild a valid SEGS.SEG_ELT(a list) - the individual detections, one item each, ready for per-element manipulation.
How to install it
Part of 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: python_embeded\python.exe -m pip ...), restart. Pack's by ltdrdata, the ComfyUI-Manager maintainer - mainstream and safe. No models needed for the decompose/assemble family itself.
Common issues & troubleshooting
Keep the header. The single most common mistake with this family is decomposing, doing element work, and then having nothing to hand AssembleSEGS as the header - route SEGS_HEADER straight across to the reassembly node so the rebuilt SEGS knows its source frame. Second, this is genuinely a power-user tool: if all you want is "keep the biggest face" or "drop low-confidence hits," the SEGS filter nodes (ordered, range, label, non-max-suppression) do that without you touching individual elements, and they're less fiddly. Reach for Decompose only when you actually need element-level access the filters don't give you - reading precise bbox coordinates out for another part of the graph, say, which is what From SEG_ELT bbox is for.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| segs | SEGS | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| SEGS_HEADER | SEGS_HEADER | — |
| SEG_ELT | SEG_ELT | — |