MiDaS Depth Estimator
The old-reliable depth map, still bundled in tbox
- image
- IMAGE
MiDaS is the original mainstream depth estimator - it shipped with SD 2.0's depth2img and was the default ControlNet depth preprocessor for most of 2022-2023. It's genuinely old by this ecosystem's clock, and there are objectively sharper options now (Depth Anything v2/v3, Marigold). tbox bundles MiDaS anyway, which is fine: if you already have this pack installed and just need a depth map for a ControlNet pass without pulling in another node package, MiDaS still does the job, and a community A/B test even found its edges hold up better for ControlNet conditioning than the "more accurate" ZoeDepth that was supposed to replace it - the verdict was blunt: "Spoiler alert: Use MiDaS."
How it works
It's monocular depth estimation - one 2D image in, a single-channel depth map out, rendered as a grayscale image where value encodes relative distance (closer things vs. farther things, not real-world meters). That relative-only limitation is exactly why the metrically-accurate ZoeDepth was supposed to be the upgrade, and exactly why the community found it wasn't: ControlNet conditioning cares about sharp edges and clean local contrast, not absolute geometric accuracy, and MiDaS's output is sharper where it counts.
The inputs and outputs that matter
image(required) - your source photo or frame.resolution(default 512, range 64–16384) - internal processing resolution. This is the knob that actually matters day to day: push it up if your source has fine detail you want the depth map to respect, at the usual cost of speed.a(default ≈6.28, i.e. 2π) andbg_threshold(default 0.1) - internal tuning parameters the node's schema doesn't attach a description to beyond their numeric ranges. Honestly, leave them at default unless you're deep in the weeds -resolution, and whether MiDaS is even the right preprocessor for your use case, matter far more than either of these.
Output: IMAGE - the depth map. Feed it into your ControlNet apply node alongside a depth ControlNet checkpoint (an SD 1.5 depth ControlNet, an SDXL union model in depth mode, or whatever your base model's depth conditioning expects).
How to install it
Via ComfyUI Manager: search ComfyUI-tbox, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ai-shizuka/ComfyUI-tbox
then restart. The pack's README doesn't document where the MiDaS weights come from or when they download - it's essentially blank under its section headers. Every other ComfyUI depth preprocessor pack fetches its checkpoint automatically the first time you run it, so plan for the same: your first use of this node is likely to pause while it grabs the model, and if your executor has no outbound internet, that's where it'll stall.
Common issues & troubleshooting
Depth map looks flat, low-contrast, or misses fine detail. This is the real gap between MiDaS and the newer generation of depth models. If you've hit its ceiling, the fix isn't a setting here - it's swapping to a Depth Anything–based preprocessor if your workflow allows installing one more pack.
Conditioning feels too strong or too weak. That's not a MiDaS setting - this node has no strength control at all, so adjust it on the ControlNet apply node downstream, not here.
First run stalls or errors out. Almost certainly the weight download described above - check your console for what it's trying to fetch before assuming the node itself is broken.
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 | — |