Nodes/ComfyUI-EreNodes/Prompt Randomizer
ComfyUI Node

Prompt Randomizer

Roll a fresh prompt combination on every generation

By Erehr·Created about a year ago·Updated 2 days ago· 69
Prompt Randomizer
    • STRING
    text
    prefix
    separator,\n\n
    seed0

    Most "randomize" tools in ComfyUI hit the seed, not the prompt. Prompt Randomizer is the opposite: it leaves the seed alone and reshuffles which tags in your list are active. Type a bucket of tags you like, hit the dice, and it rolls a new combination with the same number of tags turned on. Set it to auto-randomize and every generation spits out a different prompt from the same bucket - which is exactly what you want for the ideation phase, when you don't know what you want yet.

    What it actually is

    Prompt Randomizer is one of six siblings in the EreNodes pack (ComfyUI-EreNodes by Erehr, released mid-2025). They're all prompt-management widgets that render your text as clickable "tags" instead of raw text. The Randomizer is the one the community actually asked for: in the release thread, the top request was "randomly activate N tags from this list," and the author shipped a version with manual dice plus a "control after generate" mode.

    The tag list understands more than plain words. A tag can be a normal prompt token, an embedding, a LoRA (<lora:name:0.8>), or a saved Tag Group - and each renders as a pill you can toggle on or off by clicking.

    How it works

    The Python side is almost a no-op: like every node in the pack it just joins your prefix and text into a single STRING output. All the behavior lives in the frontend widget. When you hit randomize, it shuffles the tag array (a Fisher–Yates shuffle) and reactivates the same number of tags that were active before - so it keeps your list shape stable while changing which tags are in the prompt.

    There's also a control after generate combo widget on the node: fixed, increment, decrement, randomize. After each completed generation (ComfyUI fires an execution_success event), the node checks that combo and re-rolls accordingly. Two honest caveats from the shipped source: only randomize and fixed are actually wired up - increment and decrement are listed in the dropdown but the current build never defines their handlers, so picking them just does nothing. And the re-roll fires per finished generation, not when the whole queue empties.

    Inputs and outputs

    • text - your tag list, multiline, comma- or line-separated. This is the thing being randomized.
    • prefix (optional) - a STRING prepended to the output, handy for a stable opening like a quality tag or a character name you don't want shuffled.
    • Output - one STRING. Wire it into a CLIP Text Encode node, positive or negative. It's plain text, so if your tags include <lora:...> markup you'll want to route them through the pack's Prompt to LoRA Stack node (or a prompt-reading LoRA loader) instead of letting the text encoder eat them literally.

    Installing it

    ComfyUI Manager is the easy path: search "EreNodes", install, restart. Or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Erehr/ComfyUI-EreNodes.git
    

    Then restart ComfyUI. The nodes land under the EreNodes category. There's no heavy dependency story here - the pack's only declared Python dependency is safetensors, which ships with ComfyUI already; nearly everything is JavaScript in the frontend.

    Gotchas

    Randomize preserves the count of active tags - if you wanted "activate exactly 3 of these 20", make sure exactly 3 are on before you roll. The author has also said wildcards are a deliberate non-goal, so don't expect __name__ support inside the tag list; feed the output to a dedicated wildcard node instead. And if your workflows get shared around, remember this pack is all custom DOM widgets - on ComfyUI's Nodes 2.0 beta frontend, heavy widget packs like this one can render wrong, and the legacy canvas is the escape hatch until authors catch up.

    CategoryEreNodes

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    prefixoptSTRING
    separatoroptSTRING,\n\n
    seedoptINT00–18446744073709550000Decides the tag arrangement. The same seed always produces the same order and the same active tags.

    Outputs (1)

    NameTypeDescription
    STRINGSTRING