Nodes/ComfyUI-FLUX2-JSON/FLUX2 Color Palette 🎨
ComfyUI Node

FLUX2 Color Palette 🎨

Hand a global color palette to FLUX.2 without trusting your hex memory

By MushroomFleetΒ·Created 9 months agoΒ·Updated 5 months agoΒ· 27
FLUX2 Color Palette 🎨
    • color_palette
    • palette_preview
    β—„color_1β–Ί
    β—„color_2β–Ί
    β—„color_3β–Ί
    β—„color_4β–Ί

    FLUX2_ColorPalette is the small utility that gives your whole FLUX.2 scene one coherent mood instead of a pile of clashing accents. You type up to four hex codes into it, it validates them, normalizes them, and hands a clean FLUX2_COLOR_ARRAY to the Prompt Assembler, where it becomes the global color_palette field of your JSON prompt. It's the "overall mood" knob, separate from the per-subject colors you set inside FLUX2_SubjectCreator.

    It's part of the ComfyUI-FLUX2-JSON pack (MushroomFleet's "FLUX2 Prompt Builder"). Note the README's roadmap is slightly ahead of the code here - the docs list color pickers as "Phase 2," but the shipped v1.0.0 already includes this node and its sibling FLUX2_ColorPalettePreset. READMEs rot; the code is what you get.

    What it does with your colors

    Four inputs, color_1 through color_4, all optional, all plain strings. It accepts hex with or without the #, and 3-digit or 6-digit forms - #FF0000, FF0000, #f00, and f00 all work. For each non-empty input it:

    • validates it as hex,
    • normalizes to uppercase with # (so #ff0000 β†’ #FF0000),
    • skips anything empty or invalid, and tracks invalid entries for the preview.

    That last bit is the hidden value: instead of silently dropping a typo, it lists invalid colors in the palette_preview output so you can see exactly what got skipped. The preview is a plain STRING you can attach to a text node if you want it on screen - handy while you're tuning.

    Outputs:

    • color_palette (type FLUX2_COLOR_ARRAY) - wire this into the color_palette input of FLUX2_PromptAssembler. That's the only consumer in the pack.
    • palette_preview (STRING) - human-readable summary of what made it in and what didn't.

    Install and wiring

    Same story as every node in this pack - install once, get all eight:

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

    No model files, no dependencies beyond Python's stdlib - it's pure text work. It lives under FLUX2_Prompt_Builder/Utilities.

    The trap to avoid

    Color order matters to the model even if it matters to you less - FLUX.2's encoder reads a color list as a sequence, so put your dominant color first. And don't duplicate the job: if you're setting colors inside each SubjectCreator, a global palette that also mentions colors can fight with them (subject colors win per the README, but you don't want the JSON arguing with itself). Rule of thumb from the README: subject colors for specific objects, global palette for the room's mood. With one of those, your JSON prompt stays clean and your renders stop coming out rainbow.

    CategoryFLUX2_Prompt_Builder/Utilities

    Inputs (4)

    NameTypeDefaultDescription
    color_1optSTRINGβ€”
    color_2optSTRINGβ€”
    color_3optSTRINGβ€”
    color_4optSTRINGβ€”

    Outputs (2)

    NameTypeDescription
    color_paletteFLUX2_COLOR_ARRAYβ€”
    palette_previewSTRINGβ€”