Nodes/ComfyUI_Llama3_8B/MiniCPM_Llama3_V25
ComfyUI Node

MiniCPM_Llama3_V25

The Pack's Vision Node That Describes (and Re-Prompts) Your Images

By smthemex·Created 2 years ago·Updated 2 years ago· 27
MiniCPM_Llama3_V25
  • image
  • prompt
repo_id
max_new_tokens2048
temperature0.70
top_p0.90
reply_language
questionWhat is in the image?

This is the odd one out, and the one worth a second look. Every other node in ComfyUI_Llama3_8B takes your text and writes a prompt. MiniCPM_Llama3_V25 takes an image and answers questions about it. It wraps OpenBMB's MiniCPM-Llama3-V 2.5, an 8B vision-language model built on Llama 3 that punches way above its weight on image understanding for its size.

In practice that gives you two genuinely useful workflows. The obvious one is auto-captioning: feed it any rendered image, ask "What is in the image?", and get a description string you can save alongside your generation. The sneaky one is image-to-prompt: run your own output through it and ask the model to rewrite what it sees as a fresh generation prompt - a cheap feedback loop for prompt engineering that slots right into the LLM-assisted prompting pattern the KB documents. It's a local, GPU-side alternative to dragging every image into an online vision API.

How it works

Unlike its siblings, this node skips the pipeline abstraction and loads the model the way OpenBMB's own examples do: AutoModel.from_pretrained(..., trust_remote_code=True), fp16, .to('cuda'), then a direct model.chat(image=..., msgs=...) call with sampling=True. Your ComfyUI IMAGE tensor gets converted to a PIL image before the call, and the model's reply comes back as the node's string output.

Output is a single STRING named prompt - same name and same wiring target as the text nodes, so it drops into any prompt slot.

Inputs

  • image - a ComfyUI IMAGE tensor, straight out of a Load Image or VAE Decode. This is the only node in the pack that eats one. Note it's designed for a single image: the batch dimension gets squeezed off, so a batched image will trip it up.
  • repo_id - openbmb/MiniCPM-Llama3-V-2_5. Open weights, no gated login dance like the Meta model.
  • question - what you ask about the image (default "What is in the image?").
  • max_new_tokens - default 2048 here, and it matters: image descriptions eat tokens fast, so don't choke it down to 128.
  • temperature (0.7), top_p (0.9), reply_language - same controls as the rest of the pack.

Installing and the trust_remote_code caveat

Pack install is shared: ComfyUI Manager → search ComfyUI_Llama3_8B → install → restart, or

cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_Llama3_8B

First run downloads the model (another ~16 GB, this time fp16) into your HuggingFace cache and it will look frozen while it does.

Now the caveat that deserves to be said plainly. trust_remote_code=True means ComfyUI downloads and executes Python code from the model's repo on first load. That's exactly the attack surface behind the ComfyUI_LLMVISION incident the KB documents - a custom node that shipped malware and ended in a federal prosecution. Here it's the legitimate OpenBMB official model, one of the most-downloaded small VLMs on HuggingFace, and the risk is the standard "you're running code you haven't audited" one. But given this pack's a one-commit hobbyist wrapper, the grown-up move is to glance at the node source and the OpenBMB repo before you trust it with anything sensitive. It's also the reason this node can be finicky: remote-code VLMs are version-sensitive, so if the pack loads but the node errors on model.chat, suspect a transformers version mismatch in your ComfyUI env before anything else.

VRAM story is the same as its siblings - 8B at fp16 wants a 16 GB card. And the same error-handling quirk applies: failures get returned as text in the output box rather than crashing the node, so when the output reads like a stack trace, that's the node telling you it broke, not answering you.

CategoryMeta_Llama3

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
repo_idSTRING
max_new_tokensINT204832–4096
temperatureFLOAT0.700.01–0.99
top_pFLOAT0.900.01–0.99
reply_languageCOMBO8 options: english, chinese, russian, german, french, spanish, +2
questionSTRINGWhat is in the image?

Outputs (1)

NameTypeDescription
promptSTRING