Nodes/ComfyUI-CN-Pre/ControlNet Pre (+Model/ControlNet): Depth (DepthAnything)
ComfyUI Node

ControlNet Pre (+Model/ControlNet): Depth (DepthAnything)

Depth (DepthAnything) — the modern depth preprocessor, bundled

By OKIE5·Created 10 months ago·Updated 10 months ago· 0
ControlNet Pre (+Model/ControlNet): Depth (DepthAnything)
  • image
  • pth_model
  • model
  • clip
  • vae
  • control_net
  • control_image
  • model
  • clip
  • vae
  • control_net
model_idDepth-Anything-V2-vit-b
normalize_mode
fixed_min0.00
fixed_max1.00
invert
post_blur
post_blur_strength1.00
render_style

Depth Anything has been the community's default depth estimator since 2024, and it's stayed that way - nothing's knocked it off the top since, per the reddit corpus discourse holding a steady 8-19 threads a month for two and a half years straight, which is what a genuinely settled tool looks like. If you need a depth map for ControlNet and don't have a strong reason to reach for something else, this is the model family you want. This node is one of two depth preprocessors bundled in the small ComfyUI-CN-Pre pack (the other runs MiDaS), and it gives you the Depth Anything pipeline plus a handful of post-processing controls the plain preprocessor doesn't.

What it does and the one setting to watch

model_id defaults to Depth-Anything-V2-vit-b - that's the V2, ViT-Base size. Note it's a free-text string field, not a dropdown, so there's no built-in menu of alternatives to pick from; the -vit-b suffix hints there may be -vit-l (Large) or -vit-s (Small) variants you can type in if you know the exact identifier, but the pack doesn't enumerate them anywhere, so don't guess blind. Worth knowing: the community's actual daily-driver recommendation is V2 Large, not Base - Base is the lighter, faster middle option. If output quality matters more than speed, it's worth trying to point this field at a Large checkpoint rather than trusting the default blind.

normalize_mode controls how the raw depth values get squashed into the 0-1 image range: per_image_minmax (default) stretches each image's own min/max to fill the range, which is the sane default for a single still. fixed_range uses fixed_min/fixed_max instead - reach for that if you're processing a sequence of images and want the depth scale to stay consistent frame to frame instead of each one auto-stretching independently. invert flips near/far if your downstream ControlNet expects the opposite polarity. post_blur/post_blur_strength add a smoothing pass afterward (bilateral is the one to reach for if you want smoothing without losing edge definition). render_style is the one genuine trap: pseudo_color renders a rainbow heatmap that looks great for a human sanity-checking the output, but depth ControlNets are trained on grayscale maps - feed them a pseudo-color image and conditioning breaks. Leave this on grayscale unless you're just eyeballing the result.

The optional pth_model input - and why PTH-Loader exists

This node has an optional pth_model input (type PTH_MODEL) that the plain model_id string doesn't need for normal use - it's there specifically so you can feed in a custom checkpoint via the pack's other node, PTH-Loader, instead of relying on whatever model_id resolves to. If you've got a finetuned or alternate depth .pth file you want to use, that's the pairing: PTH-Loader loads it, this node's pth_model input consumes it. If you don't have a specific reason to swap the checkpoint, skip it entirely.

Like the pack's other Loaders nodes, it also carries optional model/clip/vae/control_net inputs that pass straight through unmodified to matching outputs - pure wiring convenience, ignore them if you don't need it. The real output you care about is control_image (IMAGE), which feeds your ControlNet Apply node.

Installing it

Search ComfyUI-CN-Pre in ComfyUI Manager, or git clone https://github.com/OKIE5/ComfyUI-CN-Pre into custom_nodes and restart. Fair warning going in: the pack's README is a single stub line that doesn't describe any of this, so there's no documented list of what model_id strings are valid or where the weights get pulled from - expect a first-run download when you use a model_id for the first time, and expect to hunt a bit if you want a size other than the default.

Where people get burned

Because model_id is free text with no validation, a typo just fails quietly at load time instead of showing you a helpful list of valid options - if it errors, check the ComfyUI console log rather than the node UI. And remember: before you spend time debugging a ControlNet that "isn't following the depth map at all," check render_style first. A pseudo-color depth image looks completely reasonable in the node preview and will silently produce garbage conditioning, and that's the single most likely reason this specific node misbehaves for a first-time user.

CategoryCtrlNet/Pre

Inputs (14)

NameTypeDefaultDescription
imageIMAGE
model_idSTRINGDepth-Anything-V2-vit-b
normalize_modeCOMBO2 options: per_image_minmax, fixed_range
fixed_minFLOAT0.00-10–10
fixed_maxFLOAT1.00-10–10
invertCOMBO2 options: false, true
post_blurCOMBO3 options: none, gaussian, bilateral
post_blur_strengthFLOAT1.000–5
render_styleCOMBO2 options: grayscale, pseudo_color
pth_modeloptPTH_MODEL
modeloptMODEL
clipoptCLIP
vaeoptVAE
control_netoptCONTROL_NET

Outputs (5)

NameTypeDescription
control_imageIMAGE
modelMODEL
clipCLIP
vaeVAE
control_netCONTROL_NET