CombineDepthsNode
Stitch two depth maps without a visible seam
- depthSRC
- maskSRC
- depthDST
- maskDST
- combined_depth
- combined_mask
CombineDepthsNode exists to solve a problem you'll hit the moment you start doing multi-view depth: you estimated depth for one view, you estimated it for another, and now you have two overlapping maps that disagree where they meet. This node takes two depth maps plus two masks and merges them into one coherent depth field - no hard seam, no double-counted geometry.
It's a quiet utility, but it's doing real work under the hood. The depth nodes in this pack lean on it heavily - FisheyeDepthEstimator calls it internally to fuse the five pinhole depth estimates it computes for a fisheye image. When you see a node using this one for you automatically, that's why you don't have to.
The inputs
The naming is literally "source" and "destination": depthSRC + maskSRC is one (depth, mask) pair, depthDST + maskDST the other. Each mask says where its depth map is trustworthy - 1.0 where you believe it, 0.0 where you don't. The depth tensors are (B,H,W,1) float32; the masks (B,H,W).
The mode enum is where the behavior is decided:
- AVERAGE (default): mean of the two depths wherever either mask is true. Good default for overlapping estimates that both have decent quality.
- SRC / DST: hard overlay - one map just wins. Useful when one view is clearly authoritative.
- SOFTMERGE: a Gaussian-blurred transition controlled by
softmerge_radius(default 5). This is the one to reach for when the two maps meet in the middle and you want a graded blend instead of a knife edge. - DISTANCE_AWARE: blends in disparity space using a distance transform, which keeps the merge physically sensible near depth edges instead of smearing across them. The smartest mode, slightly more expensive.
invert_mask (default off) flips the masks' meaning if your masks are stored inverted (0 = valid). The output is combined_depth (TENSOR) and combined_mask (MASK), both ready to feed straight into DepthToPointCloud.
Why you'd use it
The honest use case: your pipeline generated depth for a scene from multiple angles (say, a pinhole crop and a full fisheye), and they need to become one point cloud without a visible tear down the middle. Or you re-estimated part of a depth map (a region that had a bad artifact) and want to swap in the fix without redoing the whole image. Two depths in, one trustworthy depth out.
Because the pack's own FisheyeDepthEstimator uses this exact node internally, there's a fun shortcut: if you're fighting with the automatic multi-view fusion, you can replicate the same steps manually - reproject views, estimate per-view depth, then stitch with CombineDepthsNode in the mode that behaves the way you want.
Install
It's a camera-comfyUI node, so the shared install covers it: ComfyUI Manager → search "camera-comfyUI" → Install, or git clone https://github.com/Alexankharin/camera-comfyUI into custom_nodes/ followed by python install.py. No models, no CUDA, no Open3D - this is pure tensor math, so it works even if all the pack's heavy optional deps failed to install.
Troubleshooting
- Visible seam no matter the mode: both depth maps likely disagree in absolute scale (one estimator's meters ≠ the other's). Run one through DepthScaleAnchor or DepthRenormalizer against the other before merging - scale differences can't be fixed by blending.
- A hole where there should be geometry: both masks were 0 in that region. Widen your masks or go back to the estimator that produced a valid value there.
- Blend looks blurry: you're in SOFTMERGE with too big a
softmerge_radius. Dial it down or switch to DISTANCE_AWARE.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| depthSRC | TENSOR | — | |
| maskSRC | MASK | — | |
| depthDST | TENSOR | — | |
| maskDST | MASK | — | |
| mode | COMBO | AVERAGE | 5 options: SRC, DST, AVERAGE, SOFTMERGE, DISTANCE_AWARE |
| invert_mask | BOOLEAN | false | — |
| softmerge_radius | INT | 51–50 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| combined_depth | TENSOR | — |
| combined_mask | MASK | — |