DeepSeek OCR Expand Subset BBox (Paste Text)
Paste two OCR results
- image
- ocr_result
This is DeepSeek OCR Expand Subset BBox with the inputs swapped from sockets to multiline textboxes. Same algorithm, same single ocr_result output, same "expand B up to max_expand while avoiding protected A - B" behavior - but ocr_result_a and ocr_result_b are now boxes you paste into.
It's a thin variant, so there isn't a lot of new mechanism to explain. Its reason to exist is debugging and one-off work: grab a full OCR result and a subset from whatever produced them, paste both in, and see how expansion behaves with real data before you wire the socket version into a pipeline. If you're iterating on max_expand and safety_margin values, this is the faster place to do it - no need to build the chain first.
What's here
Every input from the socket version is present and identical: image_width/image_height (with the optional image auto-size fallback), coord_base (default 1000), max_expand (default 100), safety_margin, ignore_empty_label (default on), and output_coord_base (-1 keeps the input base). Output is the single ocr_result string with B's bboxes replaced by their expanded versions, in the original <|ref|>/<|det|> format.
The one real caveat is the same as every paste-box variant in this pack: it doesn't react to changes. Your input is static text, so re-running is on you. That's exactly what you want for a scratchpad and not what you want for production - hence the socket sibling.
Installing
ComfyUI Manager (search "dsocr") or:
cd ComfyUI/custom_nodes
git clone https://github.com/maomaozi/comfyui-dsocr-bbox
then restart ComfyUI and install the pack requirements if the local-OCR nodes need them:
pip install -r custom_nodes/comfyui-dsocr-bbox/requirements.txt
Gotchas
Watch the A/B polarity - B expands, A - B is protected, and it's easy to paste them reversed. And keep both pasted results in the same coordinate base; if one is normalized and the other isn't, the geometry silently stops making sense. Blank labels in A won't block expansion as long as ignore_empty_label stays on, which is the behavior you almost always want.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| ocr_result_a | STRING | — | |
| ocr_result_b | STRING | — | |
| image_width | INT | 00–100000 | — |
| image_height | INT | 00–100000 | — |
| coord_base | INT | 10000–100000 | — |
| max_expand | INT | 1000–10000 | — |
| safety_margin | INT | 00–10000 | — |
| ignore_empty_label | BOOLEAN | true | — |
| output_coord_base | INT | -1-1–100000 | — |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ocr_result | STRING | — |