LC Batch Image πΌοΈ
Stack 20 Images Into One Batch Without Fighting ComfyUI's Size Check
- image_01
- image_02
- image_03
- image_04
- image_05
- image_06
- image_07
- image_08
- image_09
- image_10
- image_11
- image_12
- image_13
- image_14
- image_15
- image_16
- image_17
- image_18
- image_19
- image_20
- image
ComfyUI ships a core ImageBatch node, and if you've ever fed it two images that weren't pixel-identical in size, you've seen it throw its hands up. "These are different dimensions - do your own resizing." LC Batch Image πΌοΈ is the author's answer to that: up to 20 image inputs, one batched IMAGE out, and it quietly fixes the size mismatches itself. It's from the LC123 pack ("small tools that remove friction"), and it's the node you reach for when a pipeline needs to chew through several images in a single run instead of one queue pass per image.
The trick it unlocks is batching. In ComfyUI an image is a [B, H, W, C] tensor, and lots of downstream work - a detailer, a face fix, an upscaler, even plain Save Image (which writes each frame of a batch as its own _00001_-style file) - happily operates on a whole batch at once. Stack your four reference shots with this node and the pipeline runs once over all of them instead of four times.
How it works
The backend walks every slot from image_01 to image_20 and collects the ones that are actually alive. A disconnected slot, a muted upstream branch, or an empty tensor is silently skipped - the node doesn't fail because one wire went cold. Whatever survives gets torch.cat-ed along the batch dimension, but not before every image is aligned to a single reference.
The reference is the first live image. Later slots that differ in width or height are bilinearly resized to match it, and channel counts are reconciled too - a grayscale input gets repeated out to RGB, an RGBA one drops its alpha, whichever the reference needs. Inputs can even arrive as a list and get flattened into the batch. If every slot is empty or muted, it raises a clean ValueError telling you so.
That "resize to the first live image" is the behavior to actually think about, because it makes slot order matter. Put your largest or most authoritative image in image_01; everything after it conforms. Put a thumbnail first and a 4K render second, and the 4K gets shrunk before it ever reaches your pipeline.
The inputs and outputs that matter
Only two things to know here:
- The image slots (
image_01β¦image_20) - optional, autogrow. The node keeps at least two and adds one whenever you connect a wire, capping at twenty. Connect in the order you want to batch. imageout - the single stackedIMAGEtensor, sized to your first slot. Wire it anywhere that accepts an image batch.
Installing it
Install the whole pack - there's no standalone version of this node.
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
Then restart ComfyUI; the console should print [LC123] total 94 nodes. ComfyUI Manager works too - search "ComfyUI_LC123_nodes". No extra pip packages: it only needs the torch/numpy that ship with ComfyUI. Hard-refresh the browser afterward. One layout trap from the README: __init__.py must sit directly in custom_nodes/ComfyUI_LC123_nodes/ - if you unzip the pack inside an existing clone and get a nested folder, move the files up a level.
Where people get burned
- Order really is the size master. This is the one genuine gotcha. If you want everything at the biggest input's resolution, that biggest image goes in slot one.
- Resizing is bilinear, not lossless. If you need exact control over how images are scaled before they batch, resize upstream (the pack's own Dimension Resize is right there in the same menu).
- All-muted error. Leave everything disconnected or mute the whole upstream and you get "no images received." Wire at least one live slot.
- Mute vs bypass. A muted slot is skipped, but a bypassed node that still outputs an image is kept. Want a slot excluded without deleting the wire? Mute upstream, don't bypass it.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| image_01opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_02opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_03opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_04opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_05opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_06opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_07opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_08opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_09opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_10opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_11opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_12opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_13opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_14opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_15opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_16opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_17opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_18opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_19opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. | |
| image_20opt | IMAGE | Skipped if disconnected, muted, or empty. Different sizes resize to the first live image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |