Nodes/comfyui-dsocr-bbox/DeepSeek OCR Paste BBox Crops
ComfyUI Node

DeepSeek OCR Paste BBox Crops

Put OCR crops back where they came from, seams optional

By maomaozi·Created 2 months ago·Updated 2 months ago· 0
DeepSeek OCR Paste BBox Crops
  • original_image
  • crop_images
  • image
crop_info
strip_paddingtrue
resize_to_bboxtrue
feather_radius0
feather_strength1.00

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's crop_images output or after processing. They match back to crop_info by index.
  • crop_info - the JSON string from Draw BBox's crop_info output. This is the map; without it the node doesn't know where anything goes.

The inputs that control the seam

  • strip_padding (default true) - 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 (default true) - resizes each crop back to its original bbox size before pasting, so a crop that was upscaled elsewhere snaps to the right dimensions.
  • feather_radius and feather_strength - the seam control. feather_radius (default 0 = off) blurs a band around each pasted crop's edge; feather_strength (default 1.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.

CategoryDeepSeek OCR

Inputs (7)

NameTypeDefaultDescription
original_imageIMAGE
crop_imagesIMAGE
crop_infoSTRING
strip_paddingBOOLEANtrue
resize_to_bboxBOOLEANtrue
feather_radiusINT00–10000
feather_strengthFLOAT1.000–1

Outputs (1)

NameTypeDescription
imageIMAGE