Nodes/ComfyUI 1hewNodes/Multi Image Batch
ComfyUI Node

Multi Image Batch

Multi Image Batch unifies sizes for you

By 1hew·Created about a year ago·Updated 7 days ago· 33
Multi Image Batch
  • image_1
  • image
fitpad
pad_color1.0

ComfyUI will happily hand you an error the moment you try to batch together two images that aren't the same size. That's the whole problem Multi Image Batch solves: you plug in a bunch of images of wildly different dimensions and it returns one clean batch, all frames aligned to the first image's size. No pre-emptive resizing, no "batch must have uniform size" wall.

The mechanism is simple and honest. It sorts your image_1, image_2, ... inputs by number (so the order you see is the order you get), takes the first image's height and width as the target, and aligns every other frame with the fit you chose:

  • pad (default) - scales each image down to fit inside the target and letterboxes the rest with pad_color. Nothing gets cut.
  • crop - scales up so the target is filled, then center-crops. No bars, but you lose edges on mismatched frames.
  • stretch - distorts everything to the exact target. Only for when aspect ratio is a lie you're willing to tell.

It also does one smart thing most batch builders skip: if any input has an alpha channel, every image is promoted to RGBA before they're stacked, so you don't silently lose transparency on a compositing or overlay step downstream.

Inputs and output

The inputs are fit, pad_color (default "1.0" - white), and image_1. image_1 is required, and more image_2...image_N slots appear as you wire them in - the node reads all of them dynamically. Output is a single image batch tensor ready for a sampler, a batch-processor, or a save node. Empty inputs are skipped rather than turned into blank frames.

When you'd reach for it

Batch-oriented workflows are everywhere once you get past single-image generation - style transfer across a folder of reference shots, consistency runs, feeding a set of frames into a video-conditioning node. This node is the "make them all one tensor, right now" glue for those graphs. It pairs naturally with the pack's Image Batch Range / Image Batch Index if you then need to pull specific frames back out, and with Image Resize Square if you'd rather control the crop than let the pad color decide.

Installing it

Via ComfyUI Manager, search "ComfyUI 1hewNodes" and install, then restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Restart after either. The one thing to know going in: the whole pack shares a fat requirements.txt (opencv, scikit-image, rembg, ultralytics, ...) even though this node only needs numpy, Pillow and torch - the heavyweight stuff exists for the pack's detection nodes, and you pay for it at install time regardless.

Gotchas

Because the first image sets the target, input order matters - if image_1 happens to be an oddball size, everything conforms to it. And crop mode will quietly cut content from any frame whose aspect ratio differs, so for batch work where every frame counts, pad is the safer default. If you want to prevent the auto-RGBA promotion, there's no switch - it's deliberate, and it only kicks in when an actual alpha channel is present.

Category1hewNodes/multi

Inputs (3)

NameTypeDefaultDescription
fitCOMBOpad3 options: crop, pad, stretch
pad_colorSTRING1.0
image_1IMAGE

Outputs (1)

NameTypeDescription
imageIMAGE