image batch 图片批处理
ImageBatch with nine slots instead of two — batching without the extension pack
- image1
- image2
- image3
- image4
- image5
- image6
- image7
- image8
- image9
- image
ImageBatch9 (2lab) is what happens when someone uses core ComfyUI's ImageBatch node and thinks "I need more than two slots." Core ComfyUI has a batch node that takes exactly two images and stacks them into one tensor. This one takes up to nine - two required, seven optional - and pushes the whole stack out as a single batched IMAGE.
Why would you want that? Because a batch is how you do several images in one pass. Feed a batched image tensor into a sampler, a VAE, an upscaler, or a face-fix pass, and the operation runs across every item in the batch at once. It's the standard way to generate or process variations without running the graph nine separate times. Core ComfyUI technically lets you chain ImageBatch nodes (batch two, then batch the result with a third, and so on), but that's a tower of nodes that's easy to miswire and impossible to read at a glance. This collapses the whole thing into one node with numbered slots.
How it works
Required inputs:
- image1, image2 - the first two images.
Optional inputs:
- image3 through image9 - seven more image slots, each optional.
The image output is the concatenated batch tensor. Wire it into anything that accepts a batch - a KSampler for batch generation, a VAE Decode that outputs a grid, an upscaler that processes every frame.
The one gotcha that actually bites: batch concatenation requires all inputs to share the same dimensions. Different widths, heights, or channel counts and you'll hit a shape mismatch error - the node does not resize to make things fit. Core ImageBatch has the same constraint, so this isn't a defect, just physics. If you're batching images that started life at different sizes, run them through a resize node first so every slot matches.
Installing it
From AI2lab/comfyUI-tool-2lab. ComfyUI Manager → search comfyUI-tool-2lab → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/AI2lab/comfyUI-tool-2lab
Restart ComfyUI after. No models, no dependencies - this pack is a Chinese dev's grab-bag of small utilities (every node carries a 中文 label, the README is one word long). If you batch more than two images regularly, this is the no-fuss upgrade over chaining core batch nodes. If two is your ceiling, the core node already covers you and you can skip this one.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| image2 | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — | |
| image7opt | IMAGE | — | |
| image8opt | IMAGE | — | |
| image9opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |