Nodes/XB_ToolBox/XB-llama - 🔍 BBoxes取BBox
ComfyUI Node

XB-llama - 🔍 BBoxes取BBox

Pluck one box out of a list of LLM-detected boxes

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-llama - 🔍 BBoxes取BBox
  • bboxes
  • bbox
image_index0
bbox_index0

The small utilities in the XB-llama BBox family all have the same job - turning the boxes your vision LLM detected into something a specific downstream node can eat - and XB_llamaBBoxes2BBox is the narrowest one: it picks a single box out of a BBOX list and hands it back as a BBOX. Think "index into the detection results."

Why would you want just one? Most pipelines act on all detections at once, but a few want a specific one: "the face in image 0" becomes the mask for a targeted edit, "the third object the model listed" becomes the region you crop. When your LLM returned five boxes and your workflow only cares about one of them, this node is the selection mechanism.

Inputs

  • bboxes - the BBOX list.
  • image_index - which image in the batch the box belongs to, default 0. The node indexes bboxes[image_index] to get that image's list of boxes, then picks within it.
  • bbox_index - which box within that image, default 0. Here's the useful special value: 999 means "all boxes" - in that case the node returns the entire list for that image rather than a single box. The tooltip says it plainly: "图像中的 BBox 索引 (999 = 获取全部)."

Output

One bbox - a single BBOX value, or the full per-image list when bbox_index is 999. Either way, it re-enters the same BBox world, so it can feed XB_llamaBBox2Mask or XB_llamaBBox2SEGS just like the original list.

Installing it

Part of XB_ToolBox - ComfyUI Manager search XB_ToolBox, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git

then restart. No dependencies beyond ComfyUI core; it's a pure indexing operation.

Where people get burned

Off-by-one and out-of-range are the whole risk surface. If bbox_index exceeds the number of boxes for the chosen image, you get a Python IndexError - ComfyUI surfaces it as a red node error, so check the count before dialing in index 3 on a 2-box result. And image_index indexing a list: bboxes[image_index] expects the outer list to have that many images. The −998 minimum on bbox_index exists in the schema but there's no special meaning to negatives - the only magic number is 999. Also worth remembering: this node picks by position, not by label. If the LLM's detection order is nondeterministic (it can be, at nonzero temperature), "box 1" today might be "the cat" today and "the dog" tomorrow. If you need a specific object, filter by label earlier - XB_llamaJSON2BBox has a label filter for exactly that.

CategoryXB-llama

Inputs (3)

NameTypeDefaultDescription
bboxesBBOX
image_indexINT00–1000000
bbox_indexINT0-998–999图像中的 BBox 索引 (999 = 获取全部)

Outputs (1)

NameTypeDescription
bboxBBOX