Nodes/comfyui-adaptiveprompts/♻️ Prompt Shuffle ♻️ (Advanced)
ComfyUI Node

♻️ Prompt Shuffle ♻️ (Advanced)

Controlled tag drift instead of a full reshuffle

By Alectriciti·Created 12 months ago·Updated 23 days ago· 87
♻️ Prompt Shuffle ♻️ (Advanced)
    • shuffled_string
    string
    separator,
    shuffle_amount_start0
    shuffle_amount_end10
    mode
    algorithm
    limit0
    seed0

    The smarter sibling of PromptShuffle. Instead of yanking tags to totally random new positions, this one can make them "walk" - travel a bounded number of steps from their original spot rather than teleporting. That matters because, on CLIP-token models, position in a prompt affects attention weight: a full reshuffle can wreck the decaying-emphasis structure a carefully-ordered prompt relies on, while a walk keeps things roughly where they were and adds controlled jitter instead of a total reorder.

    How it works

    mode picks the movement style. WALK lets the chosen algorithm and the shuffle_amount_start/shuffle_amount_end range decide each tag's step size and direction per move. WALK_FORWARD and WALK_BACKWARD force the direction explicitly instead of leaving it to the algorithm. JUMP drops the walking behavior entirely and teleports a tag to a random new position - closer to what the plain PromptShuffle node does.

    algorithm shapes how the walk behaves: RANDOM is unbiased step selection, LINEAR_IN/LINEAR_OUT bias movement toward the center or the edges of the prompt respectively, and SHUFFLE_DECAY/SHUFFLE_DECAY_REVERSE apply a decay curve to how far a tag is allowed to travel - consistent with the pack's general framing around preserving a prompt's decaying-emphasis order rather than fighting it. shuffle_amount_start/shuffle_amount_end set the range of how many steps a tag can move in a given pass, and limit caps how many tags get touched at all (up to 1,000,000, which in practice means "no meaningful cap" for any realistic prompt length).

    The inputs and outputs that matter

    • string, separator - the prompt and what splits it.
    • shuffle_amount_start, shuffle_amount_end - range of step sizes per move.
    • mode - WALK, WALK_FORWARD, WALK_BACKWARD, or JUMP.
    • algorithm - RANDOM, LINEAR_IN, LINEAR_OUT, SHUFFLE_DECAY, or SHUFFLE_DECAY_REVERSE.
    • limit, seed.
    • Output: shuffled_string.

    How to install it

    Comes with the rest of the pack. Search comfyui-adaptiveprompts in ComfyUI Manager, or clone directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Alectriciti/comfyui-adaptiveprompts
    

    Restart ComfyUI. No models, no extra dependencies.

    Common issues & troubleshooting

    The mode/algorithm combination space is large and the in-node tooltips only explain WALK vs. JUMP at a glance. The fastest way to actually understand the behavior is to fix a seed and change one axis at a time - hold algorithm at RANDOM and cycle through the four mode values first, then hold mode at WALK and cycle through the five algorithm values, watching what actually moves in the output each time.

    Results vary more than expected even at a fixed seed. shuffle_amount_start/end define a range, not a single fixed step size - a wide range means real variance survives even with the seed locked, since the specific step size within that range is still part of what's being rolled. Narrow the range if you want tighter, more predictable reproducibility.

    You wanted a full reshuffle and got something much subtler. That's WALK mode doing exactly what it's designed for - small, bounded drift rather than a total reorder. If you actually want the old-style teleport-everywhere behavior, switch mode to JUMP, or just use the plain PromptShuffle node instead, which is built for that case specifically.

    Categoryadaptiveprompts/processing

    Inputs (8)

    NameTypeDefaultDescription
    stringSTRING
    separatorSTRING,
    shuffle_amount_startINT00–999
    shuffle_amount_endINT100–999
    modeCOMBOWALK - Travels the tag step by step in a certain direction. JUMP - Randomizes the position completely
    algorithmCOMBO5 options: RANDOM, LINEAR_IN, LINEAR_OUT, SHUFFLE_DECAY, SHUFFLE_DECAY_REVERSE
    limitINT00–1000000
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    shuffled_stringSTRING