Simple Detector for Video (SEGS)
Per-frame SEGS for video detailing
- bbox_detector
- image_frames
- sam_model_opt
- segm_detector_opt
- SEGS
The _for_AD in the class name is "for AnimateDiff," and the UI label spells it out: Simple Detector for Video (SEGS). It's the video-aware sibling of the regular Simple Detector. Instead of running detection once on a single image, it runs detection on every frame of a video sequence and bundles the results into one SEGS object carrying a batch of masks - which is exactly what you need to detail faces across an animation instead of just one still.
If you've tried to FaceDetailer a video by treating it as a stack of images, you already know the problem this solves. Detection has to happen frame by frame because the face moves, and the masks have to stay batched so the detailer can walk through them in lockstep with the frames. This node handles that bookkeeping.
How it works
You hand it a bbox_detector and your image_frames (the whole video as an image batch). It detects on each frame, optionally refines the masks with SAM or a SEGM detector, and can combine information across neighboring frames so the masks don't flicker. Out comes a single SEGS with one mask per frame, ready to feed a Detailer (SEGS) that supports batches. It's the same detect-crop-refine idea Impact Pack is built on, stretched across time.
The inputs and outputs that matter
bbox_detector- your detection model (usually a YOLO face detector from the Impact Subpack). Required; everything keys off it.image_frames- the video frames as an image batch. This is what makes it "for video."bbox_threshold(default0.5) - detection confidence. Lower it if faces are being missed on some frames; raise it if it's firing on background junk.crop_factor(default3) - how much context around each detection gets included in the crop. More context = smoother paste-back but a bigger region to resample.masking_mode(optional:Pivot SEGS,Combine neighboring frames,Don't combine) - the temporal knob.Combine neighboring framesborrows detection info between frames to steady the masks;Don't combinetreats each frame independently.sam_model_opt/segm_detector_opt(optional) - add SAM or a segmentation detector to tighten the mask from a rough box to the actual silhouette.
The single output is SEGS - a batch of per-frame masks that goes into your detailer.
How to install it
Install the Impact 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
pip install -r requirements.txt
then restart. You'll also want the Impact Subpack for UltralyticsDetectorProvider (the YOLO face/hand models that feed the bbox_detector input) - since v8.0 that's a separate install.
Common issues & troubleshooting
Detection drops out on some frames. The face moved, blurred, or turned. Lower bbox_threshold so borderline detections still count, and try masking_mode: Combine neighboring frames so frames with a solid detection help the shaky ones.
Masks flicker or jitter between frames. Same fix - combine neighboring frames rather than detecting each one in isolation. Fine repeating detail is where per-frame processing shows its seams, and steadying the masks is the main lever here.
It's slow and memory-hungry. You're detecting across an entire video, so cost scales with frame count. Video detailing built on Impact Pack is famously RAM-hungry rather than VRAM-hungry - the community workflows that push this hard warn people off it under 64GB of system RAM. Keep clips short while you dial in settings.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| bbox_detector | BBOX_DETECTOR | — | |
| image_frames | IMAGE | — | |
| bbox_threshold | FLOAT | 0.500–1 | — |
| bbox_dilation | INT | 0-255–255 | — |
| crop_factor | FLOAT | 3.01–100 | — |
| drop_size | INT | 101–16384 | — |
| sub_threshold | FLOAT | 0.500–1 | — |
| sub_dilation | INT | 0-255–255 | — |
| sub_bbox_expansion | INT | 00–1000 | — |
| sam_mask_hint_threshold | FLOAT | 0.700–1 | — |
| masking_modeopt | COMBO | 3 options: Pivot SEGS, Combine neighboring frames, Don't combine | |
| segs_pivotopt | COMBO | 2 options: Combined mask, 1st frame mask | |
| sam_model_optopt | SAM_MODEL | [OPTIONAL] Segment Anything Model for Silhouette Detection. Be sure to use the SAM_MODEL loaded through the SAMLoader (Impact) node as input. Given this input, it refines the rectangular areas detected by BBOX_DETECTOR into silhouette shapes through SAM. sam_model_opt takes priority over segm_detector_opt. | |
| segm_detector_optopt | SEGM_DETECTOR | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SEGS | SEGS | — |