Flux Prompt Generator
Build a full Flux prompt from dropdowns, then let a local LLM clean it up
- generated_prompt
- choices
If you've ever wondered how the good Flux images end up with five sentences of camera, lighting, and scene detail instead of a lonely subject and a hope, this node is basically that process automated. Give it a subject, flip a couple dozen category switches to "random" or "default," and it assembles a full descriptive paragraph - then, if you want, hands that paragraph to a local LLM running in Ollama to smooth it into something that reads like a sentence instead of a pile of fragments. It's a ComfyUI port of Aitrepreneur's FLUX-Prompt-Generator Hugging Face Space - Aitrepreneur being one of the more trusted names doing AI tutorials on YouTube, for what that's worth as a pedigree check on a niche node pack.
This matters specifically for Flux because its text encoder is CLIP-L plus T5-XXL, and T5 wants sentences, not comma-separated tags - a real departure from SDXL-era habits of stacking tags and leaning on attention weights. Flux reads your prompt closer to an instruction than a token bag, so having something write that instruction for you, in the shape the encoder actually wants, is a legitimate shortcut rather than a gimmick.
How it works
Under the hood it's a long list of curated word banks - artform, photo type, body type, lighting, clothing, composition, pose, background, and a dozen more - each exposed as its own dropdown with three settings: disabled skips that category, random rolls something from the pack's internal list, default uses its preset value. OVERRIDE_STYLES is the bulk switch: set it to "Set All Random" and every category rolls at once instead of you clicking through twenty dropdowns by hand. Whatever comes out gets merged with your subject and custom_base_prompt into one raw prompt.
If use_ollama is on (it is by default), that raw prompt goes to a local Ollama model - pick it via ollama_model - for a rewrite pass. happy_talk nudges the tone of that rewrite, and compress (with compression_level: soft/medium/hard) trims the result down afterward. That pair isn't cosmetic: LLM-encoded models like Flux start losing coherence past roughly 75-100 effective tokens, so a tight final prompt is protecting your generation, not just tidying it. poster, per its name, tilts the output toward movie-poster-style copy instead of a straight photo description.
The inputs and outputs that matter
You mostly touch three fields: subject (what the image is of), custom_base_prompt (an optional starting sentence or two), and seed (lock it for reproducible random rolls). Leave the style dropdowns disabled for a lean prompt, or set OVERRIDE_STYLES to "Set All Random" if you want the node to throw everything at it. Two outputs: generated_prompt, the finished text - wire it straight into your CLIP Text Encode - and choices, a readable rundown of what each "random" category actually rolled, useful if you like a result and want to pin it as a fixed default next time.
Installing it
Via ComfyUI Manager: search "ComfyUI_FluxPromptGen" or "Flux Prompt Generator." It's a small, niche pack, so if Manager doesn't turn it up, clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/dfghsdh/ComfyUI_FluxPromptGen
pip install -r ComfyUI_FluxPromptGen/requirements.txt
(Ignore the clone URL printed in the pack's own README - it still has a your-username placeholder left in it from whatever template it started as. Use the one above.) Restart ComfyUI after.
Separately - the step people skip - you need Ollama installed and running on the same machine, with at least one model pulled (ollama pull llama2 matches the node's default). Leave use_ollama on without that and the node has nothing to talk to.
Common issues & troubleshooting
The ollama_model dropdown is empty, or the request fails on an empty model string. This is the most common way any Ollama-backed ComfyUI node trips people up: the dropdown reflects whatever models you've actually pulled locally, and an empty list makes Ollama's API reject the call outright rather than fall back to something sensible. Run ollama list - if it's empty, ollama pull llama2 and restart ComfyUI.
Nothing happens, or it hangs. Confirm Ollama is actually running (ollama serve, or just have the app open) and reachable on its default port - easy to have it installed but not currently running.
You'd rather skip Ollama entirely. Turn use_ollama off. You still get the templated prompt built from your category picks, minus the LLM rewrite - a fine way to run this if you don't want a second local model competing for VRAM alongside your image model.
Treat it like the small, single-maintainer pack it is. The README is thin - leftover placeholder license, that broken clone URL - and there's no large community backstopping edge cases. If a category dropdown does something unexpected, check its value before assuming your setup is broken.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| use_ollama | BOOLEAN | true | — |
| ollama_model | COMBO | llama2 | 1 options: llama2 |
| happy_talk | BOOLEAN | true | — |
| compress | BOOLEAN | true | — |
| compression_level | COMBO | hard | 3 options: soft, medium, hard |
| poster | BOOLEAN | false | — |
| custom_base_prompt | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| custom | STRING | — | |
| subject | STRING | — | |
| OVERRIDE_STYLES | COMBO | Keep Current | 3 options: Keep Current, Set All Random, Set All Disabled |
| artform | COMBO | disabled | 3 options: disabled, random, default |
| photo_type | COMBO | disabled | 3 options: disabled, random, default |
| body_types | COMBO | disabled | 3 options: disabled, random, default |
| default_tags | COMBO | disabled | 3 options: disabled, random, default |
| roles | COMBO | disabled | 3 options: disabled, random, default |
| hairstyles | COMBO | disabled | 3 options: disabled, random, default |
| additional_details | COMBO | disabled | 3 options: disabled, random, default |
| photography_styles | COMBO | disabled | 3 options: disabled, random, default |
| device | COMBO | disabled | 3 options: disabled, random, default |
| photographer | COMBO | disabled | 3 options: disabled, random, default |
| artist | COMBO | disabled | 3 options: disabled, random, default |
| digital_artform | COMBO | disabled | 3 options: disabled, random, default |
| place | COMBO | disabled | 3 options: disabled, random, default |
| lighting | COMBO | disabled | 3 options: disabled, random, default |
| clothing | COMBO | disabled | 3 options: disabled, random, default |
| composition | COMBO | disabled | 3 options: disabled, random, default |
| pose | COMBO | disabled | 3 options: disabled, random, default |
| background | COMBO | disabled | 3 options: disabled, random, default |
| append_custom_base_promptopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| generated_prompt | STRING | — |
| choices | STRING | — |