ComfyUI Node
CV NMS Boxes
Non-maximum suppression over any BOUNDING_BOX value: drops boxes that overlap a higher-scoring box by more than the IoU threshold. cv2's NMS is otherwise only reachable inside 'YOLO Detect Decode', so anything that produces overlapping regions - two detectors merged, a lowered confidence threshold, 'Masks to BBoxes' on a noisy segmentation, 'Match Template Multi-Scale' across scales - has no way to de-duplicate. Suppression runs INSIDE each per-frame group, never across frames. Empty input yields empty outputs and never raises.
CV NMS Boxes
- bboxes
- scores
- class_ids
- bboxes
- kept_indices
- count
- removed
◄nms_threshold0.45►
◄score_threshold0.00►
◄top_k0►
◄eta1.00►
Categoryimage/CV
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| bboxes | BOUNDING_BOX | [object Object] | Core BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc. Boxes are suppressed within each per-frame group independently. |
| nms_threshold | FLOAT | 0.450–1 | Maximum IoU a kept box may have with a higher-scoring one. Lower suppresses more aggressively; 1.0 keeps everything. Measure the actual overlaps with 'CV Box IoU Matrix' if you are unsure what to set. |
| score_threshold | FLOAT | 0.000–1 | Boxes scoring below this are dropped before suppression. 0.0 keeps them all. |
| scoresopt | NPARRAY | Optional (N,) confidences, in the flattened box order ('CV BBoxes To Array' emits exactly this). Omitted, each box's own 'score' key is used, defaulting to 1.0 - with no scores at all NMS keeps the first box of each overlapping cluster. | |
| class_idsopt | NPARRAY | Optional (N,) class indices. WIRED, suppression runs per class (boxes of different classes never suppress each other) - that is the switch, there is no boolean widget. 'CV BBoxes To Array' emits 'label_ids' for this. | |
| top_kopt | INT | 00–100000 | Keep at most this many boxes per group after suppression (0 = no limit), highest score first. |
| etaopt | FLOAT | 1.000.01–10 | Adaptive-threshold coefficient of cv2's NMS: the IoU threshold is multiplied by this after each iteration. 1.0 (the default) keeps it constant. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| bboxes | BOUNDING_BOX | Core BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc. The survivors, keeping the original per-frame nesting and every extra key. |
| kept_indices | NPARRAY | (K,) int32 indices of the survivors into the FLATTENED input order - feed it to 'CV Take By Index' to keep any parallel array (masks, embeddings, areas) in step. |
| count | INT | Number of boxes kept. |
| removed | INT | How many boxes were dropped (suppressed or below 'score_threshold'). 0 means NMS changed nothing. |