DeepSeek OCR Paste BBox Crops
Put OCR crops back where they came from, seams optional
- original_image
- crop_images
- image
This node is the second half of a two-node trick. First you crop OCR regions out of an image with DeepSeek OCR Draw BBox (which hands you both the crop_images batch and a crop_info JSON describing where each crop came from). Then you do something to those crops - upscale them, re-render them, erase the text in them - and this node pastes them back onto the original at the exact original coordinates.
It's the classic detailing loop, but with coordinates coming from OCR instead of a face detector. Same shape as the Impact Pack's SEGSPaste: detect → crop → re-render → paste back, with the seam control that decides whether the result looks pasted-on or native.
What to feed it
original_image- the untouched source.crop_images- the crops, usually straight from Draw BBox'scrop_imagesoutput or after processing. They match back tocrop_infoby index.crop_info- the JSON string from Draw BBox'scrop_infooutput. This is the map; without it the node doesn't know where anything goes.
The inputs that control the seam
strip_padding(defaulttrue) - ComfyUI pads image batches to a common size, which would leave black bars in your crops. This strips that padding before pasting. Leave it on unless your crops were never batched.resize_to_bbox(defaulttrue) - resizes each crop back to its original bbox size before pasting, so a crop that was upscaled elsewhere snaps to the right dimensions.feather_radiusandfeather_strength- the seam control.feather_radius(default0= off) blurs a band around each pasted crop's edge;feather_strength(default1.0) controls how transparent/soft that band is. If your re-rendered regions look hard-edged, this is where you fix it.
The output is a single image with everything composited. Wire it to Save/Preview and compare against the original.
The real workflow this enables
The highest-value use is text-aware cleanup at scale: OCR a product image, crop each text region, run those crops through a local inpaint or upscaler, and paste back - all without hand-placing a single mask or crop box. Because crop_info is plain JSON, you can even process the crops with completely external tools (a Python script, another ComfyUI workflow) and just come back with the results and the original crop_info. Keep the two in sync and you're golden.
Installing
It's part of comfyui-dsocr-bbox. ComfyUI Manager (search "dsocr") or:
cd ComfyUI/custom_nodes
git clone https://github.com/maomaozi/comfyui-dsocr-bbox
restart, and install requirements for the pack's OCR side:
pip install -r custom_nodes/comfyui-dsocr-bbox/requirements.txt
Where people get burned
The classic mistake is modifying the crops without keeping crop_info around - once it's gone, the node has nothing to anchor to. Second classic: feeding in a crop_images batch that's been reordered or filtered (count mismatch against crop_info), which silently pastes the wrong crop onto the wrong region. And if you processed crops at a different size and left resize_to_bbox on, it forces them back to bbox size, which can undo detail work - turn it off if your processed crops are already the right shape and you just want them composited.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| original_image | IMAGE | — | |
| crop_images | IMAGE | — | |
| crop_info | STRING | — | |
| strip_padding | BOOLEAN | true | — |
| resize_to_bbox | BOOLEAN | true | — |
| feather_radius | INT | 00–10000 | — |
| feather_strength | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |