Nodes/ComfyUI-Inference-Core-Nodes/[Inference.Core] Depth Anything
ComfyUI Node

[Inference.Core] Depth Anything

The model that made every older depth preprocessor look outdated

By LykosAI·Created 2 years ago·Updated about a year ago· 33
[Inference.Core] Depth Anything
  • image
  • IMAGE
ckpt_namedepth_anything_vitl14.pth
resolution512

When Depth Anything landed in 2024, the community reaction wasn't polite interest, it was "now available on ComfyUI, compatible with CN" spreading within a week and everyone quietly switching their depth ControlNet pass over to it. The trick that made it good: instead of training on a small, carefully labeled dataset like older depth models, the team trained on 62 million unlabeled internet images using a self-teaching loop - label a small set precisely, use that to pseudo-label a huge unlabeled pool, repeat. The payoff is generalization: Depth Anything handles unusual scenes, weird angles, and out-of-distribution images noticeably better than MiDaS or ZoeDepth ever did.

How it works

This node runs the discriminative Depth Anything v1 backbone in one of three sizes, trading speed for detail. It reads the image, predicts a relative depth value per pixel, and renders that as a grayscale map - closer is lighter, farther is darker. One honest thing worth knowing: this is v1, not v2. Depth Anything v2 sharpened edges further and fixed a known v1 weak spot (transparent and reflective surfaces like glass and water). If you specifically need v2-level quality, that lives in a separate dedicated pack (Kijai's ComfyUI-DepthAnythingV2) rather than here - this node is the original, still solid, generation.

The inputs and outputs that matter

  • image - required, your source image.
  • ckpt_name - the checkpoint size: depth_anything_vitl14.pth (Large, default, best quality), vitb14.pth (Base, a middle ground), or vits14.pth (Small, fastest - fine for quick previews or real-time-ish use).
  • resolution (default 512) - working resolution.

One output: IMAGE, the depth map for your ControlNet Apply node.

How to install it

ComfyUI Manager: search ComfyUI-Inference-Core-Nodes, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes

then run install.py, or pip install -e .[cuda12] (or .[cuda] / .[rocm] / .[directml] / .[cpu]). Restart ComfyUI. Whichever ckpt_name you pick downloads from Hugging Face the first time you run the node - switching sizes later triggers a fresh download for that size.

Common issues & troubleshooting

If generation feels slow specifically at the preprocessing step, drop ckpt_name from Large to Base or Small - the quality difference is real but often not the bottleneck people assume it is, especially at typical 512-768 working resolutions. Save Large for final passes where the extra detail actually shows.

If you're chasing sharper edges or better handling of glass, water, or mirrored surfaces than this node gives you, that's the known v1 ceiling - this is the original Depth Anything, and the fix genuinely is v2, which lives in a separate pack rather than a setting here. And as with every depth node in this pack: the output is only a conditioning map, it needs a depth ControlNet model loaded downstream to actually influence your generation.

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–2048

Outputs (1)

NameTypeDescription
IMAGEIMAGE