Nodes/camera-comfyUI/DepthEstimatorNode
ComfyUI Node

DepthEstimatorNode

The metric-depth engine at the heart of camera-comfyUI

By Alexankharin·Created about a year ago·Updated about a month ago· 36
DepthEstimatorNode
  • image
  • depth tensor
model_nameDepth-Anything-V2-Metric-Indoor-Base-hf
depth_scale1.00
median_blur_kernel1

Almost every 3D pipeline in this pack starts with this node. DepthEstimatorNode takes a flat image and produces a metric depth map - real distances, not just "which pixel is closer than which" - and that map is what lets DepthToPointCloud, the fisheye pipeline, and the whole video-to-4D chain lift your 2D image into actual geometry.

This is where the pack leans on Depth Anything V2, and it's a smart choice. The depth-estimation knowledge base is unusually settled: Depth Anything V2 has been the community default since 2024, and the metric variants this node uses are the ones that output physically meaningful units rather than the normalized maps you'd feed a ControlNet. There's a real difference between "depth as a conditioning signal" and "depth as geometry," and this node is firmly on the geometry side.

How it works

Under the hood it's a Hugging Face pipeline running a Depth Anything V2 metric checkpoint, cached per model so you don't reload weights every queue run. The model_name dropdown picks the checkpoint, and the defaults are telling: Depth-Anything-V2-Metric-Indoor-Base-hf first, then Small, then Large, then the Outdoor variants. The family split is: Indoor models are trained on NYU-style scenes and are your default for rooms and spaces; Outdoor models are KITTI-trained and handle street/driving scenes far better. Size is the usual trade - Small is fast, Base is the balance, Large is the quality ceiling (and the Giant variant isn't offered here, so you're not staring down a 1.3B-parameter download unless you want to).

The depth_scale (default 1.0) is a straight multiplier on the output values - mostly useful for correcting unit conventions between the model's native scale and your downstream tools. median_blur_kernel (default 1 = off) applies a median blur to the depth map, which is a cheap way to scrub the speckle noise these models leave on surfaces; set it to an odd value like 5 when you're about to lift to a point cloud and don't want salt-and-pepper dots in your geometry.

The output is a single depth tensor (TENSOR), float, shaped (B,H,W,1).

The one gotcha that matters

The pack's depth outputs are Z-depth - the distance along the camera's viewing axis - not ray depth (true distance to the point). The difference is invisible in a normal FOV and very visible at fisheye/180° widths: geometry built straight from Z-depth bows outward at the edges. The pack's own README is blunt about it: insert ZDepthToRayDepthNode between this node and any point-cloud or splat-lifting node, or your wide-FOV scenes come out curved.

Install

Standard camera-comfyUI install: ComfyUI Manager → search "camera-comfyUI" → Install, or clone https://github.com/Alexankharin/camera-comfyUI into custom_nodes/ and run python install.py. The transformers dependency comes with the pack; the Depth Anything V2 weights download automatically from Hugging Face on first run (a few hundred MB for Base - no manual step, just a first-run wait). If you're behind a proxy or HF is unreachable, pre-download the model with huggingface-cli download once and it'll be cached for all six variants.

Troubleshooting

  • Depth looks like posterized bands: normal for metric models on flat surfaces; the median blur is your friend here, and so is a higher-resolution pass on the input.
  • Geometry bows at wide angles: you skipped ZDepthToRayDepthNode. Go read the gotcha above. This is the #1 source of "why is my fisheye point cloud curved" posts.
  • VRAM blips: the Base model is modest, but Large plus a big batch will strain an 8 GB card. Use Small for previews.
  • Indoor scene estimated with Outdoor model: results are mushy - switch the family to match your footage.
CategoryCamera/Depth

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
model_nameSTRINGDepth-Anything-V2-Metric-Indoor-Base-hf
depth_scaleFLOAT1.000–100
median_blur_kernelINT11–99Odd kernel size for depth median blur

Outputs (1)

NameTypeDescription
depth tensorTENSOR