π― Cascade Detector Advanced (Bbox/Segm, Staged)
Three YOLO passes in one node β and it stops running face detection on torsos
- image
- segs_input
- stage_1_bbox_detector
- stage_1_segm_detector
- stage_2_bbox_detector
- stage_2_segm_detector
- stage_3_bbox_detector
- stage_3_segm_detector
- segs_output_all_stages (Combined)
- preview_image (Combined Detections)
- cropped_fragments_image (All Detections)
- stage1_segs (Stage 1 Results)
- stage2_segs (Stage 2 Results)
- stage3_segs (Stage 3 Results)
- masked_fragments_image (Masked Fragments)
- image_bypass (Original if No Detections)
This is a single node that runs up to three detection passes - each with its own bbox or segm YOLO model - and hands you one combined SEGS output. The author describes it as either a "magnifying glass" or a "big detector," and both halves are right. Chained together, each stage re-detects inside what the previous stage found, which is how you reliably find small stuff that a first pass on the full image would miss. Run the stages in parallel and you've got a single node that merges three different detectors' results with NMS, the way you'd otherwise assemble with a pile of SEGSPreview and SEGSConcat nodes.
The genuinely useful trick is input label filtering. Each stage takes a comma-separated list of labels and only processes segments with those labels from the previous stage - so stage 2 can run eye detection exclusively on the face segments stage 1 produced, instead of pointlessly scanning arms and torsos for eyes. stage2_input_filter_labels = "face" is the whole workflow, right there.
How it works
Each stage has its own detector (bbox or segm), confidence, IoU threshold, dilation, class filter, crop factor, scale mode, and target/max size. In sequential mode, stage 2 detects inside the crops of stage 1; in parallel mode every enabled stage runs independently on the full image and the results are merged with NMS against the top-level iou_threshold; parallel_per_segment runs each detector independently on each segment.
The part worth knowing about is masks. When a downstream stage detects on an upscaled crop ("enlarged fragments"), the node recalculates each mask back into the original image's coordinate space as a numpy array - the author's flagship fix, and the thing that makes it work with non-square images like 1152Γ1280 and with Impact Pack's SEG objects, which historically hate mismatched mask shapes. There's also simplify_masks (morphological closing with an elliptical kernel) to smooth those recalculated masks out.
The inputs that matter
mode- sequential vs parallel. Start here; it changes what the stage settings mean.stage_N_detector_typeplus the matchingstage_N_bbox_detector/stage_N_segm_detector- you wire Impact Pack'sUltralyticsDetectorProviderinto these. That's where the actual YOLO models (likeface_yolov8m.pt) come from and download on first use.stageX_input_filter_labels- the headline feature. Comma-separated labels; empty means process everything.include_masks_in_output- keep this true. The README is blunt: most nodes that consume SEGS error out or misbehave without masks attached.
After the cascade, min_confidence, min_bbox_width, and min_bbox_height prune weak or tiny detections, and drop_size feeds the detectors' own filtering.
Outputs
segs_output_all_stages is the main one - wire it into SEGSPaste or SEGSDetailer from Impact Pack. preview_image draws the boxes (color-coded per stage), cropped_fragments_image is a contact sheet of every crop, masked_fragments_image shows just the masked interiors, and stage1/2/3_segs give you each stage's results separately. image_bypass is a nice fallback: it returns the original image when nothing was found and a black frame otherwise, so a downstream branch can skip gracefully when detection comes up empty.
Installing it
ComfyUI Manager - search "ComfyUI-Impact-BIGdetector-BBOX-SEGS" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/Devourer56/ComfyUI-Impact-BIGdetector-BBOX-SEGS
then restart ComfyUI. The pack ships no requirements.txt: it uses numpy, cv2, torch, and PIL, all already in ComfyUI. What you actually need is Impact Pack installed separately, plus its YOLO models.
Honest caveats
Set expectations before you build a masterpiece on this. The README's foreword admits the node was generated with AI in half a day "for my own needs," the previews are self-described as "so-so" (use Impact Pack's SEGSPreview), and the author's announcement post landed with zero engagement - this is a personal utility that happens to be public, not a maintained ecosystem staple. The stages are hardcoded to three, so don't expect a 5-stage pipeline without editing source. And since it leans on Impact Pack's Ultralytics stack, keep both updated - that dependency chain is exactly how the December 2024 compromised-Ultralytics cryptominer reached ComfyUI installs. All that said, if you've ever stacked three FaceDetailer-style passes manually, this node collapses the whole cascade into one block with per-stage settings you can actually read.
Inputs (56)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| mode | COMBO | sequential | 3 options: sequential, parallel, parallel_per_segment |
| target_size | INT | 64064β16384 | β |
| max_size | INT | 102464β16384 | β |
| iou_threshold | FLOAT | 1.000β1 | β |
| include_masks_in_output | BOOLEAN | true | β |
| simplify_masks | BOOLEAN | true | β |
| simplify_kernel_size | INT | 51β21 | β |
| simplify_iterations | INT | 11β10 | β |
| segs_inputopt | SEGS | β | |
| stage_1_enabledopt | BOOLEAN | true | β |
| stage_1_detector_typeopt | COMBO | bbox | 2 options: bbox, segm |
| stage_1_bbox_detectoropt | BBOX_DETECTOR | β | |
| stage_1_segm_detectoropt | SEGM_DETECTOR | β | |
| stage_1_confidenceopt | FLOAT | 0.250β1 | β |
| stage_1_iou_thresholdopt | FLOAT | 0.450β1 | β |
| stage_1_dilationopt | INT | 0-512β512 | β |
| stage_1_classesopt | STRING | β | |
| stage_1_crop_factoropt | FLOAT | 1.01β10 | β |
| stage_1_scale_modeopt | COMBO | bbox | 3 options: bbox, crop_region, fixed |
| stage_1_target_sizeopt | INT | 64064β16384 | β |
| stage_1_max_sizeopt | INT | 102464β16384 | β |
| stage_1_process_emptyopt | BOOLEAN | true | β |
| stage1_input_filter_labelsopt | STRING | Comma-separated labels to PROCESS on Stage 1 (e.g., 'person,car'). Empty = process all input segments. | |
| min_confidenceopt | FLOAT | 0.000β1 | β |
| min_bbox_widthopt | INT | 11β16384 | β |
| min_bbox_heightopt | INT | 11β16384 | β |
| stage_2_enabledopt | BOOLEAN | true | β |
| stage_2_detector_typeopt | COMBO | bbox | 2 options: bbox, segm |
| stage_2_bbox_detectoropt | BBOX_DETECTOR | β | |
| stage_2_segm_detectoropt | SEGM_DETECTOR | β | |
| stage_2_confidenceopt | FLOAT | 0.250β1 | β |
| stage_2_iou_thresholdopt | FLOAT | 0.450β1 | β |
| stage_2_dilationopt | INT | 0-512β512 | β |
| stage_2_classesopt | STRING | β | |
| stage_2_crop_factoropt | FLOAT | 1.01β10 | β |
| stage_2_scale_modeopt | COMBO | bbox | 3 options: bbox, crop_region, fixed |
| stage_2_target_sizeopt | INT | 64064β16384 | β |
| stage_2_max_sizeopt | INT | 102464β16384 | β |
| stage_2_process_emptyopt | BOOLEAN | false | β |
| stage2_input_filter_labelsopt | STRING | Comma-separated labels to PROCESS on Stage 2 (e.g., 'face'). Empty = process all Stage 1 results. | |
| stage_3_enabledopt | BOOLEAN | true | β |
| stage_3_detector_typeopt | COMBO | bbox | 2 options: bbox, segm |
| stage_3_bbox_detectoropt | BBOX_DETECTOR | β | |
| stage_3_segm_detectoropt | SEGM_DETECTOR | β | |
| stage_3_confidenceopt | FLOAT | 0.250β1 | β |
| stage_3_iou_thresholdopt | FLOAT | 0.450β1 | β |
| stage_3_dilationopt | INT | 0-512β512 | β |
| stage_3_classesopt | STRING | β | |
| stage_3_crop_factoropt | FLOAT | 1.01β10 | β |
| stage_3_scale_modeopt | COMBO | bbox | 3 options: bbox, crop_region, fixed |
| stage_3_target_sizeopt | INT | 64064β16384 | β |
| stage_3_max_sizeopt | INT | 102464β16384 | β |
| stage_3_process_emptyopt | BOOLEAN | false | β |
| stage3_input_filter_labelsopt | STRING | Comma-separated labels to PROCESS on Stage 3 (e.g., 'eyes,nose'). Empty = process all Stage 2 results. | |
| drop_sizeopt | INT | 11β100 | β |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| segs_output_all_stages (Combined) | SEGS | β |
| preview_image (Combined Detections) | IMAGE | β |
| cropped_fragments_image (All Detections) | IMAGE | β |
| stage1_segs (Stage 1 Results) | SEGS | β |
| stage2_segs (Stage 2 Results) | SEGS | β |
| stage3_segs (Stage 3 Results) | SEGS | β |
| masked_fragments_image (Masked Fragments) | IMAGE | β |
| image_bypass (Original if No Detections) | IMAGE | β |