SEGM Detector (combined)
Turn a segmentation model into a mask
- segm_detector
- image
- MASK
SEGM Detector (combined) takes a segmentation model and an image, runs the model, and gives you back a single mask covering everything it found. If a bounding-box detector draws a rectangle around a face, a segmentation detector traces the actual outline - hair, jaw, the real silhouette - and that's what this node hands you. "Combined" means it merges every detection into one flat MASK rather than keeping them separate.
This is a supporting player in Impact Pack's whole reason for existing. The pack's core trick, the thing FaceDetailer made standard, is detect-crop-refine: find a region, crop it, resample it at full resolution, paste it back. A tiny face in a wide shot gets almost no latent budget and comes out mangled; give it its own pass and it comes back sharp. Detection is step one of that loop, and SEGM Detector (combined) is one of the ways you do detection - the outline-based way, as opposed to the box-based BBOX Detector. Because a segmentation mask hugs the subject instead of boxing it, you get cleaner, less obvious seams when you composite the refined region back. That's the same reason the A1111 crowd moved from box detectors to segmentation detectors for ADetailer: the mask follows the face, not a rectangle around it.
The inputs that matter
Four inputs, and two of them are the ones you'll touch. segm_detector is a SEGM_DETECTOR - you don't type it, you feed it from a loader that provides one. image is the picture to scan. Then:
- threshold (default 0.5) is the confidence cutoff. Raise it and only strong detections survive; lower it and the detector gets greedy, which can pull in false positives. If it's missing a subject, drop this; if it's masking junk, raise it.
- dilation (default 0) grows or shrinks the mask edge. Positive values expand the mask outward - useful when the refine pass needs a little margin around the subject - and negative values (down to -512) erode it inward. A small positive dilation is a common tweak so the composite blends instead of cutting a hard line.
The output is a single MASK. Wire it wherever a mask goes: into a detailer's mask input, into MASK to SEGS to turn it into the SEGS format the detailer nodes prefer, or into any inpaint pass.
The dependency nobody warns you about
Here's the thing that trips people up: this node needs a SEGM_DETECTOR to feed it, and the popular source for one - UltralyticsDetectorProvider, which loads YOLO-family segmentation weights - is not in the base Impact Pack anymore. Since v8.0 it lives in a separately-installed companion, the Impact Subpack. If your segm_detector input has nothing to plug into, that's why. Install ComfyUI-Impact-Subpack and the provider (and the model dropdown) shows up.
Worth knowing the history: that Ultralytics dependency is the one behind Impact Pack's worst moment - a December 2024 supply-chain compromise where a poisoned Ultralytics release shipped a cryptominer and reached ComfyUI users through this pack. The split into a Subpack means the risky dependency is now opt-in rather than bundled. Nothing to panic about today, but it's the reason detection lives one install away from the rest.
Common issues
If detections are empty, check that a model is actually loaded into the provider feeding segm_detector and that your threshold isn't cranked too high. If the mask is ragged or too tight against the subject, add a few pixels of positive dilation. And if the whole thing errors on a type mismatch - Impact Pack uses wildcard types in a lot of places and ComfyUI's validator sometimes complains even when the wiring is fine - check first that you fed an actual segmentation detector and not a bbox one; the two aren't interchangeable.
Installing it
The node comes with ComfyUI Impact Pack. Install via ComfyUI-Manager (search ComfyUI Impact Pack, Install, restart), or manually: cd ComfyUI/custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack, install its requirements.txt in ComfyUI's Python environment (portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt), restart. On first run the pack auto-downloads a SAM model into ComfyUI/models/sams. To actually get a segmentation detector to feed this node, also install ComfyUI-Impact-Subpack for UltralyticsDetectorProvider - the base pack no longer bundles it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| segm_detector | SEGM_DETECTOR | — | |
| image | IMAGE | — | |
| threshold | FLOAT | 0.500–1 | — |
| dilation | INT | 0-512–512 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |