Nodes/comfyui_cv/CV Array To BBoxes
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.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Array To BBoxes
  • boxes
  • scores
  • label_ids
  • group_index
  • bboxes
  • count
layoutx, y, width, height
labels
Categoryimage/CV

Inputs (6)

NameTypeDefaultDescription
boxesNPARRAY(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.
layoutoptCOMBOx, y, width, heightColumn 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}.
scoresoptNPARRAYOptional (N,) confidences, written to each box's 'score' key. Omit to leave the boxes un-scored.
label_idsoptNPARRAYOptional (N,) int indices into 'labels'. Without 'labels' the index itself is written as the label.
labelsoptSTRINGOptional label names, one per line, indexed by 'label_ids' - takes 'Load Labels' output directly.
group_indexoptNPARRAYOptional (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)

NameTypeDescription
bboxesBOUNDING_BOXCore BOUNDING_BOX data: per-frame lists of {x, y, width, height} dicts - compatible with Draw BBoxes, Crop By Bounding Boxes, Image Crop, etc.
countINTNumber of boxes emitted.