Batch Images
The node that ends 'size mismatch' errors in your workflow
- images
Batch Images is the humble half of the Comfy Nano Banana pack, and honestly it might be the half that saves you the most time. It's a tiny utility: combine any number of images into a single batch, and if their sizes don't match, resize them to fit. That's the entire job - which is exactly the job ComfyUI's native batch nodes refuse to do for you, because the built-ins assume matching dimensions and throw a "shape mismatch" fit otherwise.
The pack's author built it after getting annoyed at batch-chaining in the default Gemini API template - the dynamic input trick where slots appear and disappear as you connect and disconnect was the part people actually noticed in the original thread. It's genuinely neat: add the node, plug in your first image, and new input slots appear. Unplug one and its slot vanishes. No dangling empty inputs cluttering your graph.
Where you'll actually use it
Two workflows make it shine. First, feeding multiple reference images into the pack's Nano Banana Gemini node - connect two or three photos into the images input and the whole pile goes up to the API as context. Second, stacking several same-sized outputs (a few img2img variants, a batch of upscales) into one images stream for a single Save node, instead of juggling four separate preview nodes.
How it works
The node declares zero inputs in its schema - all the wiring is frontend JavaScript that adds and removes IMAGE slots on the fly. At execution time it collects every connected image tensor, and here's the part that matters: it uses the first image you connected as the reference size, resizing everything else to match with bilinear scaling and centered alignment (via comfy.utils.common_upscale). Then it concatenates the lot along the batch dimension and hands you one tensor.
That means the order of your connections is a silent decision. Connect a 64px thumbnail first and every full-res image gets squashed down to it. Connect your largest, most important reference first, and the smaller ones get upscaled instead - bilinear upscaling, so don't expect magic, but it's honest resizing. If you somehow run it with nothing connected, it returns a tiny blank tensor rather than crashing your workflow, which is considerate of it.
Using it
Add the node from the image category, connect your first image (this sets the reference dimensions), then connect the rest in any order. Output is a single images batch that wires straight into any IMAGE input downstream.
Installing it
It ships in the same pack as the Gemini node, so there's no separate install:
cd ComfyUI/custom_nodes
git clone https://github.com/darkamenosa/comfy_nanobanana.git
cd comfy_nanobanana
pip install -r requirements.txt
Or just search "Nano Banana" in ComfyUI Manager and restart. Note this node doesn't need an API key at all - it's pure tensor plumbing.
Gotchas
- First image wins. Reorder connections if the output looks squashed.
- It grabs anything shaped like a tensor. The code collects every connected
torch.Tensor, so keep it fed from actualIMAGEoutputs. A mask or conditioning tensor wired in will ride along and break the concat in a confusing way. - Silent resizing. There's no warning when it downscales your 4K render to match a smaller neighbor. That's the feature, but it's a surprise the first time.
Keep it in your back pocket for any graph that mixes image sources. It's not an editor, it doesn't blend anything, but it's the boring utility that quietly unblocks the fun part.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |