DotsOCR Model Loader
The 6 GB download your OCR workflow is hiding
- start
- dots_ocr_model
What it actually is
This is the "go get the model" half of yolain's ComfyUI-Easy-DotsOCR pack. It grabs the DotsOCR vision-language model (a Qwen2.5-VL-based OCR model from Xiaohongshu's AI lab, originally published as rednote-hilab/dots.ocr and since moved to dots-studio on HuggingFace), loads it into memory, and hands Apply DotsOCR a handle to work with. No API key, no cloud round-trip - the whole thing runs locally inside ComfyUI.
If you've used yolain's ComfyUI-Easy-Use or grabbed a workflow from ComfyUI-Yolain-Workflows, the name will feel familiar. This pack is much smaller and fresher: two nodes, one job. The model itself has real traction on HuggingFace (a few hundred thousand downloads, MIT-licensed), but the ComfyUI wrapper is new, so treat it as young software - check for updates after you install.
How it works
Three combo boxes and an optional trigger. That's the whole node.
- model_id (default
rednote-hilab/dots.ocr): not much of a menu - that single option is hardcoded in the node. The HF repo now redirects todots-studio/dots.ocr, and the redirect resolves transparently, so you don't have to touch it. - download_from (default
huggingface):huggingfaceormodelscope. ModelScope is the escape hatch if HuggingFace is slow or blocked where you are. Same model, different mirror. - attention (default
flash_attention_2):flash_attention_2,sdpa, oreager. This is the one you'll actually change. - start (optional): a trigger input to fire the load/download.
On first run it checks ComfyUI/models/LLM/dots-ocr. If the folder's missing, it snapshot-downloads the entire repo - about 6 GB across two safetensors shards - then loads the model with AutoModelForCausalLM in bf16, device_map="auto", trust_remote_code=True, and a torch.compile pass when CUDA is available. The output is the custom EASY_DOTSOCR_MODEL type, which plugs into exactly one place: Apply DotsOCR. That's its whole social life.
How to install
Install the pack once and both nodes appear. Easiest route is ComfyUI Manager - search ComfyUI-Easy-DotsOCR and install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-DotsOCR
cd ComfyUI-Easy-DotsOCR
pip install -r requirements.txt
Then restart ComfyUI. The pack needs transformers>=4.51.3 and qwen_vl_utils, and it uses the newer ComfyExtension API (comfy_api.latest), so it wants a reasonably recent ComfyUI build - an old install may not register the nodes at all. The ~6 GB model downloads itself on first run; the README's "download all models to ComfyUI/models/LLM/dots-ocr" instruction is just the manual fallback for that.
Where people get burned
- First run looks frozen. It isn't - it's pulling 6 GB. Watch the console for progress.
- Flash-attention errors.
flash_attention_2is the default, but it only works ifflash-attnis compiled for your exact torch/CUDA combo. If the loader dies there, switchattentiontosdpa. OCR speed barely changes and you keep your sanity. trust_remote_code=True. The model ships its own Python modeling code, so you're executing code from the repo alongside loading weights. It's the official dots-studio repo, not a random fork, but that's the standard custom-node caveat: know what you install.- Disk space surprise. The model lands in
models/LLM/, notmodels/checkpoints, so when your drive fills it's easy to miss where it went. Plan the 6 GB before you hit "run."
The unload_model toggle lives on the Apply node, not here - if VRAM is tight after an OCR pass, flip that and the loader will re-load from disk (no re-download) the next time you need it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_id | COMBO | rednote-hilab/dots.ocr | 1 options: rednote-hilab/dots.ocr |
| download_from | COMBO | huggingface | 2 options: huggingface, modelscope |
| attention | COMBO | flash_attention_2 | 3 options: flash_attention_2, sdpa, eager |
| startopt | * | Start to load or download models |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dots_ocr_model | EASY_DOTSOCR_MODEL | — |