Nodes/imgutils/Imgutils OCR
ComfyUI Node

Imgutils OCR

Read the text baked into your anime images

By xiaden·Created 2 months ago·Updated 2 months ago· 0
Imgutils OCR
  • image
  • detections
  • json
heat_threshold0.30
box_threshold0.70

Anime images are full of text that isn't a prompt: watermarks, dialogue bubbles, shop signs, staff credits, text baked into a character's shirt. If you need that text as text, Imgutils OCR is the node - it runs PaddleOCR over the image and hands back what it read, with bounding boxes and confidence scores. It's part of the xiaden/comfyui-imgutils pack wrapping the deepghs/imgutils library, and unlike most things in this pack it's genuinely useful on non-anime images too, since PaddleOCR is a general OCR engine.

Mechanically it's the standard two-stage OCR pipeline under the hood. First a detection stage finds candidate text regions (the "where is the text" half), then a recognition stage reads the characters inside each region. The two inputs map exactly onto those two stages:

  • heat_threshold (default 0.3) - controls the text-region detection. Lower = it hunts for more regions and finds more text (plus more false positives - random patterned pixels that sort of look like glyphs).
  • box_threshold (default 0.7) - the confidence bar for candidate boxes. Lower = more boxes get kept.

Both are floats from 0 to 1. The defaults are balanced; if text is being missed entirely, drop heat_threshold first.

Outputs:

  • detections - a STRING of the recognized texts, each quoted and comma-separated, or "No text detected." when nothing was found. This is the human-readable one.
  • json - a list of {bbox, label, score} objects, with each box's corner coordinates. This is what you feed into the pack's bbox utilities (Bbox Crop, Bbox Mask) if you want to do something with the regions, like masking out a watermark or inpainting over a signature.

What you'd actually use it for

  • Auto-detecting and masking watermarks or signatures before an inpaint pass removes them.
  • Pulling dialogue out of a manga/screenshot page to build caption text (accuracy is decent on clean images, poor on stylized fonts - expect to proofread).
  • Logging what text a generated image ended up containing, for content checking.

Realistic expectations: PaddleOCR is strong on clean horizontal text and struggles with the stylized, curved, or decorative lettering anime loves. If it reads garbage, it's usually the font, not your settings.

Install & gotchas

cd ComfyUI/custom_nodes/
git clone https://github.com/xiaden/comfyui-imgutils.git
cd comfyui-imgutils
pip install -r requirements.txt

Restart ComfyUI. Requires ComfyUI 0.25.0+ (V3 node API pack). The OCR models download from HuggingFace Hub on first run into ~/.cache/huggingface/hub/, so the first call is slow and offline use won't work. One quirk worth knowing: unlike most OCR tools that emphasize accuracy over region-hunting, the defaults here lean conservative, so if you're feeding it a busy panel with a dozen text regions and it returns two, walk heat_threshold down in 0.05 steps before you blame the model.

Categoryimgutils/ocr

Inputs (3)

NameTypeDefaultDescription
imageIMAGEInput image for text extraction.
heat_thresholdFLOAT0.300–1Heat map threshold for text region detection. Lower = more regions.
box_thresholdFLOAT0.700–1Box threshold for text detection. Lower = more candidate boxes.

Outputs (2)

NameTypeDescription
detectionsSTRING
jsonSTRING