GLM Vision BBox Dual Extractor
Two GLM vision calls, one node, zero waiting on each other
- image_1
- image_2
- bbox_json_1
- bbox_json_2
The single-image GLM Vision BBox Extractor sends one image to GLM and waits. This node runs two of those calls at once - two images, two prompts, even two separate API endpoints and keys - and returns both results. If your pipeline needs to box up two regions of the same product shot, or two different products in one pass, this halves the wall-clock wait.
What's different from the single extractor
Same underlying request and cleaning logic (urllib, OpenAI-compatible chat-completions, JSON-only output with desc/class/bbox preserved verbatim). The structure is just doubled:
image_1+prompt_1→endpoint_1+api_key_1image_2+prompt_2→endpoint_2+api_key_2modelis shared by both calls (defaultglm-4.6v-flash).
The two requests run concurrently via a thread pool, and the outputs come back in slot order - bbox_json_1, bbox_json_2 - even if the second request finishes first. Both inputs are validated before either request starts, and if either call fails, the whole node errors with no partial output. That's deliberate: it keeps you from silently building a mask from one good and one failed result.
Why you'd use it
Two of the endpoint/api_key pairs means you can point the second call at a different GLM model, a proxy, or even a different vendor's OpenAI-compatible endpoint - useful if one region's prompt needs a stronger model. Or just run one prompt for banners and another for text on the same pair of images. If you only need one call, the single extractor is simpler; this node pays for itself when two independent boxes have to happen anyway.
Installing
Part of comfyui-dsocr-bbox. ComfyUI Manager (search "dsocr") or:
cd ComfyUI/custom_nodes
git clone https://github.com/maomaozi/comfyui-dsocr-bbox
restart. The GLM nodes need no extra packages - stdlib HTTP only. The pack's rapidocr-onnxruntime requirement is for the local-OCR nodes, not these.
Gotchas
Two things bite. First, each image input must be exactly one image - batches error out, same as the single extractor. Second, remember the concurrent calls both consume API capacity: two simultaneous requests to the free Flash tier can trip rate limits on both at once, so if you're seeing 429s on a busy run, the retry-with-backoff handles it, but it's still worth budgeting for. And as always with these nodes, pin the coordinate format in your prompts - the extractor preserves whatever GLM returns, so coord_base/coordinate_order downstream must match what you asked for.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image_1 | IMAGE | — | |
| prompt_1 | STRING | 输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ] | — |
| image_2 | IMAGE | — | |
| prompt_2 | STRING | 输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ] | — |
| endpoint_1 | STRING | https://open.bigmodel.cn/api/paas/v4/chat/completions | — |
| model | STRING | glm-4.6v-flash | — |
| api_key_1 | STRING | — | |
| endpoint_2 | STRING | https://open.bigmodel.cn/api/paas/v4/chat/completions | — |
| api_key_2 | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| bbox_json_1 | STRING | — |
| bbox_json_2 | STRING | — |