Nodes/Sage Utils/Cubiq Image Resize
ComfyUI Node

Cubiq Image Resize

The ComfyUI_essentials resize, rehomed — with width/height handed back for metadata

By arcum42·Created 2 years ago·Updated 28 days ago· 33
Cubiq Image Resize
  • image
  • image
  • width
  • height
width1024
height1024
interpolationbicubic
methodkeep proportion
conditionalways
multiple_of0

If you've used ComfyUI_essentials - and half the ecosystem has - this node will look familiar, because it's the same Image Resize design that Cubiq's pack made popular, brought into Sage Utils. Cubiq Image Resize resizes an image with your choice of interpolation and resize method, and then does the thing Sage Utils cares about: it hands back the actual resulting width and height as outputs, ready to feed a metadata constructor or a resolution node downstream.

The inputs are the full toolbox, and it's worth mapping them because they're more powerful than a plain resize:

  • width / height (default 1024) - the target. The methods below interpret them differently.
  • interpolation - nearest, bilinear, bicubic, area, nearest-exact, lanczos, bislerp. For upscaling, lanczos and bicubic are the quality picks; nearest only when you want hard pixels.
  • method - stretch (distort to fill exactly), keep proportion (default; fit inside, no distortion), fill / crop (scale up to cover, then crop to target), pad (fit inside and pad the rest with black).
  • condition - always (default), or conditional variants: only resize if downscaling, only if upscaling, or only if the source area is bigger/smaller than target. Set to downscale if bigger and the node becomes a "never upscale" guard - genuinely useful so a 512px img2img source doesn't get blown up.
  • multiple_of (default 0) - snap dimensions to a multiple of this value. Set 8 or 64 to keep latents model-friendly.

The mechanism is straightforward resampling plus the packing/cropping math for each method, with multiple_of applied to the target before anything happens. Outputs are the resized image plus width and height ints - the actual numbers after method logic and rounding, which is exactly what you want when the metadata needs to record the real output size rather than the value you typed.

Why the Sage version rather than the original? Honest answer: if you already run ComfyUI_essentials, you don't need this node - use the one you've got. The reason Sage Utils ships its own copy is workflow self-containment: the pack's metadata pipeline wants the output dimensions on a wire, and the author decided his node set shouldn't depend on another pack for a routine operation. If you're building a full Sage Utils workflow from scratch, this keeps the dependency list short.

Install

ComfyUI Manager → search Sage Utils → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt

Restart ComfyUI. No models, no keys; only dynamicprompts as a dependency. Wire the width/height outputs into Construct Metadata Flexible to stamp the real output size into your PNG params.

CategorySage Utils/image/manipulation

Inputs (7)

NameTypeDefaultDescription
imageIMAGEThe image to resize.
widthINT10240–16384The target width.
heightINT10240–16384The target height.
interpolationCOMBObicubicThe interpolation method.
methodCOMBOkeep proportionThe resizing method.
conditionCOMBOalwaysThe condition for conditioned resizing.
multiple_ofINT00–1024Ensure dimensions are multiples of this value.

Outputs (3)

NameTypeDescription
imageIMAGEThe resized image.
widthINTThe new width.
heightINTThe new height.