Nodes/comfyui-dsocr-bbox/RapidOCR Detect Text (PP-OCR)
ComfyUI Node

RapidOCR Detect Text (PP-OCR)

Detect text locally, decide later — the permissive first stage

By maomaozi·Created 2 months ago·Updated 2 months ago· 0
RapidOCR Detect Text (PP-OCR)
  • image
  • detections_json
speed_profilebalanced
candidate_confidence0.50
acceleratorauto
cpu_threads0

Most OCR nodes are one-shot: they find text and decide it's text worth keeping. This one is deliberately dumber. It runs RapidOCR (the PP-OCR engine family, locally on your machine) and returns every text detection it can find, including faint stuff and watermarks, as structured JSON with stable IDs. Whether a detection is something to remove, preserve, or review is left entirely to the next stage - the pack's rule classifier or your own LLM.

That design choice is the whole point, and it's smarter than it looks. If your detector only surfaces confident text, you never even see the watermark at the bottom that the cleanup step was supposed to catch. The default candidate_confidence of 0.50 is intentionally lower than the classifier's threshold, so downstream logic gets a chance to inspect faint text instead of having it silently discarded.

How it works

It loads the RapidOCR engine lazily (the pack stays usable even when rapidocr-onnxruntime isn't installed - the node only errors when you actually run it), runs the ONNX detection/classification/recognition models over your IMAGE, and outputs a JSON string. Every detection gets a stable ID like b0_d0, b0_d1 - batch index plus detection index - plus its text, score, bbox, polygon, OCR scale, and preprocessing variant. Coordinates are raw pixels, which is why the downstream polygon/mask nodes default to coord_base=0.

The only output is detections_json. That's it. This node makes no mask and makes no decisions - those are other nodes' jobs.

Inputs you'll actually set

  • speed_profile - fast runs the original RGB image once; balanced adds enhanced grayscale and optional 2× OCR; thorough also checks inverted grayscale. More passes catch more faint text, at a straight time cost.
  • candidate_confidence - the detection candidate threshold, default 0.50. Lower it if faint watermarks keep vanishing.
  • accelerator - auto uses CUDA only when ONNX Runtime actually exposes CUDAExecutionProvider; otherwise it falls back to CPU. cpu and cuda force it. cpu_threads (0 = engine default) tunes CPU intra-op threads.

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, then install the one real dependency:

pip install -r custom_nodes/comfyui-dsocr-bbox/requirements.txt

That pulls rapidocr-onnxruntime, and the first run downloads the PP-OCR ONNX models automatically. For GPU inference you'd swap in a CUDA-compatible onnxruntime-gpu build; the pack verifies it at runtime.

Where people get burned

The typical complaint is "it missed my watermark." Nine times out of ten that's the speed_profile being on fast or the threshold too high - fast skips the grayscale passes that catch low-contrast text. The other trap is expecting this node to do the whole job: it produces JSON, not a mask. If you wired detections_json straight into a mask encoder and got nothing, you've skipped the classifier stage. And on small single images, GPU is often slower than CPU once transfer and session overhead count - don't assume cuda is faster until you've measured.

CategoryDeepSeek OCR

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
speed_profileCOMBObalanced3 options: fast, balanced, thorough
candidate_confidenceFLOAT0.500–1
acceleratorCOMBOauto3 options: auto, cpu, cuda
cpu_threadsINT00–128

Outputs (1)

NameTypeDescription
detections_jsonSTRING