ComfyUI Node

EvenImageResizer

Odd dimensions crash your VAE. This node fixes that with a one-pixel crop.

By stormcenter·Created 2 years ago·Updated 2 years ago· 47
EvenImageResizer
  • image
  • IMAGE

The name is a small lie. EvenImageResizer doesn't resize anything - it trims. Feed it an image and it crops one pixel off any odd width or height so both land on even numbers, then hands the tensor right back. That's the whole job, and it's worth having.

Why you'd reach for it

Odd-sized images are a classic ComfyUI footgun. Latent math and most VAEs expect even dimensions; feed a 1025×1025 image into VAEEncode and you get errors or an off-by-one latent that comes back to bite you later. It's a tiny utility that ships in the stormcenter/ComfyUI-AutoSplitGridImage pack, and it exists because the pack's GridImageSplitter node trims black/white borders off split cells, which can leave them at odd sizes. If you're using that splitter, this is the natural next hop before any encode step.

How it works

Boring in the best way. It checks height % 2 and width % 2, subtracts the remainder, and returns image[:, :new_height, :new_width] - a straight crop, no scaling, no interpolation, no imagination. If the image is already even, it returns the tensor untouched. A 1025×1025 becomes 1022×1022; the loss is one hairline of edge content on each odd side, which is invisible in practice.

The API

One input, one output:

  • image in (IMAGE), image out (IMAGE).

That's it. No row counts, no method dropdowns, no surprises. It also works fine on a batch, so you can shove the whole output of GridImageSplitter through it in one go.

Install

Same as the rest of the pack - ComfyUI Manager, searching "AutoSplitGridImage", or:

cd ComfyUI/custom_nodes
git clone https://github.com/stormcenter/ComfyUI-AutoSplitGridImage

Then restart ComfyUI. It needs nothing beyond numpy and torch, which you already have, so there's no heavy dependency and no model download to worry about.

The one honest caveat

It trims instead of scales, so you lose a pixel rather than gaining one. If you'd rather upscale to an even size (or you're dealing with something bigger than a 1px mismatch), ImageScaleToTotalPixels and friends are the fancier options. But when you just need a zero-thought "make this even" node to stick before a VAE, this is it - one input, one output, does exactly what it says.

Categoryimage/processing

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE