Nodes/ComfyUI-SmartImageTools/Smart Progressive Scale Image
ComfyUI Node

Smart Progressive Scale Image

A zoom ramp for your frame batch, complete with pan

By slvslvslv·Created about a year ago·Updated 24 days ago· 2
Smart Progressive Scale Image
  • images
  • IMAGE
start_scale1.00
end_scale1.00
scale_method
curve_exponent1.00
end_offset_x0
end_offset_y0

Smart Progressive Scale Image takes a batch of frames and scales each one by a different amount, ramping smoothly from a start scale to an end scale across the batch. If you've ever wanted an anime-style punch-in zoom where the camera creeps closer frame by frame, or a slow pull-back, this is the node. It's the "progressive" in the name - every frame in the sequence gets its own scale factor on a curve you control.

How it works

For each frame i in a batch of N, the node computes a progress value i / (N-1), applies your curve, and scales:

  • curved_progress = progress ** curve_exponent - exponent 1 is a linear ramp; lower values front-load the zoom (fast start, slow finish), higher values back-load it.
  • scale_factor = start_scale + (end_scale - start_scale) * curved_progress

Each frame is then resized with OpenCV (this is why the pack depends on opencv-python) using your scale_method choice: nearest, bilinear, bicubic, lanczos, or area. Lanczos is the usual pick for upscaling quality; nearest gives the crisp pixel-art look; area is a decent choice for downscaling.

The offsets are the surprise extra: end_offset_x and end_offset_y add a progressive pan. The first frame is offset 0 and the last frame slides by the full offset you set, ramping with the same curve. Frames land on a shared canvas (padded with black/zero), so the output batch stays one stackable tensor even though the frames are different sizes and positions.

Inputs: images (IMAGE batch), start_scale, end_scale, scale_method, curve_exponent, end_offset_x, end_offset_y. Output: one IMAGE batch.

Where it plugs in

The classic use is camera motion in frame-sequence work - feed it a batch of generated frames, ramp the zoom, then push the result through img2img or your video pipeline for a dolly-zoom effect without regenerating. It's also handy for making a quick "scale-in" animated GIF: ramp from 1 to ~1.3 across a dozen frames, then save with this pack's animated save node.

A few practical settings:

  • Zoom in: start 1.0, end 1.2, lanczos, exponent ~1.0–1.5.
  • Zoom out: start 1.2, end 1.0.
  • Pan across: start 1.0, end 1.0, and drive end_offset_x instead. You get a slide with no size change.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes/
git clone https://github.com/slvslvslv/ComfyUI-SmartImageTools
pip install -r ComfyUI-SmartImageTools/requirements.txt

Restart, or use ComfyUI Manager (search "ComfyUI-SmartImageTools"). Note the real requirements include opencv-python and numba alongside scikit-learn and scikit-image - the pack is heavier than its README advertises.

Gotchas

  • The output canvas is black where frames don't reach. Offsets or mixed sizes pad with zeros, so a pan across leaves black bars unless you composite the result over something or mask it.
  • Offset direction uses the pack's coordinate convention - double-check which way positive X/Y moves by testing one run before committing to a long batch.
  • end_offset_x/end_offset_y in pixels, not normalized. A 200px pan means nothing until you know your frame width.
  • Everything is float→uint8 round-tripped through OpenCV, so you lose a hair of precision per frame. Fine for preview and img2img; don't use it as a lossless intermediate.

It's a niche tool, but there's genuinely no built-in ComfyUI node that does this. If your workflow is frame-sequence camera moves, this is the ramp you'll reach for.

CategorySmartImageTools

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE
start_scaleFLOAT1.000.01–100
end_scaleFLOAT1.000.01–100
scale_methodCOMBO5 options: nearest, bilinear, bicubic, lanczos, area
curve_exponentFLOAT1.000.01–10
end_offset_xINT0-8192–8192
end_offset_yINT0-8192–8192

Outputs (1)

NameTypeDescription
IMAGEIMAGE