Depth Anything
Depth Anything in One Node, With No Second Pack to Install
- image
- depth
Depth Anything has been the default depth preprocessor in this ecosystem since 2024 and nothing has seriously dislodged it - V2 Large is still what you reach for, and V2 Small is the one that's actually licensable. This node wraps both the V2 Small checkpoint and, optionally, ComfyUI core's Depth Anything 3 models, so you get a ControlNet depth hint without installing a separate preprocessor pack.
What you get
One IMAGE in, one depth out - grayscale in all three channels, near = white, far = black. That's the convention ControlNet depth models expect, so you can wire it straight into Apply ControlNet with no invert step. That convention is not universal across preprocessors, and getting it backwards produces generations that look like the depth is doing weird inverted things; this one is correct out of the box.
Values are relative and normalised per frame, min to max. For conditioning that's exactly what you want - you're telling the model about arrangement, not metric distance.
The inputs that matter
image- the frames to read.resolution- default 518, and 518 is not arbitrary: it's the size V2 was trained at. This is the short side the model sees, rounded to a multiple of 14 (V2's patch size), and it's also the short side of the output depth map when you don't connectwidth/height. Higher resolution gives finer edges and costs memory and time.model- defaultv2-small. The options arev2-small,v3-small,v3-base,v3-mono-large,v3-metric-large.width/height- integer inputs, both or neither. Connect them and the depth map comes out at exactly that size: the frame is covered with its aspect kept and centre-cropped, the same way core's ControlNet cuts a hint. This is the one to use when you want the hint at your latent's pixel size.
v2-small is the pack's own implementation: the DPT head and a DINOv2 ViT-S backbone vendored as a plain nn.Module, no transformers, no xFormers, attention through torch's scaled dot-product attention. The weights (depth_anything_v2_vits.pth, about 99 MB) land in ComfyUI/models/depthanything/ on the node's first run - never at import - and stay loaded. The v3 options hand off to ComfyUI core's Depth Anything 3 support, which is why they need a reasonably current ComfyUI; on an older build the node tells you to update core or pick v2-small. Their weights go to models/geometry_estimation/, the same folder core's own DA3 loader reads.
The licensing bit people miss
Only V2 Small is Apache-2.0. V2 Base, Large and Giant are CC-BY-NC. So is DA3-Large, DA3-Giant and DA3Nested - the node simply doesn't offer them. Everything it does offer is Apache-2.0. That's a real consideration if you're doing anything commercial and a nonissue if you're not. And yes, it feels backwards that the "Small" checkpoint is the permissive one; that's the license, not the node.
Install
Manager, searching ComfyUI-BCNodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/0xBeycan/ComfyUI-BCNodes
pip install -r ComfyUI-BCNodes/requirements.txt
Restart, then search BCNodes in the node library. The requirements file pulls opencv-python, postfx and caption-audit - none of which this node needs; it runs on torch and numpy, which you already have. The model download happens on first execution, not at install, so you need a working internet connection the first time (or you can drop the .pth in models/depthanything/ yourself). Delete a stray ComfyUI-AutoBypass folder if you have one.
Where it bites
Resolution is the knob everyone gets wrong in both directions. At 518 you get the trained size and the fastest run; pushing it to 1000+ on a 9:16 frame makes the attention matrix expensive enough to be the reason a run OOMs, which is precisely why the packed version uses the memory-efficient kernel rather than building that matrix. If you're short on VRAM, lower resolution before you lower anything else.
The v3 models are the second trap: they run through core, so mixing them into a workflow you're sharing means the recipient needs core DA3 too. v2-small is self-contained - that's the reason to stay on it even when a v3 size would be nicer.
Finally, video. Running a depth preprocessor frame by frame gives you flicker between frames, because each frame's normalisation is independent. That's true of every one of these nodes, not just this one, and the fix is a video-native model rather than a different node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolution | INT | 51814–2044 | Short side the model sees, rounded to a multiple of 14, and the short side of the depth map when width / height are not connected. Higher gives finer detail and costs more memory. |
| modelopt | COMBO | v2-small | v2-small: Depth Anything V2 Small, this pack's own code. v3-*: Depth Anything 3 through ComfyUI core, weights in models/geometry_estimation (small 137 MB, base 542 MB, mono-large and metric-large 1.3 GB). All Apache-2.0. |
| widthopt | INT | 1–16384 | With height: the depth map comes out at exactly width x height (covering it with its aspect kept, centre-cropped), e.g. the latent's pixel size. |
| heightopt | INT | 1–16384 | With width: the depth map comes out at exactly width x height. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| depth | IMAGE | — |