Nodes/ComfyUI-ControlNet-Nodes/CCTech Depth Map Preprocessor (Depth Anything V2) ⚡
ComfyUI Node

CCTech Depth Map Preprocessor (Depth Anything V2) ⚡

Depth Anything V2 in one node — the depth preprocessor people actually reach for

By ChrisColeTech·Created 5 days ago·Updated a day ago· 2
CCTech Depth Map Preprocessor (Depth Anything V2) ⚡
  • image
  • IMAGE
ckpt_namedepth_anything_v2_vitb.pth
resolution512

If you want to lock the spatial arrangement of an image - this thing in front, that thing behind, the camera looking down a hallway - a depth map is the condition you want, and Depth Anything V2 is still the community's default depth estimator well into 2026. This node is a clean, self-contained port of it: photo in, grayscale depth map out, no wrapper pack required.

Depth maps serve two jobs in the ComfyUI world. The first is ControlNet conditioning: you feed the map into a depth-capable ControlNet and the generator respects where objects sit in space. The second is the newer, lazier route - modern edit models can take a depth map as an input image and follow it from a sentence, no ControlNet checkpoint involved. Either way, this node produces the input they want.

How it works

Depth Anything V2 is a DINOv2 vision-transformer encoder feeding a DPT decoder. That's the "it generalizes way better than the old MiDaS era" part. The important implementation detail here: this is a from-scratch port of the actual architecture from comfyui_controlnet_aux (Apache-2.0), not a transformers.from_pretrained(...) call - so there's no extra transformers dependency and nothing version-collides with whatever else you run. The detector downloads its own checkpoint from HuggingFace on first use into ComfyUI/models/depth_anything_v2/ and runs on your torch device.

Inputs and outputs that matter

  • image - any photo or render you want depth-estimated.
  • ckpt_name - the model size, and the only input you'll revisit. vits (small/fastest) is fine for previewing, vitb (the default) is the workhorse balance, vitl is quality, and vitg is the ceiling - but the Giant is slow enough that you'll feel it. On a 4090 it's roughly 10–20 seconds a frame versus a couple for Large. Start with vitb.
  • resolution (default 512, 64–2048) - the internal working size. It doesn't need to match your generation size; it's where the model does its thinking.

The output is a single IMAGE: a grayscale map where white is near and black is far. Wire it into a depth ControlNet's control_image, or hand it to an edit model that reads depth maps as input.

Installing it

It's one of eleven preprocessors in ChrisColeTech/ComfyUI-ControlNet-Nodes, under 🤖 CCTech/Preprocessors. ComfyUI Manager: search "ComfyUI-ControlNet-Nodes" and install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-ControlNet-Nodes

Restart ComfyUI afterward. No extra Python deps beyond what the pack's requirements.txt already installs (huggingface_hub and opencv-python) - that's the payoff of the not-a-transformers-wrapper approach.

Common issues

The one thing that will actually catch you: the first run is not instant. The checkpoint auto-downloads from HuggingFace the first time you execute the node, so your queue may sit on "downloading" for a bit - the Small checkpoint is light, the Giant is a big pull. That's expected, and it only happens once. If it fails, it's a HuggingFace connectivity problem, not a node problem. One gotcha shared with every depth preprocessor: the map's relationship to the image is relative, not metric - it tells you what's closer than what, and that's exactly what a ControlNet was trained to use.

Category🤖 CCTech/Preprocessors

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
ckpt_nameCOMBOdepth_anything_v2_vitb.pthModel size. vits (smallest/fastest) to vitg (largest/slowest). Downloads on first use if not already in models/depth_anything_v2.
resolutionINT51264–2048

Outputs (1)

NameTypeDescription
IMAGEIMAGE