Nodes/ComfyUI-TinyBee/Randomize Image Batch
ComfyUI Node

Randomize Image Batch

Shuffle your frames right on the wire

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Randomize Image Batch
  • image_batch
  • randomized_image_batch
seed0

Randomize Image Batch does exactly one thing: it takes the images in a batch and shuffles their order. Not the pixels, not the generation - just the sequence, reordered by a seed you control. It sounds too simple to be useful until you hit one of the situations where order genuinely matters.

The classic case is dataset work. You've loaded a folder of reference images into a batch and you want them presented in random order each run - for training, for sampling, for A/B comparisons - without rebuilding the list. Or you're making an animation and the frames came out in a predictable pattern you want broken up. Or you want to verify that a downstream node handles any batch order, not just the one it was born with. Shuffle-on-the-wire is the clean way to do all of it.

How it works

Mechanically it's straightforward: the node builds a list of indices for the batch, seeds Python's random with your seed value, shuffles those indices, and reindexes the batch tensor. The image data itself is untouched - same pixels, same count, new order. The batch comes in [B, H, W, C] and comes back the same shape.

The two inputs that matter:

  • image_batch (IMAGE) - the batch to shuffle.
  • seed (INT, default 0) - set the order. Keep it fixed and the same batch always shuffles the same way; change it and you get a different arrangement. If you leave it at 0 and forget about it, every run gives the same "random" order - so if you want variety, change the seed.

The single output is randomized_image_batch, the reordered batch, which feeds right back into whatever consumes the original.

Installing it

Randomize Image Batch ships in ComfyUI-TinyBee, a small MIT-licensed utility pack with no model downloads. Easiest via Manager:

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

Or clone:

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

Restart and find it under 🐝TinyBee/Images. No extra dependencies to worry about - the pack's jsonata requirement is only for its JSON Parser node.

Gotchas

The one trap is the seed default. Because it's 0, a workflow that "randomizes" will produce the exact same shuffle every queue unless you actively rotate the seed. Pair it with the pack's Auto Seed node and you get a genuinely different order each run. Also remember the batch count is preserved - this node never drops or duplicates images, it just rearranges them. If you need a subset or a repeat, that's a different node entirely.

Category🐝TinyBee/Images

Inputs (2)

NameTypeDefaultDescription
image_batchIMAGE
seedINT00–18446744073709550000

Outputs (1)

NameTypeDescription
randomized_image_batchIMAGE