Nodes/FunUI/FunUI Enhance Prompt
ComfyUI Node

FunUI Enhance Prompt

An Enhancer That Hands Your Prompt Back Unchanged When It Fails

By digital-garbage·Created about a year ago·Updated about 14 hours ago· 21
FunUI Enhance Prompt
  • clip
  • image
  • enhanced
  • status
◄text►
◄enabledfalse►
◄instructions►
◄max_length400►
◄greedyfalse►
◄temperature0.70►
◄top_p0.92►
◄top_k50►
◄min_p0.05►
◄repetition_penalty1.30►
◄presence_penalty0.00►
◄seed0►
◄thinkingfalse►
◄encoder_file►
◄encoder_familystable_diffusion►
◄use_imagetrue►
◄shortcuts►
◄lorebooks►
◄reference_intro►
◄chat►

The pitch for a prompt enhancer is always the same: type six words, get a cinema-ready paragraph. The reality, as anyone who's chained a local model into a graph knows, is two failure modes - the model writes chat boilerplate into your conditioning, or it invents narrative you didn't ask for. FunUI Enhance Prompt is built around a third, rarer virtue: if it fails, your original prompt walks out the other side and the status string tells you why.

That sounds small. It's the reason you can leave it switched on in a batch run.

What it actually does

It runs a language model that's already in your graph. The clip input isn't a CLIP encoder in the SD sense - it's a text encoder that can generate, the Gemma/Qwen chat encoders H3 and friends ship. The node drives ComfyUI's own generate/decode pair on it, so nothing extra is loaded if you're already using that encoder for the model itself. If the connected encoder can't generate text, the status says exactly that and the prompt passes through.

You get real decoding control, not a magic button: temperature, top_p, top_k, min_p, repetition and presence penalties, a token budget (max_length, default 400), greedy for always-likeliest output, and thinking for reasoning models - with the honest warning in the tooltip that reasoning eats the budget.

Then the bits that go beyond a rewrite: a seed where 0 means a fresh rewrite every run and any other number repeats the same one, an instructions field to replace the built-in system prompt, and a chat field for your comments on earlier rewrites. There are also shortcuts and lorebooks (paths to JSON) that hand the model named reference entries before it writes, plus image + use_image to show it a picture - the VLM route: caption what's actually there and let it write from that.

Inputs and outputs

Minimum viable setup:

  • clip - a generative text encoder. On H3 this is not H3's own encoder; the pack's own docs say pick a chat encoder like Gemma because H3's can't write prose.
  • text - the prompt.
  • enabled - default false. Off means no model run at all, prompt through untouched.

Then, if you want to tune it: max_length, greedy, the sampling dials, seed, thinking, instructions, encoder_file + encoder_family (use a separate encoder just for rewriting; the node caches it so a second Generate doesn't reload nine gigabytes), image/use_image, shortcuts/lorebooks/reference_intro, chat.

Two outputs:

  • enhanced - the string to encode. Identical to your input on any failure.
  • status - off, skipped: the prompt is empty, unavailable: the connected CLIP does not expose text generation, a character count on success, or the failure reason. This is the node's best feature; ignore it and you'll blame the model.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/digital-garbage/FunUI
cd FunUI && pip install -r requirements.txt

ComfyUI Manager: search FunUI. Restart after installing, and check Settings ▸ About FunUI for the version. No separate LLM server, no API key, no Ollama - it borrows the encoder you already have. (Pack page says olivv-cs/ComfyUI-FunPack; repo is digital-garbage/FunUI. Rename, not a fork.)

The requirements file wants comfy-kitchen>=0.2.32 and gguf and pointedly does not upgrade torch. If pip starts offering to change torch, numpy or transformers, stop and think - the pack's docs say the same thing.

Where people get burned

Drift. An enhancer earns its name by adding detail and will happily add detail you never asked for; the community answer is narrower instructions and chained, tightly-scoped steps rather than one open-ended rewrite. Set instructions and be specific about what must not change.

Markup, eaten. If the prompt has (word:1.5) or [a@2-4], the model reads it as punctuation. The node logs a warning about exactly this. Enhance first, mark up after.

Encoder mismatch. H3's own encoder can't write prose. Wire Gemma or Qwen, or use encoder_file to point at one, and keep encoder_family at its default unless your file belongs to another family.

Treating a rewrite as deterministic. With seed at 0 it isn't. If you're comparing two prompts, fix the seed or you're comparing noise.

Expecting it to write better than you can. A local 8B–30B model removing the blank-page problem is a real win. It is not a writer, and the honest ceiling for local models on this job is modest. Use it to restructure what you meant, not to invent what you didn't.

CategoryFunUI/Conditioning

Inputs (22)

NameTypeDefaultDescription
clipCLIPA text encoder that can generate text (Gemma, Qwen...).
textSTRING—
enabledBOOLEANfalseOff: the prompt passes through and the model is not run.
instructionsoptSTRINGWhat the model is told to do. Empty uses the built-in instructions.
max_lengthoptINT40032–4096The longest rewrite, in tokens.
greedyoptBOOLEANfalseAlways the likeliest word. Hides the sampling dials below.
temperatureoptFLOAT0.700–2—
top_poptFLOAT0.920–1—
top_koptINT501–1000top_p and min_p only apply while top_k is above 0.
min_poptFLOAT0.050–1—
repetition_penaltyoptFLOAT1.301–2—
presence_penaltyoptFLOAT0.000–2—
seedoptINT00–184467440737095500000 = a fresh rewrite every run. Any other number repeats the same rewrite.
thinkingoptBOOLEANfalseLet a thinking model reason first. Its reasoning eats the token budget.
encoder_fileoptSTRINGA text encoder file just for rewriting (Gemma, Qwen...). Empty uses the model's own encoder.
encoder_familyoptSTRINGstable_diffusionWhich family that file is for. Only used with an encoder file.
imageoptIMAGEShown to the model alongside the prompt.
use_imageoptBOOLEANtrueSend the picture (when one is connected) to the model.
shortcutsoptSTRINGShortcut names to hand the model as reference, one per line.
lorebooksoptSTRINGPaths to lorebook or shortcuts JSON files, one per line.
reference_introoptSTRINGThe line above the reference entries. Empty uses the built-in one.
chatoptSTRINGYour comments on earlier rewrites (Composer > Chat).

Outputs (2)

NameTypeDescription
enhancedSTRING—
statusSTRING—