ComfyUI Node
CV Array To BBoxes
Builds a BOUNDING_BOX value from plain arrays - the return leg of 'CV BBoxes To Array', and the way any array of regions (a decoded DNN head, k-means cluster extents, boxes computed with 'Math Expression' or the raw cv2 wrappers) becomes croppable and drawable. Scores and labels ride along as extra keys, which every bbox node in this pack preserves. Empty input yields an empty BOUNDING_BOX and never raises.
CV Array To BBoxes
- boxes
- scores
- label_ids
- group_index
- bboxes
- count
◄layoutx, y, width, height►
◄labels►
Categoryimage/CV
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| boxes | NPARRAY | (N,4) or (N,>=4) array of box rows in the chosen layout; extra columns are ignored. A single (4,) row is accepted as one box. Floats are rounded. | |
| layoutopt | COMBO | x, y, width, height | Column layout of the array. 'x, y, width, height' is OpenCV's own convention (and BOUNDING_BOX's); 'x1, y1, x2, y2' is the corner form most DNN heads and torchvision use; 'center x, center y, width, height' is the YOLO form. Only the ARRAY side changes - BOUNDING_BOX is always {x, y, width, height}. |
| scoresopt | NPARRAY | Optional (N,) confidences, written to each box's 'score' key. Omit to leave the boxes un-scored. | |
| label_idsopt | NPARRAY | Optional (N,) int indices into 'labels'. Without 'labels' the index itself is written as the label. | |
| labelsopt | STRING | Optional label names, one per line, indexed by 'label_ids' - takes 'Load Labels' output directly. | |
| group_indexopt | NPARRAY | Optional (N,) int frame index per row (as emitted by 'CV BBoxes To Array'), restoring the per-frame nesting. Omitted, every box lands in one group. |
Outputs (2)
| 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. |
| count | INT | Number of boxes emitted. |