DeepSeek OCR: Load Model
Real document OCR locally, no API key required
- model
The name is the pitch: this node loads DeepSeek-OCR, DeepSeek's vision-language model for reading documents, into your GPU so you can OCR locally. No API calls, no key, no "send my invoice to someone's server" anxiety - the whole thing runs on your machine. If you've ever tried EasyOCR or PaddleOCR inside ComfyUI and gotten garbled tables or missed a watermark, this is the class of model people describe as "more powerful" when the older OCR tools fail. It's a genuinely different beast: instead of a traditional OCR detector, it's a ~3B vision-language model that reads the image and writes the text back, which is why it handles tables, charts, handwriting-adjacent layouts, and locating things by description instead of just transcribing.
The catch is the first run. The model is about 8–10 GB of weights, and this Load node is where all of that happens.
What it actually does
Under the hood the loader does three things. First, it makes sure the weights exist at ComfyUI/models/deepseek-ocr/deepseek-ai_DeepSeek-OCR/. If they're missing it auto-downloads them via huggingface-cli on first run, using its own HuggingFace cache under models/deepseek-ocr/hf_cache so it doesn't pollute your global ~/.cache. It's polite about it too - a file lock so two queued workflows don't download in parallel, and a log at ComfyUI/log/deepseek_ocr.log tracking progress.
Then it loads the model with trust_remote_code=True - DeepSeek-OCR ships custom modeling code, which is also why the requirements include matplotlib even though you're not plotting anything. And it caches the loaded handle globally, so re-running a workflow doesn't reload 10 GB from disk every time. That's why the two-node split exists: Load once, Run as many times as you want.
The inputs that matter
Only two, and you can leave both alone most of the time:
dtype-bf16(default, recommended),fp16,fp32. bf16 is the balance point. Drop tofp16if you're short on VRAM. The loader quietly falls back bf16 → fp16 → fp32 if a precision fails to load, so a crash usually means something else is wrong.device-cudaby default. You can typecpu, but "speed" will not be the word you use to describe it.
The output is a model handle of type DPSK_OCR - wire that into the DeepSeek OCR: Run node. It's not a tensor, not a string, just an opaque handle; you don't do anything with it except connect the wire.
Installing it
Via ComfyUI Manager (search "DeepSeekOCR"), or the manual way:
cd ComfyUI/custom_nodes/
git clone https://github.com/Geo1230/ComfyUI-DeepseekOCR.git
Then install dependencies - with your venv's Python or python_embeded on Windows portable installs:
pip install -r requirements.txt
The requirements pull in transformers>=4.46, tokenizers, einops, easydict, addict, huggingface_hub, Pillow, numpy, and matplotlib. One pin matters more than the rest: the author recommends transformers 4.46.3, and if you're on 4.55+ and things break, the documented fix is:
pip install transformers==4.46.3 tokenizers==0.20.3
You don't need to pre-download the model - the loader fetches it on first use. If you'd rather do it in the terminal (and watch the progress instead of guessing), the README's manual path is huggingface-cli download deepseek-ai/DeepSeek-OCR --local-dir . --repo-type model inside that deepseek-ai_DeepSeek-OCR folder. Want to kill auto-download entirely? Set the env var DPSK_AUTODOWNLOAD=0 before starting ComfyUI.
Where people get burned
- The first run looks frozen. It's downloading ~10 GB; watch the console or the log file, not the node. Give it the time.
- Transformers version hell. This is the #1 breakage for custom-code models. If Load throws in
trust_remote_codeor atransformersimport, pin 4.46.3 before blaming anything else. - OOM on load. bf16 is roughly 6–7 GB of VRAM just for the model. If it won't fit, switch to
fp16on the Load node - and consider running at Tiny/Small resolution on the Run node too. - Auto-download failing in restricted networks: set an
HF_ENDPOINTmirror, or disable auto-download and pull the weights manually.
This pack is small and young (it's the kind of thing with zero search impressions yet), so bugs surface in the log file and the README rather than in a thriving forum. But the core model it wraps is a genuinely capable piece of OCR tech, and this is the cleanest ComfyUI path to it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| dtype | COMBO | bf16 | 3 options: bf16, fp16, fp32 |
| device | STRING | cuda | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | DPSK_OCR | — |