Nodes/Dream Video Batches/πŸ”­ Linear Camera Zoom
ComfyUI Node

πŸ”­ Linear Camera Zoom

A Steady Zoom In or Out, Without Re-Rendering a Single Frame

By alt-key-projectΒ·Created 3 years agoΒ·Updated 7 months agoΒ· 95
πŸ”­ Linear Camera Zoom
  • frames
  • frames
β—„output_width512β–Ί
β—„output_height512β–Ί
β—„directionβ–Ύβ–Ί

Linear Camera Zoom [DVB] is the closest this pack gets to a dolly. It takes a FRAME_SET, crops a window that grows or shrinks at constant velocity across the frames, and resizes the result to your output size. The camera appears to push in or pull out on a scene that was generated once, at one size - and no second generation pass is involved.

The mechanism is refreshingly honest. Each frame's crop window is sized by interpolating between your output_width/output_height and the full input dimensions, based on where the frame sits in the index sequence. The direction enum picks the direction of travel: in starts wide and tightens down to the output crop by the last frame; out starts tight at the output size and widens back out to the full frame. Because it's a real crop, the edges of a zoom-in are cropped away - that's why the pack insists camera outputs are always smaller than inputs. You're trading resolution for the illusion of movement, and the trade is worth it.

What you actually set

  • frames - the FRAME_SET in.
  • output_width / output_height (both default 512) - the size of every output frame. This is also the size of the crop at the tight end of the zoom, so it sets how much the camera appears to move.
  • direction - in or out.

That's the whole interface. No speed, no easing, no focal-length knob. "Linear" is the point: the velocity is constant, which reads as a mechanical, locked-off push. If you want a breathing, organic zoom that eases at the ends, the Sine Camera Zoom [DVB] sibling is the one that oscillates instead.

Output is one frames - a FRAME_SET at your requested size, smaller than the input.

Installing

This is one of ~30 nodes in Dream Video Batches (Alt Key Project / Dream Project, a YouTube maker who builds these for AnimateDiff and Stable Video Diffusion production). Install once, use them all:

cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-video-batches.git
cd comfyui-dream-video-batches
pip install -r requirements.txt

Or search "Dream Video Batches" in ComfyUI Manager and restart. No models, no downloads beyond the pack's pure-Python dependencies (imageio, scipy, numpy, torchvision and friends).

Where people get burned

The predictable trap: asking for an output the same size as your input. A zoom needs headroom - the crop window shrinks toward output_width Γ— output_height, and if that window is already the full frame, the "zoom in" has nowhere to go and the move is invisible. Give yourself a real gap between input and output resolution or the whole effect vanishes. Same for the direction you pick: zooming in on a 512 crop from a 512 frame is a static image with extra steps. And when you're done, don't forget the pack's exit rule - a FRAME_SET output won't plug straight into Save Video. Run it through Unwrap Frame Set [DVB] first, then to Create Video and out.

Category🎭 DVB/πŸŽ₯ camera

Inputs (4)

NameTypeDefaultDescription
framesFRAME_SETβ€”
output_widthINT512β€”
output_heightINT512β€”
directionCOMBO2 options: in, out

Outputs (1)

NameTypeDescription
framesFRAME_SETβ€”