Nodes/KJNodes for ComfyUI/Image Batch Multi
ComfyUI Node Runs on cloud

Image Batch Multi

Merge several images into one batch, add inputs on demand

By kijai·Created 3 years ago·Updated a day ago· 2,908
Image Batch Multi
  • image_1
  • image_2
  • images
inputcount2

Core ComfyUI has a Batch Images node that takes exactly two inputs. Need to combine five? You end up chaining four of them in an ugly little staircase. ImageBatchMulti kills that annoyance: it's one node with a dial for how many image inputs it has. Set it to 5, click update, and you've got five slots. Wire your images in and they all come out as a single batch. It's the "just let me combine a bunch of images already" node.

How it works

A batch in ComfyUI is multiple images stacked onto one wire so downstream nodes process them together. This node's trick is a dynamic input count - the number of input slots is itself a setting you control. Instead of a fixed shape, you grow the node to fit however many sources you're merging, which is why it scales from a couple of images up to a large collection without a chain of pairwise combines.

The inputs

  • inputcount - how many image inputs the node shows. Set the number, then click the node's update button to actually add or remove the slots. Defaults to 2, goes up to 1000.
  • image_1, image_2, ... - the image slots themselves. image_1 is required; the rest appear as you raise the count. Plug a separate image (or a smaller batch) into each.

The output is a single images batch containing everything you fed in, in order.

Where it fits

Anywhere you're assembling images from different places into one stream: stitching together outputs from separate generations, gathering reference frames, or building a sequence to feed into a video node or an upscaler that processes a batch. It pairs naturally with the pack's ImageConcatFromBatch - use this to build the batch, then that to tile it into a grid if you want to look at the result.

Installing KJNodes

ComfyUI Manager: open the Custom Nodes Manager, search "KJNodes for ComfyUI", install, restart. By hand: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), restart. Nothing to download.

Gotchas

The one thing new users miss: changing inputcount does nothing until you click update. The slots don't appear just from typing a number. If your extra inputs aren't showing up, that's why.

The other classic batch-node issue is size mismatch. To stack images into one batch tensor they generally need to share dimensions. If you feed in images of different resolutions and get an error, resize them to a common size first - the pack's own resize node is right there. And remember order matters: the images come out in slot order (image_1, image_2, ...), so if you're building a sequence, wire them in the order you want them to appear.

CategoryKJNodes/image

Inputs (3)

NameTypeDefaultDescription
inputcountINT22–1000
image_1IMAGE
image_2optIMAGE

Outputs (1)

NameTypeDescription
imagesIMAGE