ComfyUI Node

Flux Prompt Enhance

Turn a six-word idea into a paragraph your T5 encoder actually likes

By marduk191·Created 2 years ago·Updated about a year ago· 120
Flux Prompt Enhance
    • STRING
    prompt
    seed0

    Flux rewards full sentences. Its T5-XXL encoder parses natural language the way it was written, and a five-word tag soup like "a girl in a forest, cinematic" leaves most of that encoder idle - you get a decent image, but you're leaving detail on the table. Flux Prompt Enhance is the node that fixes that with zero setup: you type a short prompt, it hands back a long, descriptive one, and you feed that into your existing Flux workflow. No API key, no separate LLM running in a browser tab, no paying anyone.

    Here's the thing about the name, though: it doesn't call the Flux API and it's not an LLM. The node wraps gokaygokay's Flux-Prompt-Enhance model on HuggingFace, which is a fine-tuned T5-base (220M params, Apache-2.0) trained to do exactly one job: rewrite "beautiful house with text 'hello'" into a two-story house with white trim and a stone pathway. People actually rate this little model - it got recommended in a r/comfyui thread as the best of the local prompt enhancers around when it shipped, and it's still the one that works out of the box.

    How it works

    Under the hood it's embarrassingly simple, which is the point. The node loads the tokenizer and model when the graph loads, builds a Transformers text2text-generation pipeline, and prepends a "enhance prompt: " prefix to your text before generating. Output is capped at 256 tokens, deliberately - that keeps it compatible with schnell's shorter prompt handling. A repetition_penalty of 1.2 stops it from looping on itself. First run downloads the ~850MB model into your HuggingFace cache; after that it runs entirely local, on CUDA if you have it, CPU otherwise.

    The inputs that matter

    Only two, and you'll mostly touch one:

    • prompt (multiline string) - your short prompt. You can type in the widget or convert it to an input and drive it from another node.
    • seed (int) - here's the quirk nobody mentions: seed == 0 runs greedy decoding, so you get the same output every time regardless of the value. Any nonzero seed flips it into sampling mode (temperature 0.7, top-k 50, top-p 0.95) and actually produces variations. So the seed widget is doing double duty as a greedy/sampled switch, not just reproducibility.

    The output is a single STRING with the enhanced prompt. Wire it into a CLIPTextEncode node feeding your Flux sampler, or into a ShowText node to eyeball it before committing.

    Installing it

    Easiest via ComfyUI Manager - search "Flux Prompt Enhance" and hit install. Or do it by hand:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/marduk191/ComfyUI-Fluxpromptenhancer.git
    cd ComfyUI-Fluxpromptenhancer
    pip install -r requirements.txt
    

    requirements.txt is just torch>=1.9.0 and transformers>=4.18.0 - and since ComfyUI already ships both, there's a good chance pip install is a no-op. Restart ComfyUI and you'll find the node under marduk191/Flux_Prompt_Enhancer. Offline or impatient? Pre-download the model with the README's one-liner (AutoTokenizer.from_pretrained('gokaygokay/Flux-Prompt-Enhance') plus the model) so the first run isn't a download.

    Gotchas

    Two things to know before you commit. First, this pack is no longer maintained - the README says so outright, because another dev forked it and the author decided two versions were one too many. For a node this thin that's fine; it wraps a model that's maintained separately, so it doesn't rot the way a bigger pack would. Just don't expect feature updates. Second, the model loads at graph-load time, so the first time you add the node you'll sit through a download plus a model load on top of ComfyUI's own startup - that's normal, not a hang.

    If you get "model not found", it's an internet issue or a broken HF cache; re-run the pre-download command. If the node doesn't appear at all, you cloned into the wrong environment - make sure pip targets the same Python ComfyUI uses. And if the enhanced output reads a little purple for your taste, remember the 256-token cap is the point: this is for schnell-style one-shot generation, not for hand-tuning a LoRA workflow where you want surgical control. For that, reach for an actual LLM node. This one is the "type two words, get a paragraph, go" option - and for that, it's genuinely good.

    Categorymarduk191/Flux_Prompt_Enhancer

    Inputs (2)

    NameTypeDefaultDescription
    promptSTRING
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING