Select Bounding Box
Pick the one detection you actually care about
- image
- data
- center_coordinates
- bboxes
Detection models like Florence2 don't hand you one box - they hand you a pile of bounding boxes and labels, and you're left deciding which one is "the" subject. Select Bounding Box makes that decision for you. Feed it the JSON output of a grounding/segmentation model and it picks the box you want, either by index or by a strategy like "the biggest one" or "the one nearest the center."
This is the node you reach for in reframing and detailer workflows. You detect a person in an image, you want to crop to them, and you need a single box to drive the crop. Or you're building a face-focus loop where the centered subject is the target. In every case the job is the same: turn "a list of boxes" into "the box," plus the center point that goes with it.
How it works
The node expects the data input to be the JSON payload from a Florence2-style grounding call - a list of bboxes plus labels, in the standard [x1, y1, x2, y2] format. It reads your index string (comma-separated positions; blank means "all boxes"), collects the valid boxes at those indices, and quietly discards any box that covers essentially the whole image - those are usually the model detecting "scene" rather than a real subject. Then, depending on your method, it selects:
- biggest - the largest box by area.
- center - the box whose center is closest to the image center.
- balanced - a compromise scoring box size against center distance; the default, and the one that usually feels right.
The image input is used for size context (so "center" and "biggest" mean something), not for pixel output.
The outputs are center_coordinates (a JSON string like [{"x": 512, "y": 384}], matching what Florence2-style coord nodes emit) and bboxes (the chosen box or boxes in BBOX format, ready for cropping nodes that speak it).
Installing it
Select Bounding Box ships in ComfyUI-TinyBee, a small MIT-licensed utility pack with no models to download. Via Manager:
- ComfyUI Manager → Custom Nodes Manager.
- Search "ComfyUI-TinyBee" and install.
- Restart ComfyUI.
Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Restart and it's under 🐝TinyBee/Util. It needs no extra dependencies beyond what ComfyUI ships - the jsonata in the pack's requirements is only for its JSON Parser node.
Gotchas
The data format is the whole game. It expects the specific grounding JSON shape (bboxes/labels), so wire it to a Florence2-style detection node's output, not to arbitrary JSON. An invalid or empty index falls back to "all boxes," and if nothing valid comes through you get a zeroed result rather than an error - which means a silently empty crop downstream. And remember the method picker only matters when you have multiple boxes to choose from; with one box, that's the one you get.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| data | JSON | — | |
| index | STRING | — | |
| method | COMBO | balanced | 3 options: biggest, center, balanced |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| center_coordinates | STRING | — |
| bboxes | BBOX | — |