Nodes/comfyui_LLM_party/💻EasyOCR advance
ComfyUI Node

💻EasyOCR advance

Every EasyOCR knob exposed, for when the simple OCR node isn't precise enough

By heshengtao·Created 2 years ago·Updated 7 days ago· 2,321
💻EasyOCR advance
  • image
  • images
  • masks
  • json_str
  • text
  • language_list_help
gputrue
language_namech_sim,en
decodergreedy
beamWidth5
batch_size1
workers0
allowlist
blocklist
paragraphfalse
min_size20
contrast_ths0.10
adjust_contrast0.50
text_threshold0.70
low_text0.40
link_threshold0.40
canvas_size2560
mag_ratio1.00
slope_ths0.10
ycenter_ths0.50
height_ths0.50
width_ths0.50
add_margin0
is_enabletrue

This pack ships two ways to run local OCR. EasyOCR (the plain one) gives you a language picker and gets out of your way. This one - EasyOCR advance - is the same underlying EasyOCR engine with basically every parameter the library exposes turned into a widget on the node. You reach for it when the default detection or recognition behavior is getting things wrong on a specific image and you actually need to tune why, not just pick which languages to look for.

How it works

Same two-stage pipeline as any EasyOCR run: a detection pass finds where text sits in the image, then a recognition pass reads the characters in each detected region. What's different here is that nearly every tunable in both stages is on the node instead of hidden behind a default. Runs fully local, GPU or CPU, no API key, same as the simpler EasyOCR node.

The inputs and outputs that matter

Most of the twenty-odd fields here are EasyOCR's own detection/recognition thresholds, and you genuinely don't need to touch most of them on a first pass - the defaults are EasyOCR's own tuned defaults. The ones actually worth knowing:

  • image - what you're running OCR on.
  • gpu (default true) - GPU acceleration; needs working CUDA. Flip off for CPU-only machines.
  • language_name (default ch_sim,en) - unlike the simpler EasyOCR node's dropdown, this is a free-text comma-separated string. That default tells you where this pack's author is building from - Chinese-first, English second - so if you're reading a different language, replace it rather than assume the default covers you.
  • decoder - greedy (fast, default), beamsearch, or wordbeamsearch. Worth trying beamsearch if greedy is making obvious character-level mistakes on text you know is legible; it's slower but more accurate.
  • text_threshold / low_text / link_threshold - the detection-confidence knobs. If EasyOCR is missing faint or low-contrast text, lowering these is the first thing to try before assuming the image itself is unreadable.
  • paragraph - groups detected lines into paragraph blocks instead of returning each line separately, useful if you want blocks of prose rather than a scattered list of text fragments.

Five outputs: images and masks (detected text regions, cropped/masked, same as the simple node), json_str (structured detection data - boxes, confidence, per-region text), text (everything read, as one string), and language_list_help - a printed reference of EasyOCR's valid language codes, which exists specifically because language_name here is free text rather than a dropdown, so you need somewhere to check the exact code for a language before typing it.

Installing it

Search "comfyui_LLM_party" in ComfyUI Manager and install, or clone manually: cd ComfyUI/custom_nodes && git clone https://github.com/heshengtao/comfyui_LLM_party, then run pip install -r requirements.txt from the pack's own folder using ComfyUI's Python, then restart. EasyOCR itself comes in through that requirements install; the actual per-language model weights download automatically the first time you use a given language, not during pip install.

Common issues & troubleshooting

First run on a new language is slow. That's EasyOCR downloading detection/recognition weights for that language pair - one-time cost, fast after. Don't assume it's hung.

gpu set to true but it crashes or falls over. EasyOCR can't find a working CUDA PyTorch install - either no NVIDIA GPU, or a driver/CUDA/PyTorch version mismatch. Set gpu to false to force CPU and confirm that's the issue.

Tuned every threshold and it's still missing text. At that point the limitation is EasyOCR itself on genuinely hard input - heavy skew, stylized fonts, very dense small text. This pack's Mini Advanced OCR (EasyOCR detection plus a vision LLM read-out) or GOT-OCR2 will generally do better on messy inputs, at the cost of needing an API key or heavier local weights - this node's ceiling is real, and it's the tradeoff for staying fully local and free.

Category大模型派对(llm_party)/图片(image)

Inputs (24)

NameTypeDefaultDescription
imageIMAGE
gpuBOOLEANtrue
language_nameSTRINGch_sim,en
decoderCOMBOgreedy3 options: greedy, beamsearch, wordbeamsearch
beamWidthINT5
batch_sizeINT1
workersINT0
allowlistSTRING
blocklistSTRING
paragraphBOOLEANfalse
min_sizeINT20
contrast_thsFLOAT0.10
adjust_contrastFLOAT0.50
text_thresholdFLOAT0.70
low_textFLOAT0.40
link_thresholdFLOAT0.40
canvas_sizeINT2560
mag_ratioFLOAT1.00
slope_thsFLOAT0.10
ycenter_thsFLOAT0.50
height_thsFLOAT0.50
width_thsFLOAT0.50
add_marginINT0
is_enableBOOLEANtrue

Outputs (5)

NameTypeDescription
imagesIMAGE
masksMASK
json_strSTRING
textSTRING
language_list_helpSTRING