Local LLM Prompt Enhancer
A rewrite button for your prompts that runs on your own GPU
- images
- video
- settings
- enhanced_prompt
- prompt
You type "girl on a bench, autumn." You get back a paragraph about her coat, the low sun through bare branches, the wet grain of the slats, the 85mm compression. That's the job, and it's the most common use of a language model in a ComfyUI graph: you write the idea, a small local LLM writes the prompt.
This is not a niche anymore - corpus mentions of "prompt enhancer" went from 12 in 2023 to 253 in the first half of 2026 - and it works because of how 2026 checkpoints are built. The text encoder is a language model, so a second language model writing that encoder's instruction is a translation between two things that speak the same language. Running it locally isn't about quality: a local model is uncensored, offline and free per call.
How it works
Prompt Enhancer is a client of the same persistent Local GGUF server that Local LLM Generate uses. That's the point: no second model load, no second process. If you already run Generate, this costs you nothing extra in VRAM.
The design decision that matters most: prompt is never touched. Enhancement writes to enhanced_prompt, the active entry of an editable array, and a ↑ control explicitly copies it back into prompt when you like what you got. Nothing silently rewrites your source text, which makes this safe to leave in a workflow you're still iterating on.
Two modes. Click Enhance Prompt for a manual rewrite - doing so partially executes the node so connected image tensors are available right then, instead of making you run the whole graph. Or flip enhance_with_workflow on and every normal run generates a fresh enhancement before sending it downstream. Off is the default.
The inputs that matter
prompt is your source. enhanced_prompt is the editable result; ← / → browse stored entries, × deletes the active one, and Undo restores the last array edit.
enhancement_preset loads a built-in template into enhancement_text, which is the actual instruction sent to the model. The six built-ins are well chosen for 2026: Krea 2 - Image, then MiniMax H3 in T2VA, I2VA, FL2VA, L2VA and Ref2VA flavours. Built-ins are protected from deletion; user templates live in ComfyUI/models/LLM/local_LLM_presets/prompt_enhancer/.
Read the default Krea 2 text before you trust it, because it's doing exactly the right thing: preserve subject, action, colors, spatial relationships, visible text and constraints; enrich only composition, lighting, environment, materials, mood; do not add unrelated people, objects, props or story events. That's a guardrail against the failure mode that defines this whole category - an enhancer inventing narrative you didn't ask for. It also matches how Krea 2 wants to be prompted: long natural language, no keyword stuffing, quotes around words meant to render as text.
seed is request-local with the usual Control After Generate options. prompt_cycle is the sleeper feature - with workflow enhancement off, it decides how the stored array advances after each run: fixed (default), increment, decrement, shuffle (no repeats until the bag is exhausted) or random. Shuffle and random use fresh internal randomness and ignore the seed. That's how you get varied prompts out of one stored list, and it runs off ComfyUI's global executed event, so it works whether or not you're looking at the node.
overwrite_enhanced controls storage: on replaces the active entry, off appends a new one and makes it active. Bump the count beside Enhance above 1 and the node auto-switches this to "add new" and locks it - sensible, since overwriting would throw away all but the last result.
Optional inputs: images (still or batch, as visual reference), video (native ComfyUI VIDEO, frames extracted using the server's sampling limits) and settings (a Local LLM Settings node). Vision needs a multimodal GGUF plus mmproj - connecting the socket to a text-only model does nothing.
prompt_set saves and restores the whole array plus the active index, stored under ComfyUI/models/LLM/local_LLM_presets/prompt_enhancer/prompt_sets/. Use these. The history array itself lives in a JSON widget on the node, so a couple of hundred stored prompts end up inside your workflow file.
Outputs
enhanced_prompt is what you wire downstream - into a text encode node, or a video model's prompt input. prompt is your original, unchanged, in case you want to compare or build a fallback path.
Installing it
ComfyUI Manager, search the pack title, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Solid-Code/ComfyUI-Local-GGUF-LLM
Models go under ComfyUI/models/llm/ (recursive - subfolders are fine), and llama-cpp-python is yours to install, since the pack's requirements.txt installs nothing on purpose:
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu124
Then open LLM in the side menu and start the model. One README warning worth obeying: don't install the standalone ComfyUI-Local-LLM-Prompt-Enhancer next to this pack, because a version of it already ships inside - two copies, two registrations, one confusing mess.
When it goes wrong
"Here is your enhanced prompt:" bleeding into your conditioning. The classic local-enhancer failure. The Krea 2 template ends with "return only the finished Krea 2 prompt" precisely to prevent it, but if preamble shows up, sharpen the instruction or lower temperature in Local LLM Settings. It's also why a reasoning model is a bad pick here - the job wants small and obedient, not a model that thinks out loud and leaks its scratch-work.
It invented a whole scene I didn't ask for. Subject drift. Narrow the job in enhancement_text rather than swapping in a bigger model.
It's not seeing my image. Text-only GGUF, or a vision_model that isn't the matching mmproj for that checkpoint.
Nothing happens on run. enhance_with_workflow is off and prompt_cycle is fixed, so you're reusing the same stored entry by design - that's the default, not a bug.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Original/source prompt. Enhance never changes this field. Use the ↑ control to explicitly replace it with the active Enhanced Prompt. | |
| enhanced_prompt | STRING | Editable active entry from the generated prompt array. Use ← / → to browse entries, × to delete the active entry, and Undo to restore the last array edit. | |
| prompt_set | COMBO | Unsaved | Named saved set for the enhanced-prompt array. Selecting a set loads its prompts and active entry. Save Prompt Set stores the current array and refreshes this selector automatically. |
| prompt_cycle | COMBO | fixed | How the stored enhanced-prompt array advances after a normal workflow run when Enhance with Workflow is off. Fixed keeps the active entry; Increment/Decrement wrap; Shuffle avoids repeats until the bag is exhausted; Random chooses freely. |
| overwrite_enhanced | BOOLEAN | false | Controls where a newly generated enhancement is stored. Enabled replaces the active enhanced prompt; disabled appends a new prompt and makes it active. |
| enhancement_preset | COMBO | Default / Krea 2 - Image | Loads a protected Krea 2 / MiniMax H3 enhancement template or a user template into the editable Enhancement Instructions field. |
| enhancement_text | STRING | Rewrite the source as one cohesive, natural-language prompt optimized for Krea 2 image generation. Preserve the original subject(s), action, colors, spatial relationships, requested medium/style, visible text, and all explicit constraints. Enrich only where it improves visual direction: composition and framing, viewpoint or lens language when useful, lighting, environment, materials, texture, depth, atmosphere, and mood. Prefer concrete visual details over keyword stuffing. Do not add unrelated people, objects, props, logos, story events, or unsupported specifics. If exact visible text is requested, preserve that text exactly in quotation marks. If the source is already detailed, lightly polish and organize it instead of making it much longer. Keep the result internally consistent and return only the finished Krea 2 prompt. | Editable instructions sent to the local LLM when Enhance is clicked or when Enhance with Workflow is enabled. Selecting a preset loads its text here; edits remain local until saved. |
| seed | INT | 00–18446744073709550000 | Standard ComfyUI request seed for prompt enhancement. Prompt Cycle Random/Shuffle use fresh internal randomness and do not depend on this seed. The linked control supports fixed, increment, decrement, and randomize behavior. |
| enhance_with_workflow | BOOLEAN | false | When enabled, normal workflow execution runs the Local GGUF enhancement using the current Prompt, Enhancement Instructions, seed, and connected image/video inputs, then sends the fresh enhanced prompt downstream. When disabled, the active stored enhanced prompt is used and Prompt Cycle controls the next active entry. |
| prompt_history_json | STRING | [] | — |
| prompt_history_index | INT | 00–2147483647 | — |
| prompt_preset | COMBO | Custom | Reusable prompts shared with Local LLM Generate from models/LLM/local_LLM_presets/prompts. Editing Prompt switches this selector to Custom. |
| prompt_cycle_revisionopt | INT | 00–2147483647 | — |
| prompt_shuffle_jsonopt | STRING | [] | — |
| prompt_state_idopt | STRING | — | |
| prompt_runtime_scopeopt | STRING | — | |
| imagesopt | IMAGE | Optional still image or IMAGE batch used as visual reference while enhancing. The Enhance button partially executes this node so connected image tensors are available immediately. | |
| videoopt | VIDEO | Optional native ComfyUI VIDEO reference. Frames are extracted and passed to the Local GGUF vision model using the server's current vision frame sampling limits. | |
| settingsopt | LOCAL_LLM_SETTINGS | Optional Local LLM Settings node. When connected, it supplies sampler, vision-limit, and runtime values. Seed remains owned by this Prompt Enhancer node and its local Seed controls stay active. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| enhanced_prompt | STRING | — |
| prompt | STRING | — |