Nodes/ComfyUI-UniversalToolkit/Bbox Visualize (UTK)
ComfyUI Node

Bbox Visualize (UTK)

See what your crop boxes actually point at

By whmc76·Created about a year ago·Updated about a month ago· 72
Bbox Visualize (UTK)
  • images
  • bboxes
  • images
line_width1
bbox_formatxywh

Bounding boxes are great until you have to trust them blind. Any node that crops, detects, or masks produces a BBOX of coordinates, and sooner or later one of them is wrong - off by a margin, flipped, or pointed at the background. Bbox Visualize (UTK) draws the box on the image so you can actually see what the coordinates say. It's a debugging tool, and debugging tools earn their keep the first time a crop silently misses its subject.

How it works

It's a port of the KJNodes bbox visualizer. You feed it an images batch and a matching bboxes input of the same batch length, and it draws a red rectangle on each frame. The one input that matters beyond that is bbox_format:

  • xywh - coordinates are x, y, width, height (the ComfyUI-common format from most crop/detect nodes).
  • xyxy - x1, y1, x2, y2 (min/max corners). It converts to width/height internally, so either works - you just have to know which your upstream node emits.

line_width (default 1) controls the stroke; bump it to 2–3 when previewing at small sizes.

It returns the annotated images, so you can wire it into a preview node and look, then swap it out of the chain when you're done. Because it only modifies the image visually and passes the batch through, it's safe to leave in place while iterating.

Where it fits

Anywhere you crop by detection: after an Impact-pack-style FaceDetailer setup, before feeding a crop node, or when debugging a mask-to-bbox conversion. The typical loop is: generate bbox → visualize → see it's 40px too far left → adjust the upstream node → visualize again. It turns coordinate debugging from algebra into looking at a picture, which is how you actually want to spend your time.

Installing it

Standard pack install - ComfyUI Manager → search ComfyUI-UniversalToolkit, or clone into custom_nodes/:

cd ComfyUI/custom_nodes
git clone https://github.com/whmc76/ComfyUI-UniversalToolkit
cd ComfyUI-UniversalToolkit && pip install -r requirements.txt

Then restart. No extra dependencies beyond torch and the pack's basics.

Gotchas

  • The batch and bbox list must line up. It zips images and boxes together, so a mismatched batch length means weird boxes on wrong frames or an outright error. If your boxes come from a different count than your images, fix that upstream first.
  • Format mismatch is the #1 silent failure. Feeding xyxy coordinates with the format set to xywh draws nonsense boxes that look like a bug in the whole pipeline when it's just a dropdown. When in doubt, check what your detection node actually outputs.
  • It's preview-only - there's no "extract the box" here. If you want a bbox to actually crop or condition, that's a different node. This one just shows you the truth.

Honestly it's a two-minute tool, but it's the two-minute tool that prevents the forty-minute mystery crop. If you build any detection-based workflows, slot it in once, look at the result, and you'll know exactly what your coordinates are doing.

CategoryUniversalToolkit/Image

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
bboxesBBOX
line_widthINT11–10
bbox_formatCOMBOxywh2 options: xywh, xyxy

Outputs (1)

NameTypeDescription
imagesIMAGE