Nodes/Tojioo Passthrough/Any Image Batch Switch
ComfyUI Node

Any Image Batch Switch

Batch multiple images in one go, no manual re-wiring

By Tojioo·Created 11 months ago·Updated 7 months ago· 13
Any Image Batch Switch
  • image_1
  • images

Any Image Batch Switch combines several IMAGE inputs into a single batch and sends the result to the images output. Wire in one image and it passes through untouched; wire in several and they get stacked into one batch that downstream nodes process in a single pass. If you've ever wanted to feed a sampler a handful of images at once - several img2img inputs, a contact sheet's worth of source frames - this is the tidy way to do it.

It shares the pack's switch family, but it's a different animal from the single-select switches. Those pick one input; this one merges. That makes it one of the genuinely useful batch utilities, and it fits the "batch switch" niche you won't find in core ComfyUI.

How it works

The node starts with image_1 and grows a new slot each time you wire another image source. With a single connected input it returns that image unchanged - no surprise batch dimension. With multiple inputs, each is prepared (a single 3D image gets a batch dimension) and the images are concatenated along the batch axis when their shapes are compatible. The catch, and it's the important one: images must share the same spatial size, and the node only concatenates the largest group of matching shapes. Feed it a 1024×1024 and a 512×512 and it batches the matching ones, silently dropping the odd one out.

Where you'd use it

  • Batch img2img. Several source images into one sampler pass.
  • Frame processing. Multiple frames or crops that share a resolution, one encode/sample/decode chain.
  • Single-input passthrough. It doubles as an image passthrough when only one source is wired.

Install

ComfyUI Manager → search "Tojioo Passthrough" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Tojioo/tojioo_passthrough.git

Restart ComfyUI. No models, no pip dependencies - the pack is Python plus a bundled frontend, on the Comfy Registry under publisher tojioo.

Common issues

The shape mismatch is the trap, and it's silent. Different resolutions don't error - the node just batches the largest same-size group and drops the rest, which is how you end up with a "missing" image you never asked to lose. If a batch looks short, check that every input is the same resolution. Also note it concatenates along the batch axis, so if downstream nodes expect a single image, wire just one input and it'll behave like a passthrough.

CategoryTojioo Passthrough/Dynamic Nodes/Batch Switch Nodes

Inputs (1)

NameTypeDefaultDescription
image_1optIMAGE

Outputs (1)

NameTypeDescription
imagesIMAGE