ComfyUI Node Runs on cloud

Depth Anything

The v1 depth node (and why you probably want v2)

By Fannovel16·Created 3 years ago·Updated 4 months ago· 4,134
Depth Anything
  • image
  • IMAGE
ckpt_namedepth_anything_vitl14.pth
resolution512

This is the original Depth Anything - v1 - wrapped as a ComfyUI node. Feed it an image, get a grayscale depth map (close is bright, far is dark) to drive a depth ControlNet. When it landed in 2024 it was a genuine step change in depth estimation, and this node was how the ComfyUI crowd got it the same week it dropped. It still produces perfectly usable depth maps. That said, if you're starting fresh today, the honest advice is to use the DepthAnythingV2Preprocessor node instead - v2 improved edge sharpness and handling of glass and reflective surfaces, and it's the current default. This node is here for compatibility and for workflows built around v1.

How it works

Depth Anything v1's breakthrough was training data: 62 million unlabeled internet images, pseudo-labeled by a bootstrapped model in a semi-supervised loop. That gave it far better generalization to unusual scenes than the MiDaS/Zoe generation it replaced - it could estimate sane depth on images earlier models had never seen anything like. It outputs relative depth (what's nearer than what), which - counterintuitively - is exactly what a ControlNet wants; metric depth models like Zoe are actually worse for conditioning because their softer edges are harder to follow.

The inputs and output

Two fields, one of which is a real choice:

  • ckpt_name (default depth_anything_vitl14.pth) - the model size. Large (vitl14) is the quality pick and the default. Base (vitb14) is a middle ground. Small (vits14) is fast enough for real-time and video-frame work - it's the one the community uses for live depth preview. Pick Large unless speed forces you down.
  • resolution (default 512) - working size; match it to your generation resolution (the PixelPerfectResolution node computes the ideal number).

The output is a single IMAGE - the depth map - which wires into a ControlNet Apply node with a depth ControlNet matched to your base checkpoint. The preprocessor makes the hint image; the depth ControlNet model is a separate download.

Installing it

ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or:

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

Restart ComfyUI. The chosen Depth Anything weight downloads from HuggingFace on first run, so the first execution pauses to fetch it. Note the v1 and v2 checkpoints are different files - running this node then switching to the v2 node means two separate downloads.

Where people get burned

First, the perennial one: the depth map does nothing on its own - you need a depth ControlNet loaded and this node's IMAGE wired into it, or you're just generating a pretty grayscale picture. Second, v1 versus v2 confusion: they're separate nodes with separate checkpoints, and it's easy to grab this one out of habit or from an old workflow. If your edges look a touch soft, or reflective/transparent surfaces read wrong, that's exactly the area v2 fixed - switch nodes. Third, standard depth-weight discipline: 0.4–0.7 loose, 0.8–1.1 strict, and end the ControlNet around half the steps to let the model finish detail on its own. If you inherited a working v1 workflow, there's no urgent reason to rip it out - but for anything new, reach for v2.

CategoryControlNet Preprocessors/Normal and Depth Estimators

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
ckpt_nameoptCOMBOdepth_anything_vitl14.pth3 options: depth_anything_vitl14.pth, depth_anything_vitb14.pth, depth_anything_vits14.pth
resolutionoptINT51264–16384

Outputs (1)

NameTypeDescription
IMAGEIMAGE