Shuffle Images List
Make training-style randomness reproducible
- images
- images
Shuffle Images List does one thing: randomize the order of the images in a list. That's the entire job description, and honestly it's a bit of a luxury to have it as a core node - but it exists because "shuffle a dataset before you do something with it" is a real, recurring step.
The most common reason you'll reach for it: you've loaded a folder of images and you don't want the order they happen to be in on disk. Maybe you're previewing a dataset before training a LoRA and want to see a mixed sampling of it. Maybe you're building a batch and want the order randomized so the graph doesn't always process the same first images. Whatever the case, this is the node.
How it works
The mechanism is honest: it computes a random permutation of the list indices and rearranges the images to match. Behind the scenes that's numpy - np.random.permutation(len(images)) with the seed set first - so the shuffle is seeded and reproducible.
That seed is the important part, and it's the thing people get wrong. The seed input (default 0) makes the shuffle deterministic: same seed, same list, same order out. That's what you want in ComfyUI, where "change one variable at a time with a fixed seed" is the debugging law. If you leave the seed at a fixed value, shuffling isn't really randomizing at all - it's just reordering to a fixed, seed-dependent order. If you want a new random order each run, you need to vary the seed (most people hook it up so it changes per queue).
The inputs that matter
- images - the list of
IMAGEs to shuffle. This is a list input, so feed it from a list-producing node (like a load-folder node). - seed (default 0, 0 to 2^64−1) - controls the shuffle order. Fixed seed = same order every run; changing seed = different order.
- Output: the same IMAGE list, reordered. Same images, no duplicates, nothing dropped.
When you'd reach for it
- Dataset sanity checks. Shuffle a folder of training images before eyeballing them, so you're not always looking at the first ten alphabetically.
- Breaking input bias. If some downstream process behaves differently on the first items of a list, shuffling keeps one image from hogging the privileged position every run.
- Building varied batches. Shuffle, then take a slice, and each run samples a different subset.
Common issues
- "It's not random." With the default seed of 0, it's perfectly deterministic - the same order every time. That's by design. Vary the seed for variety.
- Expecting it to deduplicate or drop. It doesn't. Every image comes out exactly once, just in a different order.
- Order-dependent downstream bugs. After a shuffle, anything that assumed a specific list order (like an image-text pairer) will silently mismatch. If you're pairing images with texts, use the pair-shuffle node instead.
That last point is the real trap. Shuffle Images List scrambles images only. If your workflow has a parallel list of captions or filenames that needs to stay in sync, shuffling the images alone breaks the pairing - use Shuffle Pairs of Image-Text (ShuffleImageTextDataset) which shuffles both lists with the same permutation.
Ships with ComfyUI core (it's part of the newer experimental dataset family, so if you don't see it, update ComfyUI). No models to load, nothing to install.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | List of images to process. | |
| seed | INT | 00–18446744073709550000 | Random seed. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | Processed images |