MiDaS Depth Map
The original depth estimator, still holding up
- image
- IMAGE
MiDaS is the granddaddy of depth preprocessors - the model that shipped with SD 2.0's depth2img and served as the default ControlNet depth estimator through most of 2022–2023. It takes one flat image and estimates a grayscale depth map (bright = close, dark = far) to feed a depth ControlNet. Newer models have surpassed it on paper, but here's the thing the community actually discovered: for ControlNet conditioning specifically, MiDaS's sharp, high-contrast edges held up remarkably well. The famous "Use MiDaS" verdict from the Zoe-vs-MiDaS shootout is why it's still in a lot of workflows.
How it works, and why sharpness beats "accuracy"
MiDaS (from Intel ISL) produces relative depth - it tells you what's nearer than what, not distances in meters. That relativity is a feature, not a limitation, for our purposes: ControlNet doesn't care about true scale, it cares about clean spatial relationships and crisp edges to follow. When the community A/B-tested MiDaS against ZoeDepth (which predicts real-world metric depth), MiDaS won for ControlNet work precisely because its edges were sharper - Zoe's metric precision came with softer gradients that the ControlNet found harder to lock onto. The lesson generalizes: for depth conditioning, optimize for edge clarity, not geometric accuracy.
The inputs and output
The image and resolution (default 512, match it to your render) fields are the ones you'll actually use. There are two extra knobs that trip people up because they're legacy MiDaS parameters mostly relevant to its normal-map sibling rather than the depth output:
a(default ~6.28, i.e. 2π) - an angle parameter carried over from MiDaS's normal-map math. For a plain depth map you can leave it at default; it's not the sensitivity dial people assume it is.bg_threshold(default 0.1) - a background threshold, again inherited from the normal-estimation path. Default is fine for depth work.
Don't burn time tuning a and bg_threshold expecting big depth-map changes - they mostly matter when you're generating normal maps. The single output is an IMAGE (the depth map) that wires into a ControlNet Apply node with a depth ControlNet (control_v11f1p_sd15_depth and friends). The node makes the hint; the ControlNet model is separate.
Installing it
ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
pip install -r requirements.txt
Restart ComfyUI. The MiDaS weight (dpt_hybrid-midas) downloads from HuggingFace on first run - one-time pause.
Where people get burned
First, the universal reminder: no depth ControlNet loaded, no effect - the map alone does nothing. Second, the a and bg_threshold rabbit hole: people crank them looking for a quality lever and find the depth map barely changes, because those params serve the normal-map path. Leave them alone and choose your model instead - that's where the quality difference lives. Third, the honest positioning: MiDaS is fast and its sharp edges are genuinely good for ControlNet, but Depth Anything V2 (another node in this pack) generalizes better to unusual scenes and handles reflective surfaces more gracefully. Keep MiDaS for legacy workflows, fast preview passes, and cases where its crisp edges suit the shot; reach for Depth Anything V2 when you want the current default. Standard weight discipline applies either way: 0.4–0.7 loose, 0.8–1.1 strict, end around half the steps.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| aopt | FLOAT | 6.280–15.70796326794897 | — |
| bg_thresholdopt | FLOAT | 0.100–1 | — |
| resolutionopt | INT | 51264–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |