Nodes/OWL-ViT ComfyUI/Bounding Box Visualizer
ComfyUI Node

Bounding Box Visualizer

The threshold slider does nothing, so here's the real knob

By Jannled·Created about a year ago·Updated about a year ago· 0
Bounding Box Visualizer
  • image
  • boxes
  • confidences
  • Annotated Image
threshold0.2
font_scale1
line_width2

This is the node that makes the OWL-ViT pack visible - literally. OWL_Objectness_Inference hands you numbers: boxes and confidence scores as tensors. This node draws them onto a copy of your image so you can actually see what the model thinks is there. Output an Annotated Image, wire it into Preview Image or Save Image, done.

And yes, the title is the warning: the threshold input on this node does nothing. Look at the source and the slider is accepted, then never read. Instead the node hardcodes a "top 32" cutoff - it takes the top 32 objectness scores, keeps every box at or above that value, and throws the rest away. So when you drag threshold and nothing changes, you're not crazy; you've found a known quirk of this young pack. It's a great candidate for a fix, but today the honest answer is "don't bother with that slider."

The inputs that actually matter

  • image - the original image, same one you fed the Objectness node (it must match, since boxes are in that image's pixel coordinates).
  • boxes (BOXES) and confidences (CONFIDENCES) - straight from the Objectness node. Nothing to configure.
  • font_scale (default 1.0) and line_width (default 2) - these are the two you'll actually touch. Bigger image, bigger boxes → bump them up.
  • threshold - as established, decorative. Leave it.

One output: Annotated Image, ready for Preview/Save.

What it does under the hood

The visualizer sigmoids the raw objectness logits into 0–1 probabilities, applies that hardcoded top-32 cutoff, and then draws with OpenCV: each surviving box gets a color from the tab10 colormap and a label that reads patch_index: score - so 7: 0.942 means "patch 7, 94% objectness." That label is a position in the feature map, not a semantic name, which matters if you were hoping the boxes came pre-labeled. The Labels output from the Objectness node isn't used here at all; this node invented its own numbering scheme.

Where it bites

  • Out-of-bounds boxes crash the run. The drawing code asserts every box corner is inside the image. Negative coordinates are skipped with an error log, but a box that's merely too big will hard-fail the graph. If you resize between the Objectness node and here, this is your crash.
  • It caps at ~32 boxes. Dense scenes lose the tails of the detection list and there's no setting to raise it.
  • Batch images are taken as-is - confidences.cpu()[0] and boxes.cpu()[0] grab only the first image of a batch, so feed it one image at a time.

Installing and getting a working chain

This is one of three nodes in Jannled/owl-vit-comfyui. Install via ComfyUI Manager (search "OWL-ViT ComfyUI") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Jannled/owl-vit-comfyui

Restart, then the full graph is Load Image → OWL_Load_ModelOWL_Objectness_Inference → this node → Preview Image. First run downloads a couple of GB of OWLv2 weights from Hugging Face - no API key, all local.

It's an experimental pack with real rough edges, and the visualizer is the roughest of the three. But as a "show me what the detector found" debug tool it does exactly one job and does it visibly. Turn the font up, ignore the threshold slider, and you're set.

CategoryOWL

Inputs (6)

NameTypeDefaultDescription
imageIMAGEThis is an image
boxesBOXES
confidencesCONFIDENCES
thresholdFLOAT0.2
font_scaleFLOAT10.1–96
line_widthINT21–128

Outputs (1)

NameTypeDescription
Annotated ImageIMAGE