SEGM Detector (SEGS)
Silhouette-shaped masks that seam less than boxes
- segm_detector
- image
- detailer_hook
- SEGS
SEGM Detector (SEGS) does the same job as its bounding-box sibling - scan an image, find the things, output SEGS for a detailer to refine - with one difference that matters more than it sounds: the mask follows the outline of what it found, not a rectangle around it. A segmentation model returns the person-shaped or face-shaped region itself, so the mask you carry forward hugs the silhouette instead of boxing it.
Why care? Because the rectangle is where detailing shows its seams. When a bounding-box mask gets refined and pasted back, the edge of the fix is a straight line running through background pixels, and on a busy scene you can see it. The community that lives on this stuff has been drifting toward segmentation detectors for exactly this reason - polygon masks "create much more accurate masks, that allow for much less obvious seams, if any," as one detector author put it. This node is how you get that shape inside the Impact Pack.
How it works
A segmentation (SEGM) model runs over the image and returns, for each hit, a filled region rather than a box. This node wraps each region, expands it, and bundles the set as SEGS - the same structure a bbox detector produces, just with better-shaped masks inside. Like every detector node here it's a consumer, not a detector: the segm_detector input is required and comes from a provider that loads a segmentation-capable YOLO (a -seg model), which since v8.0 means the separately installed Impact Subpack.
The trade against bbox detection is speed and availability: segmentation models are a touch heavier, and you need a -seg variant. When the mask edge doesn't matter - a face that's going to be feathered generously anyway - the plain box detector is fine. When it does, this is the upgrade.
The inputs and outputs that matter
The knobs are identical to the bbox detector, which is deliberate:
segm_detector(required) - a segmentation YOLO from a provider node. Note it's the SEGM provider output, not the BBOX one; they're different types.image(required) - the picture to scan.threshold(default 0.5) - confidence cutoff. Lower catches more (and more false hits), higher keeps only the confident ones.crop_factor(default 3) - context captured around each detection for the detailer to blend into.dilation(default 10) - grows each mask outward; negatives erode. Because the mask already tracks the outline, you often need less dilation here than with a box.drop_size(default 10) - discards detections smaller than this.labels(defaultall) - keep everything, or name specific classes (one per line) to filter.
Optional detailer_hook for advanced behavior. Output is a single SEGS that feeds Detailer (SEGS), a SEGS filter, or a paste node.
How to install it
Install the pack via ComfyUI Manager (search ComfyUI Impact Pack, install, restart), or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt # ComfyUI's python; python_embeded on portable
then restart. You'll also want the Impact Subpack for the detector provider - and specifically a segmentation model (a -seg YOLO, e.g. a person_yolov8*-seg) rather than a plain box detector, or this node has nothing to consume. Linux: libgl1-mesa-glx and libglib2.0-0 for OpenCV.
Common issues & troubleshooting
The provider output won't connect. You wired a BBOX_DETECTOR into a SEGM_DETECTOR slot. They're distinct types - load a segmentation model in the provider so it emits the right one.
Empty SEGS. Threshold too high, drop_size too aggressive, or the model can't find your subject. Lower the threshold or switch models.
It's not obviously better than the box detector. On tightly cropped portraits it barely is - the box already covers the whole face. The payoff shows on full-body and group shots where a rectangular face mask would slice through hair and background. If seams are your problem there, segmentation plus modest dilation is the fix; if they aren't, don't pay for the heavier model.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| segm_detector | SEGM_DETECTOR | — | |
| image | IMAGE | — | |
| threshold | FLOAT | 0.500–1 | — |
| dilation | INT | 10-512–512 | — |
| crop_factor | FLOAT | 3.01–100 | — |
| drop_size | INT | 101–16384 | — |
| labels | STRING | all | — |
| detailer_hookopt | DETAILER_HOOK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SEGS | SEGS | — |