ComfyUI Node

Apply EasyOCR V2

Find the text in an image and get a mask, not just a transcript

By icesun963·Created 2 years ago·Updated 2 years ago· 0
Apply EasyOCR V2
  • image
  • IMAGE
  • MASK
  • JSON
gputrue
detectchoose
language_listEnglish
language_namech_sim,en
grow_w0
min_h0
max_h255

Most OCR tools are built to answer "what does this text say." This node cares about that too - it has a JSON output for the transcript - but the reason you'd actually reach for it in ComfyUI is the mask output: it finds where the text is and hands you a region you can feed straight into an inpaint or LaMa node. That's the real use case people are running this kind of node for - someone on r/comfyui recently laid out almost exactly this pipeline while trying to automate watermark and logo removal from a batch of product photos: detect the text, generate a mask, inpaint it clean, repeat across the whole dataset. This node is the detection step in that chain.

It's ported into this pack from prodogape/ComfyUI-EasyOCR, again "for batch acceleration" per the author's notes - same story as the LaMa and SegmentAnythingUltra nodes bundled alongside it.

How it works

EasyOCR is a well-established, dependency-light OCR library that detects text regions in an image and then reads what's in them, across a wide range of languages. This node runs that pipeline and converts the detected regions into both a mask and structured output, instead of leaving you with plain text you'd have to convert into a mask by hand.

Worth knowing going in: OCR finds text, specifically. In the reddit thread above, the same person found EasyOCR reliable for genuine typeset text but noted it sometimes misses stylized logos or semi-transparent watermarks - for those, pairing it with GroundingDINO+SAM (also in this pack, via SegmentAnythingUltra) tends to catch more of what plain OCR won't.

The inputs and outputs that matter

  • image and gpu (default true) - keep GPU on; OCR over a batch is noticeably slower on CPU.
  • detect (choose / input) - choose picks a language from the language_list dropdown (44 options, English by default); input switches to typing EasyOCR's own language codes directly into language_name (default "ch_sim,en" - Chinese-simplified plus English, a hint at the original author's own use case). Use input mode when you need a language combination that isn't in the preset list.
  • grow_w, min_h, max_h - box-filtering knobs. grow_w pads detected text boxes sideways so the mask isn't clipped tight to the letters; min_h/max_h filter detections by height, useful for excluding tiny noise or oversized false positives.

Outputs are IMAGE, MASK, and JSON - MASK is what you'll route into an inpaint/LaMa node, JSON carries the actual recognized text and box data for anyone who needs the transcript rather than just the region.

How to install it

ComfyUI Manager: search HFDownLoad Node for ComfyUI, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/icesun963/ComfyUI_HFDownLoad, then restart.

One genuine convenience worth calling out against its podmates in this pack: EasyOCR fetches its own detection and recognition models automatically the first time you request a new language - there's no manual checkpoint hunt here the way there is for the SAM or LaMa nodes in this same pack. First run for a given language will just take longer while it downloads.

Common issues & troubleshooting

First run is slow, or seems to hang. That's EasyOCR pulling model weights for the language you requested. Let it finish once; subsequent runs are fast.

detect=input errors out or returns nothing. language_name expects EasyOCR's own comma-separated codes, not plain language names - get the code wrong and it either errors or silently detects nothing. If you're not sure of the code, switch back to detect=choose and pick from language_list instead.

Mask is empty on text you can clearly see. Check min_h / max_h first - a large watermark can get filtered out if max_h is set too low, and small captions can vanish if min_h is set too high.

It's missing a logo or stylized watermark entirely. That's expected - OCR looks for text, and a stylized wordmark or semi-transparent overlay doesn't always read as text to the model. Pair it with GroundingDINO+SAM (SegmentAnythingUltra, in this same pack) for anything that isn't clean, legible text.

CategoryComfyUI-EasyOCR

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
gpuBOOLEANtrue
detectCOMBOchoose2 options: choose, input
language_listCOMBOEnglish44 options: English, 简体中文, 繁體中文, العربية, Azərbaycan, Euskal, +38
language_nameSTRINGch_sim,en
grow_wINT00–255
min_hINT00–255
max_hINT2550–255

Outputs (3)

NameTypeDescription
IMAGEIMAGE
MASKMASK
JSONJSON