LLM Prompt Generator
Turn a thought into a usable image prompt
- model
- STRING
Stuck staring at an empty prompt box? The LLMPromptGenerator node in gokayfem's VLM Nodes is the pack's text-to-prompt node: you give it a rough idea - "a neon city in the rain, Blade Runner vibes" - and a local LLM running in the same pack turns it into a structured, image-model-friendly prompt. It's the same idea as a thousand web tools, except it runs entirely on your machine and plugs straight into your graph.
What it's for
Any time you want a seed prompt and can't be bothered to compose one, or you want to remix an existing prompt through the lens of a language model. It pairs especially well with the pack's other nodes: feed it a VLM caption ("a red sports car parked outside a diner at dusk") and get back a fleshed-out prompt with lighting, lens, and mood terms added.
How it works
This is a pure LLM node - no image involved. You give it a model handle (a CUSTOM output from the pack's LLMLoader) and it sends your prompt through that GGUF model with a system message tuned for prompt generation, returning the model's reply as a STRING. The author recommends small prompt-specific GGUFs for this job: Qwen 1.8B Stable Diffusion Prompt or IF prompt MKR - a dedicated 1.8B prompt model beats a 7B general model at this one task, and it's faster.
The inputs that matter
- prompt - your starting idea. More specific in, more useful out.
- model - required
CUSTOMhandle from LLMLoader. This is the one that trips people up; the node has no model menu of its own. - temperature - default 0.2, and the defaults are low on purpose. This is a "consistency over creativity" node; if you want wilder variations, crank temperature and watch the output get looser.
- max_tokens - 512 default is fine for a prompt; raise it if the model truncates mid-sentence.
The rest - top_p, top_k, the two penalties, repeat_penalty - are the usual LLM sampling controls. Leave them alone until something looks wrong (like the model looping the same phrase; that's when you nudge repeat_penalty up from 1.1).
Output
A single STRING. Wire it into a CLIP Text Encode node and generate. You'll often want a ViewText node in between so you can see (and copy) what the model produced before you commit it to the sampler.
Install and gotchas
Same pack install as everything here:
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
Two real gotchas. First, this node needs llama.cpp, and llama.cpp installs are the pack's #1 pain point: install llama-cpp-python built for your backend (CUDA on NVIDIA, Metal on Mac, etc.) rather than letting it fall back to a CPU build - the README points at the official install instructions for exactly this. Second, don't forget the model file has to live in models/LLavacheckpoints (any GGUF works). And if the output comes back wrapped in chat-y prose instead of a clean prompt, you've loaded a general chat model - the dedicated prompt GGUFs above don't do that.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | CUSTOM | — | |
| max_tokens | INT | 5121–8192 | — |
| temperature | FLOAT | 0.200–2 | — |
| top_p | FLOAT | 0.950–1 | — |
| top_k | INT | 40 | — |
| frequency_penalty | FLOAT | 0.00-2–2 | — |
| presence_penalty | FLOAT | 0.00-2–2 | — |
| repeat_penalty | FLOAT | 1.100–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |