Nodes/IAMCCS-nodes/Image Resize Batch Safe (IAMCCS)
ComfyUI Node

Image Resize Batch Safe (IAMCCS)

KJ-style resize without the RAM spike at the end

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
Image Resize Batch Safe (IAMCCS)
  • image
  • mask
  • IMAGE
  • width
  • height
  • mask
width512
height512
upscale_method
keep_proportioncrop
pad_color0, 0, 0
crop_positioncenter
divisible_by2
devicecpu

The author's own description is the best review of this node: "Batch-safe IMAGE resize for IAMCCS workflows. Mirrors the KJ resize modes used in IAMCCS flows without the final concat RAM spike." If you've used Kijai's resize nodes - and in the video world, you basically have - you know the modes: stretch, pad, crop, pillarbox-blur, total-pixels. This node reimplements that family of behaviors but resizes the whole batch in one go instead of looping image-by-image and concatenating at the end, which is where those Kijai-style resizers blow up system RAM on long video batches.

So the pitch is simple: you get the resize modes you're used to, minus the memory cliff.

How it works

image in, width/height out (plus the resized IMAGE). The geometry controls mirror the KJ API:

  • upscale_method - nearest-exact, bilinear, area, bicubic, lanczos.
  • keep_proportion - the mode that decides how it fills the target box: stretch, resize, pad, pad_edge, pad_edge_pixel, crop, pillarbox_blur, or total_pixels. crop is the default, and it's what most video pipelines want - fill the frame, cut the overflow.
  • pad_color - "0, 0, 0" by default (RGB comma-separated), used by the pad modes.
  • crop_position - center/top/bottom/left/right, for when you don't want the center crop.
  • divisible_by - rounds output to a multiple (default 2, bump to 8/16 for latent-friendly sizes).

There's also an optional mask input that comes out the other side, resized to match - handy when you're resizing image + mask together and don't want them to drift. And device defaults to cpu, which is the right call: resizing a big batch on the GPU steals time and VRAM for zero benefit. Leave it unless you have a reason.

Outputs: IMAGE, width, height, and mask.

Why you'd reach for it

Any workflow that resizes long frame batches - LTX-2 segment prep, source-frame loading, feeding frames into a video pipeline at a fixed size. If you've ever watched ComfyUI sit there spinning on a 500-frame concat after a resize, you know exactly why "safe" is in the name.

Install

Part of IAMCCS-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

or ComfyUI Manager → search IAMCCS, then restart. No dependencies to add.

The honest take

If your batches are small (a handful of images), this buys you nothing over stock resizers. The moment your batch is hundreds of frames, though, the RAM behavior genuinely matters - this is one of those nodes you install for the long run and forget about until the day it saves you from a 10-minute stall.

CategoryIAMCCS/Utils

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
widthINT5120–16384
heightINT5120–16384
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
keep_proportionCOMBOcrop8 options: stretch, resize, pad, pad_edge, pad_edge_pixel, crop, +2
pad_colorSTRING0, 0, 0
crop_positionCOMBOcenter5 options: center, top, bottom, left, right
divisible_byINT20–512
maskoptMASK
deviceoptCOMBOcpu2 options: cpu, gpu

Outputs (4)

NameTypeDescription
IMAGEIMAGE
widthINT
heightINT
maskMASK