Nodes/ComfyUI-TextureAlchemy/Batch Images and Prep
ComfyUI Node

Batch Images and Prep

A Batch of Odd-Sized Images, Forced Into Step

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Batch Images and Prep
  • images
  • IMAGE
modescale_to_smallest
width512
height512
upscale_methodbilinear

ComfyUI's core "Batch Images" node is great until you feed it a 1024×1024 and a 512×768 and it refuses, because a batch needs a single shape. Batch Images and Prep is that node with the annoying part solved: it combines multiple images into a batch and normalizes them all to a common size first, via scaling or cropping. It's the "get my texture set into one tensor" node.

It sits at the base level of amtarr/ComfyUI-TextureAlchemy, and it's quietly essential for material work - you rarely have a whole set of maps at identical resolutions, and downstream nodes (blend modes, channel packing, PBR processing) all want uniform tensors.

How it works

This is one of the pack's newer nodes, built on ComfyUI's modern node API, so instead of a fixed number of inputs it uses an auto-grow input: you drag connections onto it and new image inputs appear, up to 50. Then a mode decides how to reconcile the sizes:

  • scale_to_custom - scale everything to your width/height (distorting aspect if needed).
  • crop_to_custom - scale to fit, then crop to your width/height (no distortion).
  • scale_to_smallest / scale_to_largest - pick the smallest or largest image in the batch and scale everything to match. The pack's default is scale_to_smallest, which guarantees no upscaling.
  • crop_to_smallest - scale down to the smallest, then crop to match exactly.

upscale_method sets the interpolation (bilinear is default).

Output is a single batched IMAGE tensor.

The inputs that matter

  • images - the auto-growing input; connect 2 to 50 images.
  • mode - how to normalize sizes (see above).
  • width / height - used by the two *_to_custom modes.
  • upscale_method - interpolation quality for scaling.

Where it slots in

Anywhere you'd use core Batch Images but your inputs are uneven: batch up a texture set's albedo/roughness/metallic/AO into one tensor for a node that wants a batch, or line up a row of tile variants for comparison. scale_to_smallest is the safe choice for extraction work because it never upscales and hallucinates detail.

Installing it

Part of TextureAlchemy:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

restart, and it's in the base Texture Alchemist category. ComfyUI Manager: search "Texture Alchemy". No extra pip deps.

Gotchas

The big one: this node uses the newer autogrow/IO API from ComfyUI core, so on an older ComfyUI install the node won't load (or the auto-growing inputs won't appear). If you see "AttributeError" about Autogrow or io.Schema on startup, update ComfyUI itself, not the pack. Also remember the default scale_to_smallest means a 1024 image paired with a 512 image loses resolution silently - that's the intent, but it's easy to forget why your batch came out at 512. And width/height are ignored unless you pick a *_to_custom mode, which trips people who set them and wonder why nothing changed.

CategoryTexture Alchemist

Inputs (5)

NameTypeDefaultDescription
imagesCOMFY_AUTOGROW_V3
modeCOMBOscale_to_smallestHow to normalize sizes: scale/crop to custom, smallest, or largest dimensions
widthINT5121–16384Target width (used for scale_to_custom and crop_to_custom)
heightINT5121–16384Target height (used for scale_to_custom and crop_to_custom)
upscale_methodCOMBObilinearInterpolation for scaling

Outputs (1)

NameTypeDescription
IMAGEIMAGE