Nodes/ComfyUI-Sharp/Project Depth to Panorama
ComfyUI Node

Project Depth to Panorama

Stitching per-view depth back into one equirect map

By PozzettiAndrea·Created 8 months ago·Updated 2 months ago· 358
Project Depth to Panorama
  • depth_maps
  • extrinsics
  • intrinsics
  • panoramic_depth
  • debug_overlay
  • disagreement_heatmap
panorama_width2048
blend_modegaussian
show_borderstrue
border_colorred
disagreement_scale0.20

If SamplePanorama or SharpPanoramaCubeSplit cut your 360° image into perspective crops, and AlignDepthMaps reconciled the scale of each crop's independent depth prediction, this node is the step that puts it all back together: it projects the aligned per-view depth maps back onto the sphere and blends them into a single seamless equirectangular depth panorama.

How it works

Where adjacent views overlap, blend_mode decides how their depth estimates get combined into one value: gaussian (default, the smoothest transitions), cosine, quadratic, linear, feather (hard, center-weighted - trusts each view most at its own center and falls off fast toward the edges), or none (no blending at all, likely useful mainly for debugging a single view in isolation).

show_borders and border_color draw debug outlines around each source view's sample region on the debug_overlay output - genuinely useful while you're tuning FOV and overlap upstream in the split nodes, and worth turning off once you trust the stitch and don't need the visual clutter.

disagreement_scale controls the disagreement_heatmap output's color range: where two overlapping views' depth estimates disagree, that shows up hot on the heatmap, scaled to a maximum relative disagreement (default 0.2, i.e. 20%). This is genuinely the most useful QA signal the panorama pipeline gives you - if the heatmap is glowing everywhere, don't trust the merged panorama yet.

The inputs and outputs that matter

  • depth_maps / extrinsics / intrinsics (required) - the aligned per-view depth and cameras, typically straight from AlignDepthMaps.
  • panorama_width (default 2048, height = width/2).
  • blend_mode (default gaussian), show_borders (default true), border_color (default red), disagreement_scale (default 0.2).

Outputs: panoramic_depth (the stitched result), debug_overlay (bordered visualization), disagreement_heatmap (where views disagree, scaled by disagreement_scale).

Installing it

Manager search "Sharp" (highest version, nightly if that misbehaves), or Manager → Git URL https://github.com/PozzettiAndrea/ComfyUI-Sharp.git, or manual clone + pip install -r requirements.txt --upgrade + python install.py, restart.

Common issues

Use disagreement_heatmap as your actual checkpoint, not a nice-to-have. If it's hot across large regions, the fix isn't in this node - go back one or two steps: reconsider AlignDepthMaps's reference_view, or check whether the crops from SamplePanorama/SharpPanoramaCubeSplit had enough overlap_percent for the depth predictions to agree on in the first place. Turn show_borders off once you're past the tuning phase; it's a debug aid and you don't want the outlines baked into anything you're treating as final. And if downstream nodes like SharpRayToPlanarDepth or SharpPredictGaussiansFromMetricDepth expect a particular depth convention, remember this node's output is the equirect ray-distance convention native to a panorama - you'll need to convert before feeding it back into anything expecting SHARP's native planar-z depth.

CategorySHARP

Inputs (8)

NameTypeDefaultDescription
depth_mapsIMAGE
extrinsicsEXTRINSICS
intrinsicsINTRINSICS
panorama_widthoptINT2048512–8192Output panorama width (height = width/2)
blend_modeoptCOMBOgaussianBlending algorithm: gaussian (smoothest), cosine, quadratic, linear, feather (hard center), none
show_bordersoptBOOLEANtrueDraw borders around sample regions for debugging
border_coloroptCOMBOredColor for sample region borders
disagreement_scaleoptFLOAT0.200.01–1Max relative disagreement for heatmap color scale (0.2 = 20%)

Outputs (3)

NameTypeDescription
panoramic_depthIMAGE
debug_overlayIMAGE
disagreement_heatmapIMAGE