Nodes/ComfyUI-TinyBee/Randomize List
ComfyUI Node

Randomize List

One seed, a new shuffle every run

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Randomize List
    • randomized_list
    string_list
    seed0

    Randomize List is the list-flavored sibling of the pack's image batch shuffler: feed it a list of strings and it rearranges the order, seeded so you can either reproduce a shuffle exactly or roll a new one every time.

    The obvious use is prompt roulette. Build a list of subject phrases or style keywords, shuffle it, and feed the reordered list into your prompt assembly - every run gets a different combination order. But it works anywhere a list's order has meaning: shuffling a set of reference filenames before processing them in sequence, randomizing the order your batch tests, breaking up a caption list so a downstream picker doesn't always grab the first entry. Same trick as the image batch version, just for plain text.

    How it works

    It takes a STRING list input plus a seed, seeds Python's random, and shuffles the list in place. Every element survives - nothing is dropped, duplicated, or changed, only reordered. That's the whole mechanism, and it's why the node is reliable enough to build on.

    The inputs that matter:

    • string_list (STRING, wired) - the list you're shuffling. In ComfyUI this is a list-typed input, so it comes from another node that outputs a list (like the pack's Get File List or String to List).
    • seed (INT, default 0) - the shuffle key. Same seed + same list = same order, every time. Change it for variety.

    The output is randomized_list - the same elements, freshly ordered, still a list you can feed onward.

    Installing it

    Part of ComfyUI-TinyBee, the small MIT-licensed utility pack from TinyBeeman. No models, no heavy install. Via ComfyUI Manager:

    1. Manager → Custom Nodes Manager.
    2. Search "ComfyUI-TinyBee" and install.
    3. Restart ComfyUI.

    Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    Restart and it's under 🐝TinyBee/Lists. Only the pack's JSON Parser node needs the extra jsonata dependency; this one uses pure standard library.

    Gotchas

    Same trap as its image sibling: the seed defaults to 0, so a "random" shuffle is only random until you change it. Wire in Auto Seed if you want genuinely varied order per queue. One more thing worth knowing - the shuffle is in place, meaning it can mutate the list object it received. If a downstream node still needs the original order, shuffle a copy instead, or keep a second list upstream of the node. It's a small detail, but it's bitten people who reuse a list in two places and watch both come back shuffled.

    Category🐝TinyBee/Lists

    Inputs (2)

    NameTypeDefaultDescription
    string_listSTRING
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    randomized_listSTRING