DP 5 Images Switch Or Batch
Route one of five images, or batch them all
- Image_01
- Image_02
- Image_03
- Image_04
- Image_05
- IMAGE
- CURRENT_INDEX
Five image slots, two modes. Either pass one image through by index (switch) or gather all the connected ones into a single batch (batch). It's the mid-size member of the Desert Pixel image-switch family, and five is usually the right amount - enough to juggle a handful of candidates or source images without the clutter of the ten-input node.
The pack it belongs to, DesertPixelAi's Desert-Pixel-Nodes, is a large collection of quality-of-life tools. Nothing here makes an image; these are routing and housekeeping nodes, the same category as rgthree's switches and muters. This one keeps your image plumbing tidy.
How it works
Two controls. mode flips between the behaviors, index selects the image in switch mode:
- Switch_Mode - output only the image at
index. Good for comparing five variations on a fixed seed, or choosing which of five inputs continues down the graph. - Batch_Mode - combine all connected images into one batch so the next node handles them together.
The image inputs are optional, so you wire only what you need and leave the rest empty. Batch_Mode simply batches whatever's connected.
The mode you want depends on whether the five images are rivals or teammates. Switch_Mode is for rivals - five candidates, and you pick the one that continues down the graph, or step through them on a fixed seed to compare. Batch_Mode is for teammates - five frames that belong together, headed for an upscale, a video assembler, or a batch save as a group. If you find yourself wishing you could do both at once, that's usually a sign the workflow wants two of these nodes, one in each mode.
The inputs and outputs that matter
mode-Switch_ModeorBatch_Mode.index- integer 1 to 5, used in Switch_Mode to selectImage_01throughImage_05.Image_01…Image_05- five optional IMAGE inputs.
Outputs: IMAGE (selected image or batch) and CURRENT_INDEX (integer). The index output reports which slot Switch_Mode chose - useful when you sweep index across the five to review them one at a time.
Need more or fewer? The 3-input and 10-input versions work identically with a different slot count.
How to install it
- ComfyUI Manager: search "Desert Pixel", install, restart. No downloads.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes,pip install -r requirements.txtif present, restart.
Find it under the DP category.
Common issues
Mismatched sizes are the thing to watch in Batch_Mode. ComfyUI batches expect matching width and height; feed it five differently-sized images and batching can error or misbehave. Run them through a resize to a common size first and it's fine.
In Switch_Mode, an index pointing at an empty slot has nothing to send downstream - if the output looks blank, that's usually the cause. And index is ignored in Batch_Mode, where all connected images pass through regardless.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | Switch_Mode | 2 options: Switch_Mode, Batch_Mode |
| index | INT | 11–5 | — |
| Image_01opt | IMAGE | — | |
| Image_02opt | IMAGE | — | |
| Image_03opt | IMAGE | — | |
| Image_04opt | IMAGE | — | |
| Image_05opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| CURRENT_INDEX | INT | — |