Nodes/Skoogeer-Noise/Reorder List
ComfyUI Node

Reorder List

Because Your Prompt Batch Is Begging to Be Shuffled

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Reorder List
  • list_items
  • list_items
modeshuffle
seed0

If you've used Skoogeer-Noise's mustache templating, you know its output is a list of rendered prompts - and lists, it turns out, need reordering. Reorder List is the pack's generic utility for that: it takes any list-valued socket and either reverses it or applies a seeded shuffle, preserving the item type. It's a two-knob node with one job, and it does it well.

The reason you care is batch order. When Mustache Template expands {{haircolor}} into six prompts, they come out in a fixed Cartesian order. That's fine for iteration, but it means adjacent prompts always share structure, and if you're rendering frames or animation loops you often want a random-looking order that's still deterministic - a shuffle with a fixed seed gives you that. The same node works on any list, not just strings: MUSTACHE_VARIABLE_LIST, image lists, whatever you've got, because it never cares what the items are.

How it works

The node is list-aware (INPUT_IS_LIST), so it sees the full batch rather than one item. In shuffle mode it uses Python's random.Random(seed) to produce a seeded permutation - same seed, same order, every run. In reverse mode it just flips the list and ignores the seed entirely. There's no hidden magic and no re-sampling: the output is always a reordering of exactly the items you put in.

The inputs that matter

  • list_items - the list-valued socket to reorder.
  • mode - shuffle (seeded random permutation) or reverse (flip the order).
  • seed - only used in shuffle mode. Keep it fixed for reproducibility; change it to get a different order.

Output is list_items again, same type, same length, new order.

Installing it

Part of Skoogeer-Noise. Manager → search "Skoogeer-Noise", or:

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise

Restart ComfyUI. Deps are torch, numpy>=1.26, einops, pyyaml>=6.0.3 - all standard, no model downloads.

Common gotchas

The one thing that trips people: it expects a list-valued input, so if you connect a scalar, you get a one-item list back - effectively a no-op that changes the socket type. If your intent was shuffling the items within each rendered prompt, that's not this node; that's a different tool entirely. And remember the shuffle is deterministic per seed - if you're not seeing "random" variety, that's correct behavior, not a bug. Bump the seed.

Categoryutils/list

Inputs (3)

NameTypeDefaultDescription
list_items*List-valued input to reorder. The node preserves the item type and returns a reordered list.
modeCOMBOshuffleReordering strategy. 'shuffle' applies a seeded random permutation. 'reverse' flips the list order.
seedINT00–1844674407370955000064-bit seed used when mode is shuffle. The same seed yields the same permutation.

Outputs (1)

NameTypeDescription
list_items*