Images Cat
Glue two image batches together — Images Cat concatenates along the batch axis
- images
- images_cat
- images
You've got two batches of images - frames from two video loaders, results from two generation paths, a folder batch and a single image you want to append - and you need them treated as one batch so a single downstream node processes them together. Images Cat is the junction: it takes two image batches and concatenates them into one.
The mechanism is one line of PyTorch, visible in the source: torch.cat((images, images_cat), dim=0). That's a concatenation along dimension zero, which in ComfyUI's [B, H, W, C] tensor layout is the batch dimension. So batch one's frames come first, batch two's frames follow, and the result is a single tensor with len(a) + len(b) frames. No resizing, no blending, no pixel math - pure batching.
The inputs:
- images - the first batch.
- images_cat - the second batch, appended after the first.
The output:
- images - the concatenated batch.
Now the gotcha, and it's the one that bites everyone eventually: torch.cat requires that all dimensions except the concatenated one match. That means both input batches must share the same height, width, and channel count. Concatenate a batch of 1024×1024 images with a batch of 512×512 images and you'll get a runtime error, not a sensible result. Same if one batch is RGBA and the other is RGB. Upscale or crop your batches to matching shapes first - the pack's Resize Image node or a shape-aware resize is your friend there - and this node will never complain.
Where it fits: it's batch plumbing, pure and simple. Merge the output of two directory loaders so one batch-processing node handles all frames; append a single generated image (as a one-frame batch) to a longer sequence before saving or upscaling. The KB's node-plumbing doc puts nodes like this in the "repetition and illegibility" fight - here it's the repetition fight: one downstream consumer instead of two parallel copies of the same processing.
One detail worth noting: the two inputs are symmetric in practice but not in the node's bookkeeping - the first input is images and the second is images_cat, and both land in the same images output. Order is preserved, so if you concatenate in the wrong order you can just swap the wires.
Install is the standard pack path: ComfyUI Manager → search ComfyUI-FairLab → install → restart:
cd ComfyUI/custom_nodes
git clone https://github.com/yanhuifair/ComfyUI-FairLab.git
cd ComfyUI-FairLab
pip install -r requirements.txt
Restart, search "Images Cat" or "concat images". No models, no dependencies beyond PyTorch - which ComfyUI already gives you.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| images_cat | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |