Image Batch Multi (Swwan)
Glue five separate images into one batch
- image_1
- image_2
- images
There's a specific moment in ComfyUI where you have four images on the canvas - different sizes, different sources, different branches - and everything downstream wants one IMAGE wire. Video Combine, frame interpolation, a batch upscaler, a LoRA-training dataset exporter: they all take a batch, not five wires. Image Batch Multi is the adapter.
It's also the least glamorous node in this pack, which is why it's worth understanding rather than clicking.
What it does
The info_schema is short. inputcount is an INT (default 2, range 2–1000, step 1). image_1 is the only required IMAGE. Everything from image_2 up to image_inputcount shows up as an optional input, and setting inputcount and clicking the update affordance is how you grow the node - the author's own description says exactly that.
One output: images.
Under the hood it's not doing anything clever. It instantiates ComfyUI's own core ImageBatch and folds your inputs through it one at a time, pulling everything to CPU first. That matters for one reason: the semantics of a tensor batch. Every image in it must be the same size - width, height, channels. The pack's own README states the rule plainly: list containers can hold mixed sizes, tensor batches cannot. If your inputs disagree, fix it upstream with a resize node rather than hoping.
Where people get burned
The default-substitution behavior. Each iteration does a dictionary lookup for the next input, and if that input isn't wired, it falls back to a zero tensor shaped like image_1. Zeros in ComfyUI's IMAGE convention are black, not "missing."
So raising inputcount from 2 to 5 without wiring 3, 4 and 5 doesn't skip them - it appends three black frames. You'll see it immediately in a Video Combine preview as a black flash, and if the batch feeds a training dataset export you've just shipped three black PNGs into it. Same story for channels: a 4-channel RGBA input followed by a 3-channel RGB one is a shape mismatch, not an automatic alpha fill. Image Concat Multi is a little more forgiving about channels; this node is not.
Second thing: the ordering is the order of the ports, and there's no sorting anywhere. Frame 1 in the batch is whatever is on image_1. Don't take that on faith - feed the batch into a video combine or a grid node and look at it once, because the order is the entire product here.
Installing it
Standard for the pack, and this node needs no models at all:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan.git
cd ComfyUI_Swwan
python -m pip install -r requirements.txt
On Windows portable, run the same requirements file with the embedded interpreter:
.\python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI_Swwan\requirements.txt
Restart ComfyUI, hard-refresh the browser, and search Swwan - it lands under Swwan/Advanced/Batch. requirements.txt pulls opencv-python, scipy and scikit-image; torch and torchvision come from your existing ComfyUI environment. There are no downloads, no checkpoints, no keys.
What to reach for instead
If you have one image and want it repeated, that's a different node entirely. If you have a list (different sizes) and need a batch, this is the wrong tool - convert sizes first. And if you're on a pre-1.0 version of this pack, be aware the pack renamed 56 node IDs in the 1.0.0 release and does not register conflicting aliases, so an old workflow can load with a red missing-node box. python scripts/migrate_workflow.py old.json --dry-run from the repo will show you what it wants to rewrite before you commit to anything.
Honestly, though: this node is fine. It does one thing, it does it in twenty lines, and it's the difference between a workflow that ends in five previews and one that ends in a video.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 22–1000 | — |
| image_1 | IMAGE | — | |
| image_2opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |