Nodes/ComfyUI-YOLO/BBox Visualization
ComfyUI Node

BBox Visualization

Draw bounding boxes with names on them

By kadirnar·Created 2 years ago·Updated 7 months ago· 121
BBox Visualization
  • image
  • bboxes
  • category_ids
  • IMAGE
rect_size3
text_size2
font_scale0.6
show_labeltrue

The pack has two ways to draw your detections. UltralyticsVisualization calls Ultralytics' own plotter on the raw result object; this one takes the plain BOXES and LABELS outputs and draws the rectangles itself, with OpenCV, right on the image. Same job, different plumbing - and because it works on the intermediate tensors rather than the results object, it's handy when you've routed boxes through something in between.

Inputs: image, bboxes (the BOXES output from UltralyticsInference), category_ids (the LABELS output - class indices per detection), and drawing knobs: rect_size, text_size, font_scale (0.6 default), and show_label. Each box gets a color keyed to its class, and with show_label on, the class name (person, car, dog…) is stamped onto it from the pack's built-in COCO name list.

The important detail is coordinate format. This node expects boxes in YOLO's xywh form, where x/y is the center of the box - exactly what UltralyticsInference's BOXES output gives you. The node converts center to top-left internally, so the math is handled, but it's why you can't blindly feed it boxes from a node that speaks top-left coordinates (use BBoxToXYWH if you need to translate). It also normalizes image values whether your tensor is 0–1 or 0–255, so it's forgiving about upstream format.

The real trap: category_ids defaults to the string "None" if you don't wire it, and the node does int(category_ids[index]) on whatever arrives. An unwired or wrong-typed LABELS input is a crash waiting to happen. Feed it the LABELS output from inference and it's fine - but that default is not your friend.

Install via ComfyUI Manager (search "ComfyUI-YOLO") or clone into custom_nodes and restart. Nice thing: this node doesn't need a model or detection results of its own - give it boxes and labels and it draws. That makes it a solid debugging tool for anything in your graph that produces boxes, not just this pack's detectors.

CategoryUltralytics/Utils

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
bboxesBOXES
category_idsLABELSNone
rect_sizeINT3
text_sizeINT2
font_scaleFLOAT0.60–1
show_labelBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE