Nodes/VLM_nodes/MiniCPM-V 2.6 (GGUF)
ComfyUI Node Runs on cloud

MiniCPM-V 2.6 (GGUF)

A tiny VLM with a serious OCR habit

By gokayfem·Created 3 years ago·Updated 17 days ago· 587
MiniCPM-V 2.6 (GGUF)
  • image
  • STRING
promptDescribe this image in detail.
model_variant
context_length4096
temperature0.2
top_p0.80
top_k100
repeat_penalty1.05
gpu_layers-1
n_threads12
max_tokens512
unload_afterfalse
n_batch512
n_ubatch512
flash_attentionAuto
use_mmaptrue
split_modeLayer
main_gpu0
tensor_split

MiniCPM-V is the little model with the reputation for punching up: OpenAI's MiniCPM family got famous for doing vision-language work far above its parameter count, and the V 2.6 variant has one superpower people actually build workflows around - reading text off images. MiniCPMNode wraps MiniCPM-V 2.6 as a GGUF running through llama.cpp, with the quantization ladder laid out right in the node so you can pick your memory/speed tradeoff by eye.

What it's for

Whenever your captioning job is really an OCR-plus-understanding job: receipts, screenshots, signs in photos, whiteboards, document pages. It also handles the general "describe this image" and visual Q&A duties fine, but the reason people install this node specifically is the text-in-image accuracy at a fraction of the VRAM a 7B model would want.

How it works

Unlike the transformers-based VLMs in this pack (Qwen2-VL, Molmo), MiniCPM-V here runs through llama.cpp like the LLaVA nodes: a GGUF language model plus an mmproj-model-f16.gguf vision projector, both downloaded automatically from openbmb/MiniCPM-V-2_6-gguf into models/LLavacheckpoints. The node picks the model and projector, builds a llama.cpp handle with a vision handler, and runs chat-style image+prompt completion.

The inputs that matter

  • model_variant - the memory/quality dial, and the labels do the math for you: Q2_K (3GB), Q4_K_M (4.7GB), Q8_0 (8.1GB), F16 (15.2GB), etc. Q4 or Q5 is the sane default for OCR work; Q8 is basically fp16 at half the size if it fits.
  • prompt - be specific, this model rewards it. "Transcribe all the text in this image" beats "describe".
  • context_length - default 4096 is fine; you only push it up for long multi-turn or huge image crops.
  • temperature - the model ships with the standard guidance: 0.1–0.5 for focused deterministic answers (do this for OCR), 0.8+ for creativity.

The rest - top_p, top_k, repeat_penalty - are normal sampling controls; leave them unless output looks off.

Output

A single STRING. Straight into ViewText or down the prompt chain.

Install

Pack-standard, and this one has a llama.cpp dependency that's worth planning for:

cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI_VLM_nodes
python -m pip install -r ComfyUI/custom_nodes/ComfyUI_VLM_nodes/requirements.txt

Then install a llama-cpp-python wheel built for your GPU backend - the pack's README links the official install docs and warns specifically that a wrong/CPU build silently disables GPU offload. If the first run is slow, that's usually what happened. First run also downloads the GGUF + projector (a few GB at the higher quants), so don't panic at the console.

The tradeoff

F16 (15.2GB) is a trap on consumer cards - you're paying 15GB for accuracy you get from Q8 in 8GB. And while MiniCPM-V 2.6 is genuinely good at reading text, it's still a small model: dense document layout or tiny low-contrast text will trip it up. If OCR is the whole job, give the prompt explicit instructions and feed the largest crop you can.

CategoryVLM Nodes/Legacy/Model Loaders

Inputs (19)

NameTypeDefaultDescription
imageIMAGE
promptSTRINGDescribe this image in detail.
model_variantCOMBO6 options: Q2_K (3GB), Q3_K (3.8GB), Q4_K_M (4.7GB), Q5_K_M (5.4GB), Q8_0 (8.1GB), F16 (15.2GB)
context_lengthINT4096512–131072
temperatureFLOAT0.20–2
top_pFLOAT0.800–1
top_kINT1000–1000
repeat_penaltyFLOAT1.050–2
gpu_layersoptINT-1-1–1000
n_threadsoptINT121–256
max_tokensoptINT5121–8192
unload_afteroptBOOLEANfalse
n_batchoptINT5121–8192Logical prompt batch. Lower this if context loading runs out of memory.
n_ubatchoptINT5121–8192Physical prompt micro-batch. Never exceeds n_batch.
flash_attentionoptCOMBOAutoAuto enables llama.cpp flash attention only with accelerator offload and safely retries without it when unsupported.
use_mmapoptBOOLEANtrueMemory-map GGUF weights when the installed backend supports it.
split_modeoptCOMBOLayerHow llama.cpp distributes tensors across multiple accelerators.
main_gpuoptINT00–31
tensor_splitoptSTRINGOptional comma-separated accelerator proportions, for example 0.6,0.4.

Outputs (1)

NameTypeDescription
STRINGSTRING