Nodes/ComfyUI-Apt_Preset/type_Image_List2Batch_adv
ComfyUI Node

type_Image_List2Batch_adv

Stack mismatched images after Crop, Pad or Stretch — your call

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
type_Image_List2Batch_adv
  • image_list
  • image_batch
  • new_image_list
modePad
alignmentCenter
width1024
height1024
background_colorblack

The plain type_Image_List2Batch makes the size decision for you (everything gets squished to match the first image). The "adv" version makes you decide. type_Image_List2Batch_adv takes a list of images, normalizes every one to an explicit target width/height using a mode you pick - Crop, Pad, or Stretch - then stacks them into a batch. When you're building a grid, a shot sheet, or any uniform-dimension output, this is the node that keeps the edges straight.

It's the advanced entry in ComfyUI-Apt_Preset's data/list|Batch drawer, and it exists for exactly the case the simple node glosses over: images of different shapes where "resize to first image" is the wrong answer.

How it works

For every image in the list, it resizes to width × height according to mode:

  • Stretch - forces every image to the target dimensions, warping aspect ratios. Fast, and usually ugly unless all inputs are already close to the target shape.
  • Crop - scales up until the image covers the target, then crops away the overflow. No empty space, no distortion - you lose edges. alignment (9-way: Top Left, Top, Center, etc.) decides which part survives the crop.
  • Pad (default) - scales down until the image fits inside the target, then centers it on a canvas filled with background_color (white, black, green, red, blue, gray). Nothing is lost, but you get letterbox bars.

Each processed image keeps its data (RGB; RGBA is trimmed to RGB, 1-channel is expanded), and the outputs are a concatenated image_batch plus a new_image_list - the same images as a list, if you need both forms.

Inputs and outputs

  • image_list - the list of images.
  • mode - Crop / Pad / Stretch.
  • alignment - 9-way placement, matters for Crop and Pad.
  • width, height - the target size (up to 8192).
  • background_color - Pad fill.
  • Outputs: image_batch (IMAGE) and new_image_list (IMAGE, list).

Installing it

Part of ComfyUI-Apt_Preset. ComfyUI Manager → search ComfyUI-Apt_Preset, or:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset

Restart; install.bat on Windows for the pack's requirements. Torch interpolation + canvas fill - nothing extra.

Common issues

The decisions are all yours, and they're the usual suspects: Stretch distorts (fine for storyboards, bad for faces); Crop eats content, so pick alignment deliberately or you'll wonder where the heads went; Pad introduces bars you then have to account for downstream. Empty input returns a black placeholder canvas rather than an error - a silent bug source if your list was supposed to have content. And it expects a list wire, like the rest of the family. Match mode to your actual use and this node is one of the more dependable things in the pack.

CategoryApt_Preset/data/list|Batch

Inputs (6)

NameTypeDefaultDescription
image_listIMAGE
modeCOMBOPad3 options: Crop, Pad, Stretch
alignmentCOMBOCenter9 options: Top Left, Top, Top Right, Left, Center, Right, +3
widthINT10241–8192
heightINT10241–8192
background_colorCOMBOblack6 options: white, black, green, red, blue, gray

Outputs (2)

NameTypeDescription
image_batchIMAGE
new_image_listIMAGE