ControlNet Pre (+Model/ControlNet): Depth (MiDaS)
Depth (MiDaS) — the older, faster depth preprocessor
- image
- pth_model
- model
- clip
- vae
- control_net
- control_image
- model
- clip
- vae
- control_net
MiDaS was the original ControlNet depth preprocessor - it's what shipped with SD 2.0's depth2img and was the default depth model through most of 2022-2023, before Depth Anything took over as the community's daily driver in 2024. It hasn't disappeared, though. It's still the right call for fast previews and for compatibility when you don't want the newer model's extra weight, and this pack ships it as its own dedicated node sitting right next to the DepthAnything one.
What it does
model_name is a real dropdown here (unlike the sibling DepthAnything node's free-text field), and it matches the classic MiDaS lineup exactly: DPT_Large, DPT_Hybrid, and MiDaS_small. That's a genuine speed/quality ladder, not just naming noise - DPT_Large gives you the cleanest gradients and is the one to reach for if quality matters, DPT_Hybrid splits the difference, and MiDaS_small is fast enough for real-time preview passes when you're iterating on a scene and don't want to wait on a heavier model every time. The community's own read on this, from a well-known head-to-head comparison against ZoeDepth: MiDaS's sharper edges beat a more "accurate" metric depth model for ControlNet purposes specifically, because what conditioning actually needs is clean relative structure, not real-world distance values. That's the whole case for MiDaS still being worth having around three-plus years later.
The rest of the parameter set is identical to the DepthAnything node in this pack - same family, same tail of controls: normalize_mode (per_image_minmax stretches each image's own range; fixed_range with fixed_min/fixed_max holds a consistent scale across a sequence), invert to flip near/far polarity, post_blur/post_blur_strength for a smoothing pass, and render_style (grayscale vs pseudo_color). That last one is the setting to actually pay attention to: pseudo_color makes a nice-looking rainbow heatmap for a human to glance at, but it will break conditioning if you feed it to a ControlNet expecting a standard grayscale depth map. Keep it on grayscale for anything you're actually generating with.
The pth_model input
Like its DepthAnything sibling, this node exposes an optional pth_model input (type PTH_MODEL) for swapping in a custom checkpoint via PTH-Loader instead of using one of the three built-in model_name options. Unless you've got a specific finetuned MiDaS-family checkpoint you're trying to load, you won't need this - the dropdown covers the normal cases.
It also carries the pack's standard optional model/clip/vae/control_net passthrough inputs, mirrored straight to matching outputs for wiring convenience - skip them if you don't need to route anything through this node. The output that matters is control_image (IMAGE), which wires into your ControlNet Apply node.
Which depth node to actually reach for
If you're not sure whether to use this node or the DepthAnything one sitting next to it in the same pack: start with DepthAnything. That's the model the community actually settled on as the default. Come back to this MiDaS node specifically when you want MiDaS_small's speed for a quick preview pass, or when you're deliberately matching an older workflow's behavior.
Installing it
Search ComfyUI-CN-Pre in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/OKIE5/ComfyUI-CN-Pre and restart. Worth setting expectations here - the pack's README is a one-line stub that doesn't actually describe this pack, so there's no dependency list or model-source documentation to lean on. The good news for this specific node: MiDaS is an old, extremely well-established model with weights that are trivial to fetch, so first-run downloads for any of the three model_name options are typically quick and painless compared to some of this pack's other, more obscure preprocessors.
Where people get burned
The same trap as the DepthAnything node applies here: render_style set to pseudo_color produces a depth map that looks fine in preview but will make your ControlNet output look wrong for reasons that aren't obvious - check this first before assuming your threshold or strength settings are the problem. Beyond that, this is one of the more forgiving nodes in the pack precisely because MiDaS has no obscure model-file hunting involved - if something breaks, it's much more likely to be a normalize/invert/render_style mismatch than a missing dependency.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model_name | COMBO | 3 options: DPT_Large, DPT_Hybrid, MiDaS_small | |
| normalize_mode | COMBO | 2 options: per_image_minmax, fixed_range | |
| fixed_min | FLOAT | 0.00-10–10 | — |
| fixed_max | FLOAT | 1.00-10–10 | — |
| invert | COMBO | 2 options: false, true | |
| post_blur | COMBO | 3 options: none, gaussian, bilateral | |
| post_blur_strength | FLOAT | 1.000–5 | — |
| render_style | COMBO | 2 options: grayscale, pseudo_color | |
| pth_modelopt | PTH_MODEL | — | |
| modelopt | MODEL | — | |
| clipopt | CLIP | — | |
| vaeopt | VAE | — | |
| control_netopt | CONTROL_NET | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| control_image | IMAGE | — |
| model | MODEL | — |
| clip | CLIP | — |
| vae | VAE | — |
| control_net | CONTROL_NET | — |