Nodes/ComfyUI-DreamCube/Normalize Cubemap Depth
ComfyUI Node

Normalize Cubemap Depth

Put every face's depth on the same scale before you compare or merge

By cedarconnor·Created 10 months ago·Updated 9 months ago· 2
Normalize Cubemap Depth
  • cubemap
  • CUBEMAP
methodglobal

Every monocular depth model outputs values on an arbitrary scale. That's not a bug - relative depth is all most of them promise. But it becomes a real problem the moment you have six independently-estimated faces, because "close" on the front face might mean 0.9 while "close" on the back face means 0.6. Normalize Cubemap Depth is the node that reconciles those scales after the fact.

You'll reach for it in two situations. First, when you've applied depth face-by-face with Apply Depth to Cubemap Face (which normalizes each face on its own range, by design) and now want them comparable before converting to a panorama. Second, when you've used a different depth model on different faces - a totally legitimate workflow if one model handles your sky better than another - and need the mismatched ranges tamed.

The three modes map to three strategies:

  • global - one shared min/max across all six faces, everything rescaled into that range. Best default when all faces came from the same model.
  • per_face - each face independently scaled to [0, 1]. This is what Apply Depth to Cubemap Face already did; use it if you want to reset a partially-processed cubemap to that state.
  • align_scales - the interesting one. It standardizes each face (zero mean, unit variance) and rescales it to match the statistics of the front face, which it uses as the reference. That's the right choice when faces have genuinely different ranges rather than just different offsets - e.g. you mixed models per face.

Inputs and outputs

  • cubemap - a cubemap that already has depth (throws Cubemap has no depth information otherwise).
  • method - global (default), per_face, or align_scales.

Output is a CUBEMAP with the depth layer rescaled. RGB is untouched.

How to install it

ComfyUI Manager, search "DreamCube", install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/ComfyUI-DreamCube.git
cd ComfyUI-DreamCube
pip install -r requirements.txt

No model files, no keys - it's pure array math on the depth layer.

Gotchas

Normalization won't fix faces that are wrong, only faces that are differently scaled - if one face's depth is garbage, aligning its histogram to the front face just gives you aligned garbage. Check the actual depth with Cubemap Preview (show_depth) before you trust any normalize step to have saved you. And note that global is the default but it's also what Batch Cubemap Depth already applies on its default settings - if you went through that node, you may not need this one at all.

CategoryDreamCube/Depth

Inputs (2)

NameTypeDefaultDescription
cubemapCUBEMAP
methodCOMBOglobalglobal = shared min/max; per_face = independent scaling; align_scales = match reference face

Outputs (1)

NameTypeDescription
CUBEMAPCUBEMAP