Nodes/ComfyUI_FluxPromptGen/Flux Prompt Generator
ComfyUI Node

Flux Prompt Generator

Build a full Flux prompt from dropdowns, then let a local LLM clean it up

By dfghsdh·Created 2 years ago·Updated 2 years ago· 18
Flux Prompt Generator
    • generated_prompt
    • choices
    use_ollamatrue
    ollama_modelllama2
    happy_talktrue
    compresstrue
    compression_levelhard
    posterfalse
    custom_base_prompt
    seed0
    custom
    subject
    OVERRIDE_STYLESKeep Current
    artformdisabled
    photo_typedisabled
    body_typesdisabled
    default_tagsdisabled
    rolesdisabled
    hairstylesdisabled
    additional_detailsdisabled
    photography_stylesdisabled
    devicedisabled
    photographerdisabled
    artistdisabled
    digital_artformdisabled
    placedisabled
    lightingdisabled
    clothingdisabled
    compositiondisabled
    posedisabled
    backgrounddisabled
    append_custom_base_prompt

    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.

    Categoryprompt

    Inputs (30)

    NameTypeDefaultDescription
    use_ollamaBOOLEANtrue
    ollama_modelCOMBOllama21 options: llama2
    happy_talkBOOLEANtrue
    compressBOOLEANtrue
    compression_levelCOMBOhard3 options: soft, medium, hard
    posterBOOLEANfalse
    custom_base_promptSTRING
    seedINT00–18446744073709550000
    customSTRING
    subjectSTRING
    OVERRIDE_STYLESCOMBOKeep Current3 options: Keep Current, Set All Random, Set All Disabled
    artformCOMBOdisabled3 options: disabled, random, default
    photo_typeCOMBOdisabled3 options: disabled, random, default
    body_typesCOMBOdisabled3 options: disabled, random, default
    default_tagsCOMBOdisabled3 options: disabled, random, default
    rolesCOMBOdisabled3 options: disabled, random, default
    hairstylesCOMBOdisabled3 options: disabled, random, default
    additional_detailsCOMBOdisabled3 options: disabled, random, default
    photography_stylesCOMBOdisabled3 options: disabled, random, default
    deviceCOMBOdisabled3 options: disabled, random, default
    photographerCOMBOdisabled3 options: disabled, random, default
    artistCOMBOdisabled3 options: disabled, random, default
    digital_artformCOMBOdisabled3 options: disabled, random, default
    placeCOMBOdisabled3 options: disabled, random, default
    lightingCOMBOdisabled3 options: disabled, random, default
    clothingCOMBOdisabled3 options: disabled, random, default
    compositionCOMBOdisabled3 options: disabled, random, default
    poseCOMBOdisabled3 options: disabled, random, default
    backgroundCOMBOdisabled3 options: disabled, random, default
    append_custom_base_promptoptSTRING

    Outputs (2)

    NameTypeDescription
    generated_promptSTRING
    choicesSTRING