Nodes/ComfyUI-Easy-DotsOCR/DotsOCR Model Loader
ComfyUI Node

DotsOCR Model Loader

The 6 GB download your OCR workflow is hiding

By yolain·Created 11 months ago·Updated 11 months ago· 6
DotsOCR Model Loader
  • start
  • dots_ocr_model
model_idrednote-hilab/dots.ocr
download_fromhuggingface
attentionflash_attention_2

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 to dots-studio/dots.ocr, and the redirect resolves transparently, so you don't have to touch it.
  • download_from (default huggingface): huggingface or modelscope. 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, or eager. 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_2 is the default, but it only works if flash-attn is compiled for your exact torch/CUDA combo. If the loader dies there, switch attention to sdpa. 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/, not models/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.

CategoryEasyUse/DotsOCR

Inputs (4)

NameTypeDefaultDescription
model_idCOMBOrednote-hilab/dots.ocr1 options: rednote-hilab/dots.ocr
download_fromCOMBOhuggingface2 options: huggingface, modelscope
attentionCOMBOflash_attention_23 options: flash_attention_2, sdpa, eager
startopt*Start to load or download models

Outputs (1)

NameTypeDescription
dots_ocr_modelEASY_DOTSOCR_MODEL