MiniCPM-Plus: 3-4B
The local LLM that writes your image prompts for you
- STRING
The short version
Your image model speaks a weird dialect, and by now you've noticed. Hand a Flux or Z-Image checkpoint a sentence and it listens; feed it a comma-tag soup and it shrugs. MiniCPM3_4B is a translator for that problem: a small, entirely local LLM that takes a rough idea in plain language and hands you back a polished prompt. No API, no key, nothing leaves your machine.
It's one of five nodes in the ComfyUI-MiniCPM-Plus pack, and the text-only side of the family. The V-2.6 nodes look at pictures; this one just writes.
How it works
Under the hood it wraps OpenBMB's MiniCPM3-4B, a 4-billion-parameter model that's strong on instruction following and genuinely good in both Chinese and English. On first run it pulls the weights from Hugging Face into ComfyUI/models/MiniCPM/MiniCPM3-4B, then your prompt goes through a chat template and a standard transformers generation call.
The two prompt boxes are the whole interface:
user_promptA- your main instruction ("Write a detailed Flux prompt for a rainy neon alley, cinematic lighting")user_promptB- a second line that gets appended to A; leave it empty and nothing bad happens
max_new_tokens (default 300) caps how long the answer can be. temperature, top_p, and top_k are the usual sampling knobs, and the defaults of 0.5 / 0.8 / 50 are a sane place to start. One quirk worth knowing: the node accepts a seed, but it never actually seeds anything - don't count on reproducible text out of this one.
The output is a single STRING, which is the interesting part for a ComfyUI workflow. Wire it into a CLIP Text Encode (or any text input) and the model does the heavy lifting of turning "the vibe from that movie" into something the checkpoint actually obeys.
Why you'd reach for it
Because the whole prompting paradigm moved. On LLM-encoded models - Flux, Z-Image, Klein and friends - your prompt is a message read by an LLM, so having an LLM draft it is translation between two native speakers rather than a hack. This node is the cheapest way to do that: a 4B model runs on a mid-range GPU (figure ~8GB for fp16), and it's fast enough that regenerating a few candidate prompts is painless.
Install and gotchas
Install the pack once and all five nodes come with it:
cd ComfyUI/custom_nodes
git clone https://github.com/CY-CHENYUE/ComfyUI-MiniCPM-Plus
Or use ComfyUI Manager: search "MiniCPM-Plus" and hit Install. Either way, restart ComfyUI.
Three things trip people up, and they're shared across the whole pack:
- First run is slow. The node auto-installs a hefty dependency list (transformers, accelerate, bitsandbytes, auto-gptq, sentencepiece, …) and then downloads the model. Both happen on first execution, so budget a few minutes and a stable connection.
- Dependencies land in your shared Python env. The auto-installer runs pip into the same environment as everything else, and dependency conflicts between custom nodes are a classic ComfyUI failure mode. If another pack breaks right after the first run, that's the usual suspect - restart before you debug.
- CPU technically runs, practically crawls. The node has a CPU fallback, but this is a GPU toy. On a machine without CUDA you'll be waiting a long time.
If the download dies midway, pre-pull the weights yourself into ComfyUI/models/MiniCPM/ and the node will pick them up.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| max_new_tokens | INT | 3001–3000 | — |
| temperature | FLOAT | 0.50.1–2 | — |
| top_p | FLOAT | 0.80.1–1 | — |
| top_k | INT | 501–1000 | — |
| seed | INT | 00–18446744073709550000 | — |
| user_promptAopt | STRING | — | |
| user_promptBopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |