☁️BizyAir Parse Qwen VL BBoxes Text for SAM2
Turning a chatty vision model's answer into a mask SAM2 can use
- image
- text
- bboxes
Qwen2.5-VL is a vision-language model - you show it an image, ask it a question in plain English, and it answers in plain English. Ask it to find "the red mug on the table" and it can tell you where that is, but it tells you the way an LLM tells you anything: as text. Something like a description of coordinates embedded in a sentence, or a loosely-formatted list. That's genuinely useful - open-vocabulary object detection with no fixed class list and no training, just describe what you're looking for - but it's not directly usable by a segmentation node, which needs actual structured bounding-box coordinates, not prose. This node is the bridge: it takes that raw text output and turns it into BBOXES a node like SAM2 can consume to generate a real mask.
Think of it as doing for Qwen2.5-VL roughly what GroundingDINO does for text-prompted detection, except the "detector" here is a full conversational model rather than a purpose-built grounding network, and this parser is the glue that makes its chattier output usable downstream.
The inputs and outputs that matter
model- which Qwen2.5-VL size produced the text you're parsing (7B, 32B, or 72B-Instruct). This matters because the exact formatting a VLM uses to describe coordinates can shift slightly between model sizes, and the parser needs to know which format to expect.bboxes_text- the raw text response from your Qwen2.5-VL call. This node doesn't run the VLM itself; something upstream in your graph handles that, and this node's whole job starts here.image- the same image the VLM was looking at. Needed because VLMs typically describe box coordinates in a normalized or relative scheme, and this node has to map that back onto your image's actual pixel dimensions.target- the object description you asked the VLM to find, given back to this node so it can correctly associate the parsed boxes with what you were actually looking for.bbox_selection(default"all") - its tooltip explains the format directly: useall, or a comma-separated list of index numbers, to pick specific detections out of everything the VLM found rather than taking all of them.merge_boxes(default off) - when a VLM finds multiple boxes for what's conceptually one object (say, an object split by an occlusion), this collapses them into a single bounding region instead of keeping them separate.
Two outputs: text, the parsed result as structured JSON, and bboxes, the BBOXES-typed output built for feeding directly into a SAM2 node to generate the actual pixel mask.
Installing it
ComfyUI Manager: search BizyAir, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/siliconflow/BizyAir.git
Set your BizyAir API key on first use - both this node and whatever upstream node is calling Qwen2.5-VL run through BizyAir's cloud and need it.
Where people get burned
The most common failure is a mismatched target and bboxes_text pair - if the text you're feeding in came from a VLM call that answered a different question than what you put in target, parsing will either come back empty or return boxes that don't correspond to what you actually wanted masked. Keep the prompt you sent the VLM and the target value here in sync.
The second is expecting perfect precision from a conversational model doing detection as a side effect of language understanding rather than a network purpose-built for it. VLM-based grounding is remarkably capable for open-vocabulary cases a fixed-class detector simply can't handle, but box tightness and edge precision aren't always as clean as a dedicated detector's - if you need pixel-perfect boundaries, run SAM2 on the resulting box rather than trusting the box itself as the final mask; that's exactly the pipeline this node is built to feed.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 3 options: Qwen/Qwen2.5-VL-7B-Instruct, Qwen/Qwen2.5-VL-32B-Instruct, Qwen/Qwen2.5-VL-72B-Instruct | |
| bboxes_text | STRING | — | |
| image | IMAGE | — | |
| target | STRING | — | |
| bbox_selection | STRING | all | all或者逗号分隔的序列号 |
| merge_boxes | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | JSON | — |
| bboxes | BBOXES | — |