Bounding Boxes Visualize
Stop Blind-Cropping Faces — Draw the Boxes First
- images
- bboxes
- images
Face detectors hand you a list of bounding boxes and expect you to trust them. BboxesVisualize is the node that says "let's check first": it draws every box back onto your image or video, one color per box, with a frame counter in the top-left corner. In a multi-person clip that's the difference between quietly cropping the wrong face for forty frames and catching it on frame two. It's the BBoxNodes pack's debugging pair to the scheduler - see the problem, then lock the right person.
Why you'd reach for it
Anytime you're cropping a face out of a video to feed something like Wan 2.2 animation or a per-face inpainting/detail pass, you're at the mercy of the detector. Face detectors like the SDPoseFaceBBoxes node that this is typically paired with are usually right - and occasionally they swap between people mid-clip, or track a background object that looks vaguely face-shaped. Blind-cropping that output means your whole downstream pipeline inherits the mistake. Running BboxesVisualize first turns an invisible data stream into something you can actually eyeball. That's the same discipline the Impact Pack/ADetailer crowd practices with face detailers: never trust the detector's regions until you've seen them.
How it works
You feed it an image batch and the matching BOUNDING_BOX list, and it draws each box as a rectangle with its own color from a fixed palette (so adjacent boxes don't blur into one). The frame index is burned into the top-left of every frame in red - the author added that deliberately as a bookmark, because the whole point is to spot the exact frame where a box jumps to another person and note it for the scheduler. It also draws a different color per box, not per person, which is handy when several faces overlap.
One thing to know up front: these are not KJNodes bboxes. The socket literally won't connect to KJNode output, because the format is this pack's own BOUNDING_BOX type. Wire it to a compatible detector (like SDPoseFaceBBoxes) and you're fine; wiring it to KJ bboxes and you'll stare at a red socket that refuses to mate.
The inputs that matter
- bboxes - the
BOUNDING_BOXlist from your detector. The one required input to get right. - person_index -
0draws all boxes,1–10draws just one (indices are 1-based). Start at 0 to see everything. - line_width - border thickness, 1–5. Keep it at 1 for previews.
Output is images: the same batch with rectangles drawn, ready for a preview node or VHS_VideoCombine.
Installing it
ComfyUI Manager: search ComfyUI-BBoxNodes. Manual install:
cd ComfyUI/custom_nodes
git clone https://github.com/masternc80/ComfyUI-BBoxNodes
cd ComfyUI-BBoxNodes && pip install -r requirements.txt
Restart after. The only Python dependency is pillow (you already have it), and there are no model files to download - this node draws boxes, it doesn't detect anything. It does use the newer comfy_api.latest extension API, so if the node list doesn't show it after a restart, update ComfyUI itself.
Troubleshooting
If nothing gets drawn, the usual culprit is feeding it a bbox format it can't use (KJNodes) or a mismatch between image count and bbox list - the two must be in step per frame. And one genuine quirk in the current source: the rectangle is drawn using y + width rather than y + height, so on wide, non-square crops the bottom edge can sit a few pixels off. Face boxes are roughly square, which is why you'll rarely notice - just don't use it to visualize full-body boxes and expect millimeter accuracy.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The input images to process | |
| bboxes | BOUNDING_BOX | [object Object] | Bounding boxes (not compatible with KJNodes) |
| line_width | INT | 11–5 | Rectangle border width |
| person_index | INT | 00–10 | The person index on the image starting from 1. 0 for all persons |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | Output images with drawn bounding boxes |