Nodes/ComfyUI-FLUX2-JSON/FLUX2 Subject Creator πŸ‘€
ComfyUI Node

FLUX2 Subject Creator πŸ‘€

FLUX2 Subject Creator fixes the 'everything in the frame' prompt

By MushroomFleetΒ·Created 9 months agoΒ·Updated 5 months agoΒ· 27
FLUX2 Subject Creator πŸ‘€
    • subject
    β—„descriptionβ–Ί
    β—„positionβ–Ί
    β—„position_horizontalβ–Ί
    β—„position_verticalβ–Ί
    β—„position_depthβ–Ί
    β—„actionβ–Ί
    β—„poseβ–Ί
    β—„color_1β–Ί
    β—„color_2β–Ί
    β—„color_3β–Ί
    β—„color_4β–Ί

    FLUX.2's text encoder is an actual LLM, which means "a mug, a laptop, a plant, realistic" gets you a blur of three objects bleeding into each other. That's the whole reason this node exists: it forces you to describe one subject, on its own, and returns a tidy object the rest of the pack can slot into place. If you've been fighting FLUX.2 with comma-bag prompts and losing, this is the antidote.

    FLUX2_SubjectCreator is the per-item workhorse of the ComfyUI-FLUX2-JSON suite (MushroomFleet's "FLUX2 Prompt Builder"). It turns a single subject into a structured dict with description, position, action, pose, and up to four colors. That dict flows into FLUX2_SubjectArray, which batches subjects, and finally into FLUX2_PromptAssembler, which wraps everything as JSON. On its own it does nothing visible - there's no image out of this node. It's a prompt-building brick.

    The one input that matters is description. It's required, and the code raises a hard ValueError if you leave it blank - that's the "Subject description is required" error from the README. Write a full sentence with ownership and spatial relations ("Minimalist ceramic coffee mug with matte finish, sitting on a polished concrete surface"), not tag salad. The LLM encoder rewards sentences.

    Everything else is optional but worth knowing:

    • position - a free-text position like "Center foreground". If you set it, it overrides the three helper dropdowns below it. Or you can use the helpers instead and the node stitches them into one string: position_horizontal ("center"), position_vertical ("upper third"), position_depth ("foreground") become "center upper third foreground".
    • action vs pose - action is what the subject is doing ("walking toward camera"), pose is how it's standing ("leaning against the wall"). Distinct fields on purpose; keep them separate and FLUX.2 is less likely to fuse them.
    • color_1 through color_4 - hex codes or names, attached to this subject as its local color_palette. Per the README's color strategy, subject colors beat the global palette, so use these for the mug's matte black and let the global palette handle the room's mood. Note that valid-looking hex gets normalized to uppercase #RRGGBB, but the check is loose - a three-letter "name" that happens to be valid hex (like "ace") will get a # slapped on it. Use 6-digit codes to be safe.

    Output is a single subject socket (type FLUX2_SUBJECT). You'll almost always feed it into FLUX2_SubjectArray's subject_1–subject_12 inputs, then that array into PromptAssembler's subjects input. If you have exactly one subject, you can technically skip the array, but the assembler only takes a subject array, so in practice the array is always in the chain.

    Installing it

    It ships in the FLUX2-JSON pack, so install once, get all eight nodes:

    • ComfyUI Manager: open Manager β†’ Custom Nodes β†’ search "FLUX2 Prompt Builder" β†’ Install β†’ restart ComfyUI.
    • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/ComfyUI-FLUX2-JSON.git
    # restart ComfyUI
    

    Good news on the "it won't fit" front: there are no model downloads and no dependencies beyond Python's stdlib - the requirements file is a comment saying so. This pack is pure text plumbing. Find it under the FLUX2_Prompt_Builder/Subjects menu in the node list.

    Where people get burned

    The blank-description crash is the big one - the node throws rather than silently passing an empty subject, which is honestly good behavior, but it will confuse you the first time when your workflow goes red over a node that "does nothing." Also remember there's no FLUX.2 renderer in this pack: this node writes JSON, and you still need a FLUX.2 checkpoint workflow (Klein 4B/9B or Dev) to actually render the result. Build the prompt here, paste the assembled JSON into your sampler workflow, and the structured scene is what the VLM encoder reads.

    CategoryFLUX2_Prompt_Builder/Subjects

    Inputs (11)

    NameTypeDefaultDescription
    descriptionSTRINGβ€”
    positionoptSTRINGβ€”
    position_horizontaloptCOMBO8 options: , far left, left side, left of center, center, right of center, +2
    position_verticaloptCOMBO6 options: , top, upper third, middle, lower third, bottom
    position_depthoptCOMBO4 options: , foreground, midground, background
    actionoptSTRINGβ€”
    poseoptSTRINGβ€”
    color_1optSTRINGβ€”
    color_2optSTRINGβ€”
    color_3optSTRINGβ€”
    color_4optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    subjectFLUX2_SUBJECTβ€”