Nodes/Deforum Nodes/(deforum) Depth Parameters
ComfyUI Node

(deforum) Depth Parameters

Depth warping that moves your camera through the scene

By XmYx·Created 3 years ago·Updated 3 months ago· 198
(deforum) Depth Parameters
  • deforum_data
  • deforum_data
use_depth_warpingtrue
depth_algorithm
midas_weight0.20
padding_mode
sampling_mode
save_depth_mapsfalse

Depth warping is the oldest trick in the Deforum book, and it's still the one that gets the "how did they do that?" reaction. The idea: estimate a depth map for the frame you just generated, project the image back along that depth, then nudge the camera. Zoom into a "far" region and the whole scene appears to recede around it - that's the signature Deforum dolly zoom, the shot that animated a million still paintings before AnimateDiff or Wan existed. This node is where you switch it on and choose the brain that computes the depth.

In the wider workflow it's one of the parameter blocks that feed the deforum_data dict - the same dict that Prompt, Base Parameters, and the DeforumKSampler read. You wire it into the chain before the sampler and its settings get baked into every frame of the animation loop.

What you actually set

  • use_depth_warping - the master switch. Leave it on; this whole node exists for it.
  • depth_algorithm - the estimator. The list runs Midas-3-Hybrid, Midas-3.1-BeitLarge, AdaBins, Leres, Zoe, and two "old" blends. Zoe and the MiDaS family are the ones people actually bounce between. Community folklore from the ControlNet era still holds here: MiDaS gives sharper edges and tends to warp more convincingly, while Zoe is metric-accurate but can look mushy where edges matter. If a depth pass looks wrong, swap the algorithm before you touch anything else.
  • midas_weight - blend weight (0–1, default 0.2) used when the backend combines a Midas model with AdaBins. Leave it alone until you're chasing a specific artifact.
  • padding_mode and sampling_mode - how the warped image fills the gaps the motion opens up. padding_mode is the one that matters: border smears the edges, reflection mirrors them, zeros leaves black fringe. If your depth warp shows black bars at the frame edges, this is your fix.
  • save_depth_maps - writes the depth maps to disk so you can inspect exactly what the estimator saw. Great for debugging a warpy mess, harmless to leave on for a short test.

It outputs a single deforum_data value - chain it into the next parameter node or the sampler and move on.

Installation

Deforum Nodes ships as one pack, and this node comes along with it:

cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git

Restart ComfyUI, or search "Deforum Nodes" by XmYx in ComfyUI Manager. Heads up: this is not a light install. On first start the pack force-installs the deforum[comfy] backend from the maintainer's fork of deforum-studio plus a pile of heavy packages (opencv-contrib, av, librosa, imageio-ffmpeg, moviepy, numpy<2.0), and the README insists on Python 3.10. Expect a long first boot and a slow first frame while the depth model files download.

Common issues

  • Black or smeared edges on the warp - check padding_mode first (reflection or border), then sampling_mode. This is the #1 depth-warp complaint.
  • First frame crawls - depth models (MiDaS, Zoe) download on first use via timm/gdown. It's a one-time cost.
  • The "old" algorithm options (Midas+AdaBins (old), Zoe+AdaBins (old)) exist for legacy workflow compatibility. If you're starting fresh, ignore them.

One honest note: depth warping is a 2022-era effect. It's still the fastest way to get that specific hallucinated-camera-move look, but if your goal is "a video with coherent motion," the KB's position stands - modern video models do that better. Use this node because you want the Deforum look, not because you want the most motion per second.

Categorydeforum/parameters

Inputs (7)

NameTypeDefaultDescription
use_depth_warpingBOOLEANtrue
depth_algorithmCOMBO7 options: Midas-3-Hybrid, Midas+AdaBins (old), Midas-3.1-BeitLarge, AdaBins, Leres, Zoe, +1
midas_weightFLOAT0.20
padding_modeCOMBO3 options: border, reflection, zeros
sampling_modeCOMBO3 options: bicubic, bilinear, nearest
save_depth_mapsBOOLEANfalse
deforum_dataoptdeforum_data

Outputs (1)

NameTypeDescription
deforum_datadeforum_data