Nodes/Runtime44 ComfyUI Nodes/Runtime44 Image Resizer
ComfyUI Node

Runtime44 Image Resizer

One dial, aspect ratio kept

By runtime44·Created 2 years ago·Updated 2 years ago· 42
Runtime44 Image Resizer
  • image
  • Image
max_resolution1024

Runtime44 Image Resizer is about as minimal as a node gets: one input image, one max_resolution dial, one output. It resizes the image to fit inside a square of that size while keeping the aspect ratio, using LANCZOS. The README is upfront that it's "usually better when downscaling" - and honestly, that's where it earns its keep.

The niche this fills: pre-processing before a generation pass. Feeding an oversized render into a VAE Encode for img2img wastes VRAM and can push the latent past what your model handles well. Downscaling to a sane input size first is the standard move, and this node makes it a single fixed setting instead of a per-image manual job. It's also the node you use to normalize a batch of mixed-size images before a consistent pipeline - same output resolution class every time, no stretching.

How it works

Under the hood it's PIL's ImageOps.contain: the image is scaled so the longer side hits max_resolution and the shorter side lands wherever the aspect ratio takes it. So with max_resolution at 1024, a 2048×1024 image comes out 1024×512, and a 1024×2048 portrait comes out 512×1024. No cropping, no stretching, no distortion. If the input is smaller than the box, it will scale it up to fit - "contain" doesn't refuse to upscale - so keep that in mind if you were assuming it only ever shrinks.

The inputs are image and max_resolution (256–4096, step 8, default 1024), and the output is a single Image. Since it's pixel-space, it slots in anywhere: before a VAE Encode, after a Decode, or as the head of an upscale chain.

When to reach for it

Two places this node shines in real workflows:

  • img2img / inpaint prep - downscale a large render before encoding so the latent stays in the model's comfortable resolution range. This is the "more pixels isn't always better" lesson from the upscaling playbook: feeding a 4K render into SDXL's latent at full size often buys you artifacts, not detail.
  • Consistent batch inputs - normalize a folder of mixed sizes to a uniform long side before a batch process that assumes a resolution class.

Where it's not the tool: if you need exact dimensions, this gives you "fits within," not "exactly W×H." And if your goal is more detail rather than fewer pixels, you want the pack's Upscaler node or a hi-res fix pass instead - this one only ever simplifies the image.

Installing

It ships in Runtime44 ComfyUI Nodes, under the default "sd" category (the pack doesn't give it a custom one):

cd ComfyUI/custom_nodes
git clone https://github.com/runtime44/comfyui_r44_nodes
cd comfyui_r44_nodes
python -m pip install -r requirements.txt   # or: uv pip install -r requirements.txt

Restart ComfyUI, or search "Runtime44" in ComfyUI Manager. It's plain PIL - none of the pack's CUDA heft is involved - though the shared requirements file will still install those wheels. The pack has been dormant since mid-2024, and that's entirely fine for a utility whose behavior you can verify by eye in one run.

Categorysd

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
max_resolutionINT1024256–4096

Outputs (1)

NameTypeDescription
ImageIMAGE