Nodes/ComfyUI-Depth-Pro/Metric Depth to Inverse
ComfyUI Node

Metric Depth to Inverse

Metric depth with none of the ceremony

By spacepxl·Created 2 years ago·Updated 2 years ago· 209
Metric Depth to Inverse
  • depth
  • depth

This is the lazy sibling of Metric Depth to Relative, and lazy is a compliment. It takes a metric depth map and applies exactly one formula to it: 1 / (1 + depth). That's it. No normalization, no gamma, no per-frame logic, no toggles at all. One input, one output, one line of math.

So why does it exist when the Relative node does the same first step and more? Because sometimes you want the raw inverse depth and nothing else. Inverse depth is what a lot of 3D and geometry pipelines actually consume - it keeps close objects in a readable, high-precision range and squeezes the unreadable far distance down toward zero, so your values stay workable instead of running off to thousands of meters. It's also a nice teaching step: this is step one of the Relative conversion, exposed on its own so you can see it and do your own thing downstream.

The shape of it

The input is depth, the metric_depth IMAGE from the Depth Pro node. The output is depth again - an IMAGE where the relationship is compressed but not normalized to 0–1. The closest thing lands near 1, the far stuff near 0, and that's about as much promise as it makes.

That last point matters more than it looks. Because there's no min-max step, the output's range depends entirely on your scene - a room-scale image and a mountainscape will produce visibly different value distributions. If you're feeding a ControlNet, don't use this node; the unnormalized range and lack of per-frame handling is exactly the wrong shape, and Metric Depth to Relative is the right tool. Use this one when you're building your own normalization or when a downstream consumer wants inverse depth as its native format.

Install

Same pack, same story:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Depth-Pro

or grab ComfyUI-Depth-Pro from ComfyUI Manager and restart. Dependencies: timm>=0.9.16, numpy<2. If you hit the vit_large_patch14_dinov2 error, update timm - the README tests against 0.9.16 and 1.0.9.

If you're staring at this node wondering whether you actually need it, you probably want its relative sibling instead. This one is for people who know they want inverse depth in its raw, uncompromised form - and for them, it's exactly right.

CategoryDepth-Pro

Inputs (1)

NameTypeDefaultDescription
depthIMAGE

Outputs (1)

NameTypeDescription
depthIMAGE