Nodes/WAS Node Suite v3/Image Batch Advanced
ComfyUI Node Runs on cloud

Image Batch Advanced

The image batching node that stops yelling at you about sizes

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Image Batch Advanced
  • images
  • images
  • count
enforce_aspect_ratiofalse
resize_method

The stock ComfyUI "Batch Image" node is a stickler: every image you feed it has to be exactly the same size, or the run dies with a terse error. Fine if you're batching four 1024×1024 stills. Annoying the moment you're mixing an upscaled frame with its original, or stitching clips that came off the sampler at slightly different resolutions. Image Batch Advanced is the version that doesn't care - it brings everything to one size first, then joins the batch.

It's from WAS Node Suite, the old MIT workhorse pack by WASasquatch that's been around since 2023 and now ships 457 nodes. This is one of the genuinely useful small ones, worth knowing even if you never touch the rest of the suite.

What it actually does

Under the hood, an image in ComfyUI is a float tensor shaped (batch, height, width, channels), and "batching" is just concatenating tensors along that first axis. The plain Image Batch node refuses when heights and widths disagree. This node fixes the disagreement before it concats.

Two inputs do all the work:

  • enforce_aspect_ratio - off by default, which means it refuses mismatched sizes exactly like the plain node. Flip it on and every image is brought to the size of the first connected slot.
  • resize_method - how that resizing happens. resize stretches everything to fit (distortion), crop keeps each image's shape and takes the middle, pad keeps the shape and fills the rest with black. Ignored while enforce_aspect_ratio is off.

The images input is the interesting bit: it's an autogrowing slot list, A through Z, and a new socket appears each time you fill one. An unconnected slot contributes nothing - no blank frame sneaking into your batch. A slot holding its own small batch contributes all its frames, which is how you'd merge the output of several video loads in one go.

What comes out

  • images - every connected image as one batch, in slot order, sized to match the first slot.
  • count - the total frame count across all slots, not the number of slots. Handy to wire into anything downstream that wants to know how many frames it's about to chew through.

When you'd actually reach for it

A batch is the cheapest way to run the same KSampler or the same filter across several images at once, and this node is what keeps that honest when the inputs don't match. The classic case: you've decoded a 17-frame video clip and a separate 2-frame head/tail, and you want one batch of 19 to sample as a unit. Or you're building a training/preview contact sheet from crops of differing aspect ratios. And in WAS Node Suite's own v3 world, it sits right next to the batch manipulation family - Repeat, Ends, Reverse, Split - that people use to massage clips up to the exact frame counts a video model wants.

Installing and gotchas

WAS Node Suite installs like any custom node: ComfyUI Manager, search "WAS Node Suite v3", or clone https://github.com/WASasquatch/was-node-suite-comfyui into ComfyUI/custom_nodes and restart. Needs ComfyUI 0.14.0+ and Python 3.10+. One genuinely nice thing about v3: it installs no Python packages anymore - no pip step, no OpenCV fight. (v2 was notorious for pinning dependencies like OpenCV and BLIP and breaking other packs' imports when ComfyUI updated; v3 does the pixel work on torch, on ComfyUI's own device.)

Where people get burned here: they leave enforce_aspect_ratio off, wire in mismatched images, and get refused. That's by design - the error message even tells you to use this node. And if you pick pad for something that'll be inpainted later, remember the padding is black, which a sampler will happily treat as content.

The other quiet gotcha: your batch is only as good as slot one. Everything gets fit to the first connected slot's size, so if slot A is an oddball 768×768 among 1024s, you just cropped or padded everyone else to match it. Check which slot is first when the result looks wrong.

CategoryWAS Suite/Image

Inputs (3)

NameTypeDefaultDescription
enforce_aspect_ratioBOOLEANfalseBring every image to the size of the first connected slot; BOOLEAN. Off, images of differing sizes are refused, which is what the plain Image Batch does.
resize_methodCOMBOHow an image is brought to size; COMBO. 'resize' stretches it, 'crop' keeps its shape and takes the middle, 'pad' keeps its shape and fills the rest with black. Ignored while enforce_aspect_ratio is off.
imagesCOMFY_AUTOGROW_V3The images to join, in slot order. The list grows as slots are filled, up to 26. An unconnected slot contributes nothing rather than a blank frame.

Outputs (2)

NameTypeDescription
imagesIMAGEEvery connected image as one batch, in slot order. A slot holding a batch contributes all of its frames.
countINTHow many frames the batch holds, which is the total across the slots rather than the number of slots.