ComfyUI Node

MiniCPM VQA

The original multi-image Q&A node from the MiniCPM pack (and when to still use it)

By IuvenisSapiens·Created 2 years ago·Updated 11 months ago· 267
MiniCPM VQA
  • source_video
  • source_image_1st
  • source_image_2nd
  • source_image_3rd
  • STRING
text
modelMiniCPM-V-4_5-int4
keep_model_loadedfalse
top_p0.80
top_k100
temperature0.7
repetition_penalty1.05
max_new_tokens2048
video_max_num_frames64
video_max_slice_nums2
seed-1

MiniCPM_VQA is the original node in this pack for asking a vision-language model about an image, a video, or nothing at all - before it got a "Polished" sibling. Same model underneath, same idea: MiniCPM-V-4.5, OpenBMB's vision-language model, encodes whatever visual input you give it into tokens, mixes those with your text question, and an autoregressive language model writes an answer back out as a string. The only real difference from MiniCPM_VQA_Polished is how you feed it images, and that difference is worth understanding before you pick one.

What's actually different from Polished

This node exposes three separate, named image sockets - source_image_1st, source_image_2nd, source_image_3rd - instead of one batched source_image input. That's the README's "legacy" workflow: wire up to three specific images by hand, no extra node required, and ask something that spans all of them ("what's changed between these three photos?"). It's genuinely simpler for that exact case - two or three fixed images - because you don't need a separate batching step.

The catch is that it's capped at three, hard-coded into the node's inputs. If you need four images, or a variable number decided at runtime, this node can't do it - that's precisely the gap MiniCPM_VQA_Polished plus this pack's MultipleImagesInput node closes, by batching an arbitrary number of images into one IMAGE tensor and handing it to a single slot. So: pick MiniCPM_VQA when you want two or three fixed images and nothing fancier; pick Polished when the image count varies, or you already have a batch of images from somewhere upstream.

Everything else on the node is identical to Polished, because it's the same underlying generation call: source_video is also available as an optional input alongside the images, so single-video queries work here too.

The inputs that matter

  • text - your question, multiline. Ask it directly rather than expecting a fixed caption format: "what does this image show" or "compare these two photos" both work.
  • model - MiniCPM-V-4_5-int4 (default, quantized, smaller and faster) or MiniCPM-V-4_5 (full precision). Default int4 is the sensible choice for straightforward description tasks; go full precision only if you're pushing the model on something that needs finer judgment and you've got the VRAM.
  • source_image_1st / _2nd / _3rd and source_video (all optional) - connect whichever you're actually using; leave the rest empty.

The remaining required fields are standard sampling controls you'll rarely touch: top_p, top_k, temperature (0.7 default), repetition_penalty, and max_new_tokens (your cap on answer length). video_max_num_frames / video_max_slice_nums only matter if source_video is connected - they limit how many frames actually get sampled rather than every frame in the clip. keep_model_loaded defaults to off, meaning VRAM gets freed after every single call; turn it on if you're running this node repeatedly and don't want to pay the reload cost each time. seed exists purely so you can get the same answer twice.

Output: one STRING - the model's answer. Feed it into this pack's DisplayText to actually read it, or onward into a CLIPTextEncode if you're turning the answer into a prompt.

Installing it

ComfyUI Manager: search minicpm, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/IuvenisSapiens/ComfyUI_MiniCPM-V-4_5
pip install -r ComfyUI_MiniCPM-V-4_5/requirements.txt

then restart. Model weights aren't bundled - the model you pick downloads on first run into ComfyUI/models/prompt_generator/, automatically. It's a vision-language model, so that first download takes real time; a quiet first run isn't broken, it's fetching the checkpoint.

Common issues & troubleshooting

Wired three images but the node ignores one. Double-check it actually landed in source_image_1st/2nd/3rd and not accidentally on the same socket twice - since these are three distinct inputs rather than a list, a mis-wired connection silently just leaves one slot empty instead of erroring.

Need a fourth image. This node structurally can't take one - switch to MiniCPM_VQA_Polished and batch your images with MultipleImagesInput first rather than trying to force it here.

Dependency errors on install. requirements.txt installs into the same shared Python environment as every other custom node you've got - a version clash on something like transformers is a generic ComfyUI pain point, not specific to this pack. Check what other LLM/vision nodes in your setup already pinned before assuming this install is broken.

First run stalls on a hosted pod. Ephemeral containers that reset between sessions mean the model download (and sometimes the pip install) happens again every boot - a real friction point people have hit with earlier versions of this exact pack. Point the model directory at persistent storage if your host supports it.

CategoryComfyui_MiniCPM-V-4_5

Inputs (15)

NameTypeDefaultDescription
textSTRING
modelCOMBOMiniCPM-V-4_5-int42 options: MiniCPM-V-4_5-int4, MiniCPM-V-4_5
keep_model_loadedBOOLEANfalse
top_pFLOAT0.80
top_kINT100
temperatureFLOAT0.70–1
repetition_penaltyFLOAT1.05
max_new_tokensINT2048
video_max_num_framesINT64
video_max_slice_numsINT2
seedINT-1
source_videooptVIDEO
source_image_1stoptIMAGE
source_image_2ndoptIMAGE
source_image_3rdoptIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING