ComfyUI Node

Flux Prompt Generator

This Flux prompt generator runs on JSON, not an LLM — and it's built for Flux's dual-encoder brain

By fairy-root·Created 2 years ago·Updated 9 months ago· 248
Flux Prompt Generator
    • prompt
    • t5xxl
    • clip_l
    • clip_g
    • seed
    • debug_info
    seed27423
    custom
    subject
    accessoriesdisabled
    additional_detailsdisabled
    age_groupdisabled
    artformdisabled
    artistdisabled
    backgrounddisabled
    body_markingsdisabled
    body_typesdisabled
    clothingdisabled
    compositiondisabled
    default_tagsdisabled
    devicedisabled
    digital_artformdisabled
    ethnicitydisabled
    expressiondisabled
    eye_colorsdisabled
    face_featuresdisabled
    facial_hairdisabled
    hair_colordisabled
    hairstylesdisabled
    lightingdisabled
    makeup_stylesdisabled
    photographerdisabled
    photography_stylesdisabled
    photo_typedisabled
    placedisabled
    posedisabled
    rolesdisabled
    skin_tonedisabled
    tattoos_scarsdisabled

    If you came here expecting the ML-powered prompt generator from Aitrepreneur's famous Ultimate Flux Workflow, reset. That one downloads text2image-prompt-generator and an opus-mt translation model and needs its own models folder. This node shares the name and the origin story - FairyRoot ported Aitrepreneur's app to ComfyUI - but the ComfyUI version is a completely different beast: a seedable randomizer that draws terms from 30 bundled JSON files and stitches them into natural-language sentences. No API, no key, no model downloads. That's not a downgrade, it's the whole point.

    Why you'd reach for it

    Flux's text encoder is really two encoders. T5-XXL wants flowing sentences; CLIP-L still wants the tag list. The community's consensus, which this node encodes on purpose, is that you feed sentences to T5 and tags to CLIP-L, and that naming a physical camera is the single highest-leverage phrase you can add. This node does both things at once and randomizes them per run.

    So the honest use case is batch variety: plug it in front of a Flux sampler, queue 50 images, and get 50 differently-framed, differently-styled, camera-named prompts for zero typing. As a free LLM substitute it's no competition for a real model. As a slot machine for "photography of X" it's exactly what it claims.

    How it works

    Each of the 30 dropdowns is backed by a JSON list shipped in the repo's data/ folder - 713 artists, 564 backgrounds, 226 poses, a device list that is literally camera models like "Canon EOS R5 with RF 70-200mm f/2.8L IS USM". Every dropdown follows the same pattern:

    • disabled - skip this category entirely
    • random - pick a term using the seedable RNG
    • a specific value - use it as-is
    • comma-separated values - your own mini-pool, one is picked

    The generator then assembles sentences from templates: "working as {role}", "dressed in {clothing}", "They have {eye_color} eyes", "appearing {age_group}", "shot on {device}". Along the way it drops BREAK_CLIPG and BREAK_CLIPL markers into the text, then a splitter carves it into the three encoder-specific strings. Weights like (photo_type:1.3) stay in the CLIP-L block; T5 gets a cleaned version with all parentheses stripped, because T5 doesn't read weights.

    The inputs that matter

    You'll mostly touch three things: seed (INT, 0–30000), custom (multiline text prepended verbatim) and subject (the main subject; takes precedence over the default_tags dropdown). Everything else is "set it to random or leave it disabled" - which is the trap: every dropdown defaults to disabled, so an untouched node spits out a near-empty prompt. You have to actively feed it.

    Worth knowing: lighting on "random" picks 2–4 terms (the rest pick one), subject silently overrides default_tags, and photography_styles is ignored unless artform is photography.

    The outputs and wiring

    All six outputs are STRING, and the three encoder-split ones are the reason this node exists:

    • t5xxl - the natural-language version, for Flux's T5-XXL input
    • clip_l - the weighted tag block, for Flux's CLIP-L input
    • clip_g - its own segment, matches SDXL's second encoder
    • prompt - all three comma-joined (drop this into a plain CLIPTextEncode and it just works)
    • seed - the seed actually used, handy for logging what produced what
    • debug_info - a readable dump of which categories fired and which were ignored and why

    So for Flux: wire t5xxl and clip_l into a CLIPTextEncodeFlux. For SDXL: clip_l and clip_g. The node marks itself changed on every queue, so batch runs shuffle each time.

    Install

    ComfyUI Manager is the easy path - search "Flux Prompt Generator" and install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fairy-root/Flux-Prompt-Generator
    

    then restart ComfyUI. The nice part: there's no requirements.txt and no heavy dependency - the source uses only Python's standard library (the install_and_import helper in the file is dead code, never called). Thirty-one JSON files in data/ are the entire payload. It's MIT-licensed, and FairyRoot is a responsive author who posts nodes to r/comfyui and answers issues.

    Where people get burned

    Mainly the defaults. A fresh node is a silent no-op until you flip some dropdowns off "disabled" - turn on subject or default_tags, pick an artform, then set the categories you want varied to "random". And the seed cap of 30000 is smaller than you expect from other nodes, so treat seeds as throwaway session values rather than reproducible CivitAI-style recipes.

    CategoryPrompt

    Inputs (33)

    NameTypeDefaultDescription
    seedINT274230–30000
    customSTRING
    subjectSTRING
    accessoriesCOMBOdisabled40 options: disabled, random, ankle bracelet, anklet, backpack, bandana, +34
    additional_detailsCOMBOdisabled303 options: disabled, random, a purple iridescent suit, wearing a (necklace), wearing ((earrings)), wearing a (bracelet), +297
    age_groupCOMBOdisabled20 options: disabled, random, adult, aged prematurely, baby-faced, child, +14
    artformCOMBOdisabled47 options: disabled, random, animation, architecture, augmented reality art, body art, +41
    artistCOMBOdisabled713 options: disabled, random, Akihito Tsukushi, Al Hirschfeld, Alan Lee, Albert Bierstadt, +707
    backgroundCOMBOdisabled564 options: disabled, random, Eye-level shot, centered subject, direct perspective, Eye-level shot, centered subject, natural daylight, Eye-level shot, central framing, natural lighting, Eye-level shot, direct perspective, clear focus, +558
    body_markingsCOMBOdisabled36 options: disabled, random, acne scars on back, acne scars on face, birthmark on arm, birthmark on face, +30
    body_typesCOMBOdisabled42 options: disabled, random, anorexic, athletic, beefy, big-boned, +36
    clothingCOMBOdisabled299 options: disabled, random, a shimmering sequin dress, beige fedora, black bikini top, patterned cover-up, light-colored textures, beige fedora, white cropped top, textured terracotta skirt, beige hoodie, blue highlights, black sunglasses, blue sneakers, textured sole, +293
    compositionCOMBOdisabled79 options: disabled, random, ambient lighting, indoor setting, blurred plants, warm tones, architectural details, indirect lighting, white textured wall, architectural features, outdoor setting, brightly lit, foliage, hexagonal tiles, beach setting, evening sky, soft focus, ocean horizon, +73
    default_tagsCOMBOdisabled10 options: disabled, random, a man, a middle aged man, a middle aged woman, a old man, +4
    deviceCOMBOdisabled77 options: disabled, random, Agfa Box Camera with Meniscus lens f-11, Argus C3 with 50mm f-3.5 Cintar, Canon EOS 5D Mark IV with Canon EF 24-70mm f-2.8L II, Canon EOS 90D with Canon EF-S 18-135mm f-3.5-5.6 IS USM, +71
    digital_artformCOMBOdisabled70 options: disabled, random, Acrylic Paint art, Algorithmic art, Animation art, Art glass art, +64
    ethnicityCOMBOdisabled28 options: disabled, random, Aboriginal, African, African American, Afro-Caribbean, +22
    expressionCOMBOdisabled37 options: disabled, random, amused, angry, bewildered, bored, +31
    eye_colorsCOMBOdisabled28 options: disabled, random, amber, black, blue, brown, +22
    face_featuresCOMBOdisabled39 options: disabled, random, angular features, aquiline nose, arched eyebrows, broad forehead, +33
    facial_hairCOMBOdisabled27 options: disabled, random, beard with no mustache, bushy beard, chinstrap, clean-shaven, +21
    hair_colorCOMBOdisabled39 options: disabled, random, ash blonde, auburn, black, bleached blonde, +33
    hairstylesCOMBOdisabled41 options: disabled, random, with (afro hair), with (asymmetrical hair), with (bangs hair), with (beachy waves hair), +35
    lightingCOMBOdisabled42 options: disabled, random, Ambient lighting, Backlit, Bright daylight, Candlelight, +36
    makeup_stylesCOMBOdisabled37 options: disabled, random, artistic makeup, avant-garde makeup, bold eye makeup, bold lip makeup, +31
    photographerCOMBOdisabled54 options: disabled, random, Alessio Albi, Alex Webb, Alfred Stieglitz, Andreas Gursky, +48
    photography_stylesCOMBOdisabled42 options: disabled, random, abstract photography, action photography, aerial photography, architectural photography, +36
    photo_typeCOMBOdisabled39 options: disabled, random, abstract view, aerial view, back view, birds eye view, +33
    placeCOMBOdisabled62 options: disabled, random, aboard a sprawling interstellar spaceship, at a black market cybernetics clinic, at a bustling galactic trade hub, at a cafe, +56
    poseCOMBOdisabled226 options: disabled, random, arm raised, bent elbow, one leg forward, standing pose, confident stance, arm raised, standing straight, looking forward, arms crossed, head slightly tilted, direct gaze, arms crossed, looking at camera, slight head tilt, +220
    rolesCOMBOdisabled200 options: disabled, random, as a (abyssal ambassador), as an (accountant), as an (aero auto-rickshaw racer), as an (alien being), +194
    skin_toneCOMBOdisabled36 options: disabled, random, alabaster, ashen, bronze, brown, +30
    tattoos_scarsCOMBOdisabled40 options: disabled, random, abstract tattoo, acne scars, animal tattoo, back tattoo, +34

    Outputs (6)

    NameTypeDescription
    promptSTRING
    t5xxlSTRING
    clip_lSTRING
    clip_gSTRING
    seedSTRING
    debug_infoSTRING