GLM-OCR Model Loader
The one-dropdown loader whose real trick is 'restart ComfyUI'
- glm_ocr_model
GLM-OCR Model Loader is the front half of the two-node comfyui_glm_ocr pack, and it does exactly one job: find a local copy of Z.ai's GLM-OCR model and hand it to GLM-OCR Run. The whole pack runs locally - no API, no Ollama, no key. The model is a 0.9B vision-language model built for document understanding, and it lives on your disk, not in a cloud.
If that sentence made you ask "where does ComfyUI even store a HuggingFace model like this?", you've found the reason this node exists. ComfyUI has a fixed models/ layout - checkpoints, loras, vae, and so on - and there's no "GLM models" slot in it. So the loader cheats, cleverly. It scans every checkpoint directory ComfyUI knows about (including any paths you've registered in extra_model_paths.yaml) and lists any subfolder that contains a config.json. That file is the tell: any HuggingFace model folder has one, so the loader treats "has config.json" as "this is a model."
What you actually touch
One input, one output, that's the whole node.
- model_name - a dropdown, populated from the scan described above. Pick the folder that contains your GLM-OCR files.
- glm_ocr_model (type
GLM_OCR_MODEL) - the only output, and it plugs straight into theglm_ocr_modelinput on GLM-OCR Run.
That's it. You won't tune anything here, and you shouldn't need to.
The gotcha that catches everyone
The scan happens once, at import time - when ComfyUI starts. Download the model after ComfyUI is already running and the dropdown won't show it until you restart. Most people who land on the "(no HuggingFace model folders found in checkpoints/)" placeholder either put the model in the wrong place or haven't restarted. Do the restart first, then go hunting.
Speaking of the right place:
huggingface-cli download zai-org/GLM-OCR --local-dir ComfyUI/models/checkpoints/GLM-OCR
The folder needs config.json, model.safetensors, and the tokenizer files - the download gives you all of that. One more subtlety in the source: if two checkpoint directories contain a folder with the same name, the later-registered path wins. Don't have two GLM-OCR folders on different drives and wonder which one it picked.
Installing the pack itself
Clone into custom_nodes or use ComfyUI Manager → Install via Git URL:
cd ComfyUI/custom_nodes
git clone https://github.com/Dangocan/comfyui_glm_ocr
The only hard dependencies are transformers>=5.3.0, Pillow, and torch. Restart, and the nodes show up under the GLM-OCR category.
Two practical notes
Once the loader runs, the model sits in VRAM (float16 on CUDA, device_map="auto"). At 0.9B that's a few hundred MB - it'll fit fine on a 6–8GB card - but don't wire up two loaders in one workflow. One loader can feed as many Run nodes as you like.
And the security habit, since you're installing a custom node from a small indie repo: every custom node is arbitrary Python running at import, and ComfyUI's vision-LLM corner has a genuinely infamous malware incident behind it. This pack's total code is a few hundred lines, and the loader's whole mechanism is described above - it's easy to read before you trust it. Worth 60 seconds.
The loader is the boring half of the pack. Boring is good - it means the model loads, and the Run node gets to do the fun part.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 1 options: (no HuggingFace model folders found in checkpoints/) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| glm_ocr_model | GLM_OCR_MODEL | — |