Nodes/comfyUI-tool-2lab/image batch 图片批处理
ComfyUI Node

image batch 图片批处理

ImageBatch with nine slots instead of two — batching without the extension pack

By AI2lab·Created 2 years ago·Updated 2 years ago· 23
image batch 图片批处理
  • 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.

Category🦊2lab/util/batch

Inputs (9)

NameTypeDefaultDescription
image1IMAGE
image2IMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
image6optIMAGE
image7optIMAGE
image8optIMAGE
image9optIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE