String to ComfyUI BBOX
The same bbox parser, but it speaks ComfyUI's native BOUNDING_BOX format
- center_coordinates
- bboxes
String to ComfyUI BBOX is the sibling of this pack's StringToBbox, and the difference is one letter that changes everything: the output type. Where StringToBbox emits a custom BBOX list, this node converts the same normalized Qwen coordinates into ComfyUI's native BOUNDING_BOX format - a list of objects with x, y, width, height fields. If your downstream tooling is ComfyUI's own region and inpainting machinery, that native type is what it wants, and this is the node that hands it to you without you writing a converter.
Part of WingeD123/ComfyUI_QwenVL_PromptCaption, pure string processing, no model, no GPU. It pairs with the caption nodes' bbox lang mode, which makes Qwen output per-mille coordinates (0–1000 = 0–100%) that nothing else in ComfyUI consumes directly.
How it works
Identical pipeline to StringToBbox: a tolerant parser pulls every [x1, y1, x2, y2] array out of the model's text (ignoring labels and prose), converts the 0–1000 normalized values into pixels using your width and height, and clamps to image bounds. The single difference is the output shape. Instead of pixel corner lists, each box becomes {"x": x1, "y": y1, "width": w, "height": h} - with a minimum size of 1×1 - which is the field structure ComfyUI's BOUNDING_BOX consumers expect. Center points are computed the same way and still come out the other side.
The inputs that matter
- string - the bbox text from a caption node in
bboxmode (or any[x1,y1,x2,y2]list text). Multiline. - width / height - real pixel dimensions of the image. Get these right or every box lands offset; defaults are 1024×1024.
- index - optional; empty converts all boxes,
0,2picks specific ones.
Outputs:
- bboxes (BOUNDING_BOX) - the native-format box list, ready to plug into ComfyUI region/inpaint tooling.
- center_coordinates (STRING) - JSON centers
[{"x": ..., "y": ...}]per box.
Install
Same as the rest of the pack - ComfyUI Manager (search "ComfyUI_QwenVL_PromptCaption") or:
cd ComfyUI/custom_nodes
git clone https://github.com/WingeD123/ComfyUI_QwenVL_PromptCaption
then restart. No model download, no dependency stack; this node runs the moment ComfyUI loads the pack.
Which one should you use?
That's the real question everyone lands on. If the thing downstream wants a BOUNDING_BOX, use this one. If it's a BBOX-typed consumer (some third-party SAM/segmenter stacks use that convention), use StringToBbox. When in doubt, check what the receiving node's input type is - a wrong type won't connect at all in ComfyUI, so it's self-diagnosing. The one thing to verify when boxes look shifted is that width/height match the actual image the caption ran on; a mismatch is the only common failure here, and it's a coordinate problem, not a parser one. If the input isn't valid [x1,y1,x2,y2] arrays you'll get a zeroed box back rather than a crash - so inspect rather than guessing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| width | INT | 10241–10000 | — |
| height | INT | 10241–10000 | — |
| index | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| center_coordinates | STRING | — |
| bboxes | BOUNDING_BOX | — |