Nodes/ComfyUI Depth Anything TensorRT/Depth Temporal Stabilizer GPU ⚡
ComfyUI Node

Depth Temporal Stabilizer GPU ⚡

Kill the flicker in your video depth maps — without optical flow

By yuvraj108c·Created 2 years ago·Updated 3 months ago· 134
Depth Temporal Stabilizer GPU ⚡
  • depths
  • depths
temporal_strength0.45
depth_consistency0.050
align_depth_rangetrue
alignment_strength0.70

Run any single-image depth model on a video frame by frame and you get depth maps that shimmer. Objects don't move smoothly in depth space - they jitter a few percent per frame, and the global depth range pulses up and down. That's just what frame-by-frame estimation does, and it's the classic reason the depth community says "use DepthCrafter for video."

But you don't always need a video-native model and its VRAM and resolution cost. This node is the cheap middle path: a fast CUDA temporal smoother that stabilizes raw video depth without any optical flow. It's the newest addition to the pack, and it sits exactly where the pack's README puts it - between the Advanced node and the Display node:

Depth Anything Tensorrt Advanced → Depth Temporal Stabilizer GPU → Depth Map Display

How it works

The mechanism is an exponential-moving-average style blend, but gated per pixel. For each frame, the node compares it to the previous stabilized frame and computes how much each pixel has changed, expressed relative to the frame's robust depth range. Pixels that barely moved are likely stable surfaces just suffering flicker - those inherit a strong chunk of depth from the previous frame. Pixels that moved a lot are likely real motion, occlusion, or an actual edge - those mostly keep the current prediction, so you don't smear objects.

There's a second stage for the "depth-range pulsing" problem: align_depth_range fits a scale and shift between the current frame's quantiles (q10, q50, q90) and the previous stabilized frame's, matching the global range before the per-pixel smoothing. That's the fix for depth maps that breathe - the whole scene's near/far values drifting frame to frame even when nothing moves.

Everything runs in one pass on the GPU with the whole sequence uploaded once, so it's fast even for hundreds of frames. The honest limitation, stated in the node's own description: without optical flow there's no motion compensation, so crank the smoothing too high and fast-moving objects or strong camera motion leave trails.

The inputs that matter

  • depths - raw DEPTHS from the Advanced node. The tooltip is blunt about this: do not feed it a visualised grayscale depth image. It'll reject the wrong shape anyway.
  • temporal_strength (default 0.45, max 0.95) - how strongly stable pixels inherit the previous frame. Higher = less flicker, more trailing. Start at the default; only raise it if you still see shimmer.
  • depth_consistency (default 0.05) - the threshold for "stable enough to smooth." Lower values protect motion and edges better; raising it smooths more aggressively but risks ghosting moving objects.
  • align_depth_range (default on) and alignment_strength (default 0.7) - the global range-alignment stage. The tooltip's advice is the good kind of shortcut: if you need more stabilization, bump alignment_strength before touching temporal_strength, because range alignment ghosts far less than aggressive temporal blending.

Output is depths (DEPTHS) again, so it chains straight into Depth Map Display or anything else that consumes the type.

Installing it

Same pack, same install - this node is part of the repository, not a separate download:

cd ComfyUI/custom_nodes
git clone https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt
cd ComfyUI-Depth-Anything-Tensorrt
pip install -r requirements.txt

No extra dependencies beyond the pack-wide tensorrt, opencv-python, polygraphy, huggingface_hub. The stabilizer itself needs a CUDA GPU - it raises a clear error if torch.cuda isn't available, which matches the whole pack being NVIDIA-only anyway.

Where people get burned

Feeding it the wrong thing is the top failure: visualised depth images in, weird output out. It expects raw float32 DEPTHS shaped [frames, height, width], full stop.

Then it's a tuning trap. This node can't fix genuinely bad per-frame depth - it can only smooth mild instability. If your video has strong camera motion, the per-pixel gating keeps edges sharp but temporal_strength much above ~0.6 will start trailing. When that happens, the fix isn't more smoothing, it's a motion-aware approach like DepthCrafter, or simply accepting the cost of the real video-native model. For mild flicker on mostly-static scenes - talking-head shots, parallax clips, backgrounds - this is a genuinely great fit, and it runs at the pack's TensorRT speed instead of DepthCrafter's slower per-frame cost.

Categorytensorrt

Inputs (5)

NameTypeDefaultDescription
depthsDEPTHSRaw DEPTHS output from Depth Anything Tensorrt Advanced. Do not use visualised grayscale depth images.
temporal_strengthFLOAT0.450–0.95How much stable pixels inherit depth from the previous stabilised frame. Higher reduces more flicker but can cause trails.
depth_consistencyFLOAT0.0500.001–0.5Only pixels with similar depth values are smoothed. Lower values better protect movement and edges.
align_depth_rangeBOOLEANtrueCorrect global frame-to-frame relative depth scale and offset pulsing before local temporal smoothing.
alignment_strengthFLOAT0.700–1How strongly global depth-range alignment is applied. This usually has less ghosting risk than increasing temporal strength.

Outputs (1)

NameTypeDescription
depthsDEPTHS