Nodes/comfyui-dsocr-bbox/GLM Vision BBox Dual Extractor
ComfyUI Node

GLM Vision BBox Dual Extractor

Two GLM vision calls, one node, zero waiting on each other

By maomaozi·Created 2 months ago·Updated 2 months ago· 0
GLM Vision BBox Dual Extractor
  • image_1
  • image_2
  • bbox_json_1
  • bbox_json_2
prompt_1输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ]
prompt_2输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ]
endpoint_1https://open.bigmodel.cn/api/paas/v4/chat/completions
modelglm-4.6v-flash
api_key_1
endpoint_2https://open.bigmodel.cn/api/paas/v4/chat/completions
api_key_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_1endpoint_1 + api_key_1
  • image_2 + prompt_2endpoint_2 + api_key_2
  • model is shared by both calls (default glm-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.

Categorydsocr_bbox/GLM Vision BBox

Inputs (9)

NameTypeDefaultDescription
image_1IMAGE
prompt_1STRING输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ]
image_2IMAGE
prompt_2STRING输出图中所有banner,logo,品牌,平台,活动,质保,店铺相关描述的区域bbox,输出为json list,格式如下,不要输出任何其他内容/格式: [ { "desc": "官方旗舰店", "class": "店铺", "bbox": [x1,y1,x2,y2] } ]
endpoint_1STRINGhttps://open.bigmodel.cn/api/paas/v4/chat/completions
modelSTRINGglm-4.6v-flash
api_key_1STRING
endpoint_2STRINGhttps://open.bigmodel.cn/api/paas/v4/chat/completions
api_key_2STRING

Outputs (2)

NameTypeDescription
bbox_json_1STRING
bbox_json_2STRING