Nodes/comfyui-unlimited-ocr/Load Unlimited OCR Model
ComfyUI Node

Load Unlimited OCR Model

This 6.7GB download is why OCR in ComfyUI finally got good

By PsychoLogicAu·Created 2 months ago·Updated 2 months ago· 0
Load Unlimited OCR Model
    • unlimited_ocr
    model_pathbaidu/Unlimited-OCR
    dtypebfloat16
    trust_remote_codetrue

    Every workflow that wants real-world text - a receipt, a scanned contract, a screenshot of a table - needs the same thing first: an actual OCR model on the canvas. That's this node. Load Unlimited OCR Model is the front door to Baidu's Unlimited-OCR, a vision-language model built to read whole pages in one shot, and it's the one node in the pack that touches the network. Nothing else works until it's loaded.

    The good news is there's nothing clever to do here. The loader wraps baidu/Unlimited-OCR, an MIT-licensed VLM with over three million downloads on HuggingFace, and it runs entirely on your machine. No API key, no cloud call - this is the "drop a model into the graph as a node" pattern the ecosystem has converged on, applied to OCR instead of captioning.

    The three inputs that matter

    • model_path (default baidu/Unlimited-OCR) - the HF repo ID, or a local path if you already have the weights. Leave it alone and the first run downloads the model (~6.7GB, one safetensors file) and caches it.
    • dtype (default bfloat16) - auto, bfloat16, float16, or float32. bfloat16 is the right default on modern cards: half the memory of float32 with effectively no quality loss. The catch is that bf16 needs an Ampere-or-newer GPU; on older cards switch to float16.
    • trust_remote_code (default on) - the model ships its own custom modeling code (it's built on a DeepSeek-style MoE backbone), so AutoModel refuses to load it without this flag. It's literally "run the code that ships in this repo." It's Baidu's official repo with millions of downloads, which is about as safe as this category gets - but know what the toggle means before you flip it.

    How loading actually works

    Under the hood the node loads via AutoModel.from_pretrained with safetensors, drops the weights on ComfyUI's CPU offload device, and wraps them in a CoreModelPatcher. That means the model plays by the same VRAM rules as your diffusion checkpoints: it's moved to the GPU only for inference, and ComfyUI can evict it to make room. A small LRU cache keeps up to two loaded models around, so re-running a workflow doesn't re-download or reload from scratch.

    Installing it

    You're installing the whole pack - that's the only way to get this node. In ComfyUI Manager, search "Unlimited OCR" and install comfyui-unlimited-ocr, or clone manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PsychoLogicAu/ComfyUI-Unlimited-OCR
    

    then restart ComfyUI. One gotcha: the README tells you to pip install -r requirements.txt, but there's no requirements.txt in the repo. Manager installs from pyproject.toml instead (transformers>=4.57.1, torch, torchvision, Pillow, numpy). If you're installing by hand and the tokenizer throws a sentencepiece error, pip install sentencepiece.

    Troubleshooting

    • Slow first run - it's downloading 6.7GB. Give it a minute, it's not hung.
    • OOM on load - the weights alone are 6.7GB in bf16. ComfyUI's offloading usually keeps it alive on an 8GB card, but it's fighting everything else in your graph for the same memory.
    • dtype errors on older GPUs - bf16 fails on pre-Ampere cards; float16 is the fallback.

    The loader outputs a single unlimited_ocr handle, which plugs straight into the OCR / Text Extraction node. And honestly? That's where the story starts.

    CategoryUnlimited OCR/Loader

    Inputs (3)

    NameTypeDefaultDescription
    model_pathSTRINGbaidu/Unlimited-OCR
    dtypeCOMBObfloat164 options: auto, bfloat16, float16, float32
    trust_remote_codeBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    unlimited_ocrunlimited_ocr_model