Nodes/ComfyUI Impact Pack/BBOX Detector (SEGS)
ComfyUI Node Runs on cloud

BBOX Detector (SEGS)

Find every face and hand it off to a detailer

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,248
BBOX Detector (SEGS)
  • bbox_detector
  • image
  • detailer_hook
  • SEGS
threshold0.50
dilation10
crop_factor3.0
drop_size10
labelsall

BBOX Detector (SEGS) is the front half of the Impact Pack's detect-crop-refine loop. You point a YOLO detector at an image, and instead of one flat mask it hands you SEGS - a bundle where every detected face, hand, or person is its own entry, carrying the crop box and coordinates that a detailer needs to work on each one separately. This is the node you actually want when the next step is fixing small faces at proper resolution.

Here's the context. In Impact Pack, SEGS is the currency. A face that occupies 80x80 pixels of a 1024x1024 frame got 80x80 pixels' worth of the model's attention and came out mushy - that's structural, no checkpoint fixes it. The cure is to crop that region, resample it at full resolution, and paste it back. SEGS is what carries the "where and how big" for each region through that pipeline. This node produces it; a Detailer (SEGS) consumes it. If you just want a single merged mask with no per-detection structure, that's the combined node, not this one.

How it works

The detector runs across the whole image and returns bounding boxes with confidence scores. This node keeps each box separate, expands it a little, and packages the set as SEGS. It does not contain a detector - it's a consumer. The bbox_detector input is required and comes from a provider node, almost always UltralyticsDetectorProvider, which loads a YOLO .pt model. Since Impact Pack v8.0 that provider lives in the separately installed Impact Subpack, so without the Subpack you have nothing to plug into bbox_detector and the node sits dead.

The inputs and outputs that matter

  • bbox_detector (required) - the YOLO detector doing the work. Feed it from a provider node. The input people forget exists.
  • image (required) - the picture to scan.
  • threshold (default 0.5) - confidence cutoff. Drop it toward 0.3 to catch small or partly hidden faces at the cost of false positives; raise it to keep only confident hits.
  • crop_factor (default 3) - how much context around each detection ends up in the crop. 3 means the crop is roughly three times the box. Too tight and the detailer has no surrounding context to blend into; too loose and you waste resolution on background. 3 is a sane default for faces.
  • dilation (default 10) - grows each mask outward by that many pixels so the fix doesn't cut the object edge tight. Negatives erode.
  • drop_size (default 10) - ignores detections smaller than this, which is how you stop it from "fixing" a stray 8px false hit.
  • labels (default all) - filter which detected classes to keep. Leave it all, or name specific labels (one per line) when your detector reports multiple classes and you only want, say, faces.

There's one optional detailer_hook for advanced per-detection behavior. The single output is SEGS, which wires straight into Detailer (SEGS), a SEGS filter, or SAMDetector (combined) for silhouette refinement.

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. Auto-install was dropped back at v7.6, so Manager or the manual requirements.txt route is the only way now. Crucially, to feed this node you also need the Impact Subpack for UltralyticsDetectorProvider and its YOLO detection models. On Linux you may need libgl1-mesa-glx and libglib2.0-0 for OpenCV.

Common issues & troubleshooting

Nothing to connect to bbox_detector. You skipped the Subpack. Install it, add an UltralyticsDetectorProvider, load a face/person YOLO (the pack shares the same Bingsu/adetailer weights ADetailer uses), and wire it in.

Empty SEGS. Either threshold is too high, drop_size is eating your detections, or the detector doesn't match your subject - a face YOLO won't find hands. Lower the threshold or swap detectors.

Visible box-shaped seams after detailing. A bounding box is a rectangle, so the mask is too. Feed the SEGS through SAMDetector (combined) to snap the mask to the actual silhouette, or reach for the SEGM Detector (SEGS) variant, which returns outline-shaped masks that seam far less.

CategoryImpactPack/Detector

Inputs (8)

NameTypeDefaultDescription
bbox_detectorBBOX_DETECTOR
imageIMAGE
thresholdFLOAT0.500–1
dilationINT10-512–512
crop_factorFLOAT3.01–100
drop_sizeINT101–16384
labelsSTRINGall
detailer_hookoptDETAILER_HOOK

Outputs (1)

NameTypeDescription
SEGSSEGS