ComfyUI Node
CV Cascade Detect
The classic Viola-Jones detector (cv2.CascadeClassifier): a cascade of boosted Haar or LBP stages that rejects non-objects in a few operations and only spends real work on promising windows. It needs no GPU and no ONNX runtime, which is why it still matters - and it is the historical counterpart to the pack's neural detectors ('CV YuNet Face Detect' is far more accurate on faces; compare them side by side). Trained cascades are XML files in ComfyUI/models/cascades; OpenCV 5 no longer ships any, so download them from the opencv 4.x branch (data/haarcascades, data/lbpcascades) - they still load here. Data only: feed 'bboxes' to the core 'Draw BBoxes'. Zero detections is a valid result (found=false), never an error.
CV Cascade Detect
- image
- found
- bboxes
- boxes
- centers
- scores
- count
◄cascade▾►
◄scale_factor1.10►
◄min_neighbors5►
◄min_size30►
◄max_size0►
◄equalize_histtrue►
◄min_confidence0.0►
Categoryimage/CV/ml
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | NPARRAY,IMAGE | Image to search. An IMAGE batch uses its first frame; converted to grayscale internally. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size. | |
| cascade | COMBO | Cascade XML from ComfyUI/models/cascades (haarcascade_frontalface_default.xml, haarcascade_eye.xml, lbpcascade_* ...). Each file detects exactly ONE object class. | |
| scale_factor | FLOAT | 1.101.01–2 | How much the search window grows between pyramid levels. 1.1 = 10% per step: smaller finds more objects at more sizes and is much slower; 1.3+ is fast and misses objects between steps. |
| min_neighbors | INT | 50–100 | How many overlapping detections a window must collect to be kept. This is the precision knob: raise it to kill false positives, lower it if real objects are missed. |
| min_size | INT | 300–10000 | Ignore objects smaller than this many pixels on a side. 0 = no lower limit (much slower on big images). |
| max_size | INT | 00–10000 | Ignore objects larger than this many pixels on a side. 0 = no upper limit. |
| equalize_histopt | BOOLEAN | true | Run cv2.equalizeHist first. Haar cascades were trained on equalized crops, so this is the standard pre-processing and usually helps on dim or unevenly-lit photos. |
| min_confidenceopt | FLOAT | 0.00–1000 | Drop detections whose stage weight (the cascade's own confidence, from detectMultiScale3) is below this. 0 keeps everything - raise it to rank and trim without touching min_neighbors. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| found | BOOLEAN | True when at least one object was detected - branch on it with 'Basic data handling: IfElse'. |
| bboxes | BOUNDING_BOX | One {x, y, width, height, score, label} dict per detection (score = the cascade's stage weight) - feed the core 'Draw BBoxes' node. |
| boxes | NPARRAY | Nx4 int32 (x, y, w, h) - the same detections as a raw array, e.g. to seed 'CV Track Window'. |
| centers | NPARRAY | Nx2 float32 detection centres - feed 'CV Draw Points' or an 'CV Kalman Filter Step'. |
| scores | NPARRAY | (N,) float32 stage weights: how strongly the cascade voted for each detection. Higher = more confident. |
| count | INT | How many objects were detected; 0 is valid, not an error. |