Nodes/ComfyUI Krea Palette Tools/Krea Palette To Prompt Text
ComfyUI Node

Krea Palette To Prompt Text

Turn a palette into a prompt clause with zero API calls

By SurrealByDesign·Created 2 months ago·Updated 2 months ago· 2
Krea Palette To Prompt Text
    • text
    palette_json
    max_colors4
    template{colors}

    KreaPaletteToPromptText turns a hex-color list into the sentence fragment "vivid red, sage green, and warm tan" - and it does it with pure local color math. No LLM, no API, no key, no cost, ever. If you run Krea 2 locally, this is the node that actually puts an extracted palette to work.

    The context matters: the hosted Krea product has a fancy style-reference module, but that feature is not in the open weights. Locally, Krea 2 is a natural-language model - it wants long, specific sentences. So the community's working answer to "make it match these colors" is to describe the palette in words. That's exactly what this node produces. Same prompt, same seed, swap the palette clause, get a different colorway. It's the poor-man's style transfer and it's surprisingly effective.

    How it works

    The mechanism is refreshingly deterministic:

    • It parses the incoming hex array, takes the first max_colors entries, and matches each against a small curated table of color names using Delta-E distance in LAB space (same perceptual math the extractor uses for dedup).
    • Repeated names get dropped, and the survivors are joined with commas and an "and" - proper grammar, not a raw list.
    • The {colors} placeholder in template is swapped for the joined phrase.

    There's no network call anywhere in this chain, which is why it's the pack's default path.

    The inputs that matter

    • palette_json - the STRING from KreaPaletteExtractor. It's marked force-input, so you wire it rather than typing it.
    • max_colors - how many names to include, 1–8, default 4. Three or four is the sweet spot for a prompt; more than that reads like a paint catalogue.
    • template - defaults to {colors}, but this is your hook. "color palette of {colors}" gives you a phrase that slots straight into a full sentence, which is what the README's example workflow does.

    Outputs

    One output: text (STRING), the finished clause. Wire it into a ShowText-style display node (or any STRING display) and copy it into your local Krea 2 prompt. The README's showcase_04 workflow is exactly this three-node chain: LoadImage → KreaPaletteExtractor → KreaPaletteToPromptText.

    Install

    Same story as the rest of the pack - clone, restart, one extra dependency:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SurrealByDesign/ComfyUI-Krea-Palette-Tools
    

    Or search "ComfyUI Krea Palette Tools" in ComfyUI Manager. The only real dependency is scikit-learn, installed automatically from requirements.txt (manual: pip install scikit-learn). No models, no weights, nothing to download. The nodes land under Krea/Palette after you restart ComfyUI.

    Where people trip

    Because naming is a fixed table, two colors that are visually distinct can map to the same name, and the dedup means you'll sometimes get fewer names than max_colors - that's the node doing its job, not misbehaving. Invalid input falls back to "neutral gray" instead of erroring, so a gray phrase means your palette_json was empty or malformed. And the classic: if you change template and forget to keep {colors} in it, you'll get a sentence that says nothing about colors.

    CategoryKrea/Palette

    Inputs (3)

    NameTypeDefaultDescription
    palette_jsonSTRING
    max_colorsINT41–8
    templateSTRING{colors}

    Outputs (1)

    NameTypeDescription
    textSTRING