ComfyUI Node Runs on cloud

ParallaxZoom

Turn a Flat Photo Into a Deforum-Style 3D Drift

By edenartlab·Created 3 years ago·Updated 6 months ago· 119
ParallaxZoom
  • masks
  • image_slices
  • frames
  • masks
foreground_zoom_factor1.100
background_zoom_factor1.050
pan_left0.100
n_frames25
loopfalse

That "2.5D" effect where a still photo slowly pushes in, foreground and background moving at different speeds - the cheap magic behind half of Deforum and AI music videos - is called depth parallax. ParallaxZoom is a focused little node that does exactly that, and only that: it takes a foreground/background split of your image and animates a zoom-and-pan between the two layers.

The name is a lie in one sense: there's no actual 3D geometry here. No depth map goes in. What goes in is the output of a depth slicer - specifically the sibling node DepthSlicer in the same pack, which cuts an image into depth-based layers. You hand ParallaxZoom two things:

  • image_slices - an IMAGE batch where slice [0] is the foreground and [1] is the background.
  • masks - the matching foreground mask (an IMAGE, not a MASK - the DepthSlicer family emits masks as images), which the node reads at [0].

The mechanism is plain OpenCV affine warps, one per frame. Each frame gets a progress value from 0 to 1, and the zoom/pan factors interpolate across it. Foreground zooms in (from foreground_zoom_factor, default 1.1), background zooms at its own rate (background_zoom_factor, default 1.05 - you can also go below 1 for a push-out), and pan_left (default 0.1, clamped -1 to 1) drifts the whole thing sideways. The author's own description is worth quoting: all of these values are the total fraction, relative to resolution, applied over the full animation - so they're cumulative across all frames, not per-frame. n_frames (default 25) is your animation length, and loop turns the linear ramp into a sine wave so the animation ends where it started, for seamless looping.

What comes out

  • frames - the IMAGE batch of animated frames. Feed it to a video encoder (VHS VideoCombine or the pack's MaskedRegionVideoExport) and you have a clip.
  • masks - the warped foreground masks for each frame, which you can reuse if you're compositing the animated foreground onto something else.

The foreground/background math is a standard alpha composite: warped foreground multiplied by warped mask, plus warped background times the inverse. The motion is simple - zoom + horizontal pan - but because foreground and background move at different rates, the brain reads it as depth. That's the whole trick, and it's why this is the pack's go-to for Deforum-style 3D zoom.

Installing it

Part of the Eden.art nodesuite. ComfyUI Manager → search "Eden" → install, or:

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

Restart, and it's under Eden 🌱/Depth. Requires the pack's shared opencv-python dependency for the affine warps.

Common issues

The pan is cumulative, so a pan_left of 0.1 across 25 frames means the frame visibly shifts sideways - if you just wanted a zoom, set it to 0, or you'll wonder why the image is sliding off. The bigger conceptual trap: the node is only as good as your depth slice. If the foreground mask from DepthSlicer has holes or the background slice includes foreground bits, you get smearing at the seams rather than parallax. Check the mask output before burning the render. And it's pure affine warp - no inpainting, so edges of the frame stay empty; pair it with an outpaint or a generous source image if you're pushing hard zooms.

CategoryEden 🌱/Depth

Inputs (7)

NameTypeDefaultDescription
masksIMAGE
image_slicesIMAGE
foreground_zoom_factorFLOAT1.100
background_zoom_factorFLOAT1.050
pan_leftFLOAT0.100-1–1
n_framesINT251–9223372036854776000
loopBOOLEANfalse

Outputs (2)

NameTypeDescription
framesIMAGE
masksIMAGE