Nodes/ComfyUI_LC123_nodes/LC Batch Image πŸ–ΌοΈ
ComfyUI Node

LC Batch Image πŸ–ΌοΈ

Stack 20 Images Into One Batch Without Fighting ComfyUI's Size Check

By lonecatone23Β·Created about a month agoΒ·Updated about 22 hours agoΒ· 12
LC Batch Image πŸ–ΌοΈ
  • 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.
  • image out - the single stacked IMAGE tensor, 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.
CategoryLC123/image

Inputs (20)

NameTypeDefaultDescription
image_01optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_02optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_03optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_04optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_05optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_06optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_07optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_08optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_09optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_10optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_11optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_12optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_13optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_14optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_15optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_16optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_17optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_18optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_19optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.
image_20optIMAGESkipped if disconnected, muted, or empty. Different sizes resize to the first live image.

Outputs (1)

NameTypeDescription
imageIMAGEβ€”