LogicUtil_Random Shuffle String
Seeded shuffle for your prompt lists
- STRING
Here's a workflow problem: you have a list of prompt styles or subjects, and you want each queue run to visit them in a different order - but you also want to be able to reproduce a run exactly. LogicUtil_Random Shuffle String is the node that does it: split a list, shuffle it with a seeded RNG, output the reordered list. Of the three shuffle siblings this is the one that's actually named honestly - it shuffles strings, and strings are what come out.
How it works
Inputs: input_string (default a$b$c), separator (default $), and seed (an INT, 0 to 9999999999, default 0). The mechanism is random.Random(seed).shuffle() applied to the split pieces. Same seed, same order, forever. Different seed, fresh order. That determinism is exactly what makes it useful rather than a party trick - you can farm through orderings by stepping the seed the same way you'd step a generation seed.
Two things to know before wiring it in. First, the output is a list, not a single string. The schema labels it STRING and the wire says string, but the actual value is the shuffled list, which is how this family threads lists between nodes. It's not a one-value-out consumer; it feeds list-aware nodes or gets indexed afterward. Second, shuffling is order-only - the elements themselves are untouched, so anything that assumes a stable position (like "first element is always the base") will silently break the moment you shuffle. If you rely on element 0, don't shuffle.
The sweet spot is prompt variation without new typing: list a few style suffixes, shuffle them, then feed the shuffled list into indexing or iteration nodes to distribute styles across a batch. Pair it with Manual Choice String for "shuffled, then pick by index," and keep the seed fixed while debugging so a mystery change in ordering never masquerades as a prompt problem - the community's "change one variable at a time with a fixed seed" rule applies just as hard to list order.
It's part of the LogicUtil family - a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack from Daxton Caylor and Jerry Davos. The README documents the pack's file and latent batch nodes and never mentions this family, so the source is the reference for how the shuffle actually behaves.
Install
Install is the standard JDCN routine: ComfyUI Manager → "Install Custom Node" → search JDCN → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN
cd ComfyUI-JDCN && pip install -r requirements.txt
Only piexif on the requirements list, no models to fetch. And when a shuffle seems to "do nothing," check that you're not feeding it a single-element list - one element shuffles to one element, every time, no matter the seed.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | a$b$c | — |
| separator | STRING | $ | — |
| seed | INT | 00–9999999999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |