DepthRenormalizer
Force one depth map to match another's scale
- depth
- guidance_depth
- depth_mask
- guidance_mask
- depth tensor
Here's a problem you will hit the first time you run two depth estimators on overlapping views: they don't agree on what "one unit" means. One returns meters, another returns an arbitrary scale, and the moment you try to merge them into a single point cloud you get two objects that should connect but float past each other. DepthRenormalizer is the fix - it rescales one depth map to match another, using only the regions where both are trustworthy.
Think of it as the poor man's calibration pass. You estimate a "guide" depth you trust (say, a metric Depth Anything V2 output) and a second depth you need to bring into line, and this node solves for the single global scale (and optionally offset) that makes them agree. It's the difference between two point clouds that visually conflict and one coherent scene.
The inputs
depth- the map you want to fix.guidance_depth- the map whose scale you want to match.depth_maskandguidance_mask- where each map is valid. This is the important part: the fit only happens inside the intersection of the two masks, so the bits of image where either estimator produced garbage don't drag the calibration off.use_inverse(default off) - fit in inverse/1/depthspace when on. The tooltip-free source keeps this simple: leave it off for the common case, turn it on when the estimator you're correcting uses disparity-ish units.
The mechanism, per the source, is a single global linear scale and offset fit over the masked intersection, optionally with the masks dilated and blurred before fitting. One global correction, not a per-pixel warp - which is the right call, because when depth scales disagree it's almost always a single multiplicative factor, and anything fancier just memorizes the errors.
The output is the corrected depth tensor ready to plug into the same downstream nodes as the original.
When to reach for it
- After you've generated depth for multiple views with different models and they need to live in one coordinate space before
CombineDepthsNodeorDepthToPointCloud. - In the
FisheyeDepthEstimator-style multi-view fusion, where per-view estimates from the same model still drift in scale and need a common anchor. - Any time your geometry "works" but the proportions are subtly wrong between views - that's a scale mismatch this node will quietly fix.
If your two maps overlap poorly or you want a robust fit weighted by trust, the pack's DepthScaleAnchor is the sibling with the fancier disparity-domain fit - this node is the quick-and-dirty linear version, and usually that's all you need.
Install
Shared camera-comfyUI install: ComfyUI Manager → search "camera-comfyUI" → Install, or clone https://github.com/Alexankharin/camera-comfyUI into custom_nodes/ and run python install.py. Pure tensor math, no models, no CUDA.
Troubleshooting
- Result still mismatched: your masks are probably too loose, letting a bad region dominate the fit. Tighten them to the well-estimated core.
- Scene shifts rather than rescales: try
use_inverseon - some estimators encode "closer = larger" and the fit needs to happen in that space to pick up the right offset. - Whole thing floats away:
guidance_depthisn't actually metric (it's a relative map). Run it through a metric estimator orDepthScaleAnchoragainst a known reference first.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| depth | TENSOR | — | |
| guidance_depth | TENSOR | — | |
| depth_mask | MASK | — | |
| guidance_mask | MASK | — | |
| use_inverse | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| depth tensor | TENSOR | — |