Equirect to Cubemap
Why your 360° depth looks broken (and the fix starts here)
- image
- CUBEMAP
If you've ever shoved a full 360° equirectangular panorama straight into Depth Anything and watched the sky and floor dissolve into streaky garbage, you already know why this node exists. Equirectangular images map a sphere onto a flat 2:1 rectangle, which stretches everything near the poles horizontally - and depth models, trained on normal perspective photos, have no idea what to do with that. The fix, and the entire thesis of the ComfyUI-DreamCube pack, is to stop estimating depth on the panorama and start estimating it on six clean square faces instead. This node is the front door of that workflow: it unrolls your 2:1 panorama into a six-face cubemap.
Equirect to Cubemap is the entry point of the pack. You feed it an IMAGE (your panorama) and it hands back a CUBEMAP - a custom data structure holding six square faces: front, back, left, right, top, bottom. From there you either extract the faces one at a time and run any ComfyUI depth node on each, or wire all six depth maps straight into Batch Cubemap Depth. When you're done, the sibling Cubemap to Equirect node flattens it back into a panorama you can save.
The math is straightforward inverse mapping. For every pixel of every face, it computes a 3D direction vector, converts that to longitude/latitude, and samples the equirectangular image at that spot with bilinear interpolation - using scipy's vectorized map_coordinates and wrapping around the longitude seam so the left/right edge of your panorama doesn't show a hard cut. That's why it's fast: the README claims about 80 ms at 1024² faces on an RTX 3060. There are no models, no weights, no GPU-only tricks here - it's pure NumPy/SciPy math, which also means it runs fine on CPU if you're patient.
Inputs and outputs
Only two things to care about:
image- your equirectangular panorama, and it must be a 2:1 aspect ratio (like 2048×1024). The node checks this and throws anInvalid aspect ratioerror otherwise. Resize first.cube_resolution- the size of each square face, default 1024, range 256–4096. This is your quality/VRAM dial.
The single output is CUBEMAP, which you'll usually wire into Extract Cubemap Face or Batch Cubemap Depth.
How to install it
ComfyUI Manager is the easy route: open Manager, search "DreamCube", install, restart ComfyUI. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/ComfyUI-DreamCube.git
cd ComfyUI-DreamCube
pip install -r requirements.txt
Then restart ComfyUI. No models to download, no API keys, nothing heavy - the requirements are torch, torchvision, numpy, scipy, pillow, opencv-python and einops. ComfyUI already ships most of those; opencv-python is the one larger wheel that might be missing, and you probably already have it from another pack.
Where people get burned
The aspect ratio check trips everyone up at first - a phone-camera "360°" capture that's been cropped is not 2:1, and the node will refuse it. And remember that cube_resolution scales VRAM fast: the README's numbers are ~4 GB at 1024² faces, ~12 GB at 2048², ~40 GB at 4096². For a first pass, 1024 is plenty to see whether your depth looks right; crank it only when the result is good enough to want sharper.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| cube_resolution | INT | 1024256–4096 | Resolution (pixels) for each cube face; higher = sharper faces but more VRAM |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CUBEMAP | CUBEMAP | — |