Nodes/cgem156-ComfyUI๐ŸŒ/Random Color Prompt ๐ŸŒ
ComfyUI Node

Random Color Prompt ๐ŸŒ

Batch-generate prompt variants with different colors

By laksjdjfยทCreated 2 years agoยทUpdated about a month agoยท 93
Random Color Prompt ๐ŸŒ
    • BATCH_STRING
    • STRING
    โ—„base_promptโ–บ
    โ—„num_prompts4โ–บ
    โ—„seed0โ–บ

    If you've ever wanted "the same outfit, but generate it in ten different colors" without typing ten separate prompts, this is the node for that. It takes one base prompt and produces a batch of variants, each with a randomly picked color worked in, ready to feed straight into the rest of cgem156's batch_condition pipeline.

    How it fits the pack

    This is one of three ways to produce a BATCH_STRING in this pack - BatchString is the manual "type N strings yourself" version, PrefixString transforms an existing batch, and this node is the "generate variations automatically" version. From here the normal next step is CLIPTextEncodeBatch to turn the whole batch into conditioning in one shot, then a batched sampler run, then SaveImageBatch/SaveBatchString to keep the results organized.

    Inputs and outputs that matter

    • base_prompt - your starting prompt text, multiline, with the color left out (or with a placeholder, depending on how the node's own random-insertion logic reads your text).
    • num_prompts (default 4, 1โ€“100) - how many variants to generate. This is your batch size for everything downstream.
    • seed - controls which colors get picked, so the same seed reproduces the same batch of variants.
    • Outputs: BATCH_STRING - the actual batch to wire into CLIPTextEncodeBatch or SaveBatchString, and STRING - a single combined/preview string, useful for a quick look at what got generated without inspecting the whole batch.

    Installing it

    ComfyUI Manager โ†’ search cgem156-ComfyUI๐ŸŒ โ†’ install โ†’ restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/laksjdjf/cgem156-ComfyUI
    

    then restart ComfyUI. Nothing extra to download for this node.

    Common issues & troubleshooting

    Same result every run. That's the seed doing its job - it's deterministic by design, same as sampling seeds elsewhere in ComfyUI. Change it (or randomize it) if you want a fresh set of color picks each time.

    Batch is bigger than you meant to sample. num_prompts directly drives how many images your downstream sampler ends up producing if you're feeding the whole batch through in one go. Ten prompt variants means ten full samples' worth of compute - start smaller while you're dialing in the base prompt.

    Colors aren't landing where you expect in the text. Since the base prompt is free text, how naturally the color gets worked in depends on how you phrased it. If results look awkward, try structuring your base prompt so a color word slots in cleanly (e.g. a dedicated clause like "wearing a [color] dress") rather than a prompt with no obvious place for one.

    Only got generic variety, not colors specifically. This node is scoped narrowly to color variation, not general prompt randomization - if you want broader variety (poses, settings, styles), you'll want a different tool; this one is purpose-built for the "same subject, different color" case.

    Categorycgem156 ๐ŸŒ/batch_condition

    Inputs (3)

    NameTypeDefaultDescription
    base_promptSTRINGโ€”
    num_promptsINT41โ€“100โ€”
    seedINT00โ€“18446744073709550000โ€”

    Outputs (2)

    NameTypeDescription
    BATCH_STRINGBATCH_STRINGโ€”
    STRINGSTRINGโ€”