LatLong Cubemap Preset
Get your panorama into the layout your renderer wants
- image
- IMAGE
Equirectangular is a great interchange format and a terrible working format. Feed an ERP straight into a diffusion model and the poles get smeared into stripes, because a 2:1 image gives the top row as much pixel budget as the equator. The standard fix is cubemap: six square faces, uniform sampling, no pole singularity.
Then cubemaps hand you a second problem - which cubemap. Every tool packs the six faces differently: Blender and Nuke workflows want something cross-shaped or strip-based, research models want a plain stack. This node is the adapter, converting between equirectangular and four named layouts in both directions, so you're not writing a slicing script every time a panorama moves between tools.
How it works
It converts through the pack's flexible cubemap converters and then packs or unpacks the result into the layout you picked. The four presets, as named in the node:
- LatLong 3x2 (L F R / B U D) - the pack's own legacy atlas: left, front, right on the top row, back, up, down on the bottom.
- Cross 4x3 (U / L F R B / D) - the classic unfolded cube, up on top, a four-face ring, down at the bottom.
- Strip FRBLUD - the six faces in a horizontal line.
- Stack FRBLUD - six faces stacked vertically, one per row. This is the one most models and training scripts expect.
direction picks the arrow: export turns a panorama into that layout, import turns that layout back into a 2:1 equirectangular image. Whole thing is lossy in both directions - you're reprojecting six times, and default sampling is bilinear - so treat the round trip as a working step, not an archival one.
flip_face_vertical is the honest bit of the design. Plenty of engines disagree about which way a cubemap face's V axis points, and the author's choice here is to make it a switch you flip rather than an undocumented convention baked into each preset. It applies a vertical flip to each face on export (after converting to a stack, then repacking) and on import (unpacking to a stack, flipping, then converting) - so it's reversible, and you can toggle it back and be exactly where you started.
Inputs you'll actually touch
- image - the panorama (export) or the packed layout (import).
- direction -
exportorimport, as above. - preset - the four layouts.
- face_size (16–4096, default 512) - per-face resolution for
export. Six faces of 512 is a 3072×1024 atlas; that's usually more pixels than your source panorama had, so 512 is often generous. Onimportthis field does nothing - face size is read off the incoming image, because it has to be. - panorama_width (32–16384, default 2048) - the output width on
import; the height is always half of it. Ignored onexport, where the source panorama's dimensions rule.
One IMAGE output. On export it's the packed layout (a single image, not six sockets); on import it's the 2:1 panorama, still valid for the rest of the pack's geometry.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong
cd comfyui-LatLong
python -m pip install -r requirements.txt
Manager users can just search "ComfyUI LatLong". Use ComfyUI's Python (the embedded python.exe on a portable install), Python 3.10+. The dependencies - numpy, opencv-python, scipy, torch, Pillow - are all things a working ComfyUI already has, and there are no models to download. Restart ComfyUI and it appears under LatLong/Cubemap.
Common issues
There is no layout validation. Feed import a 2:1 equirectangular image while the preset says Cross 4x3 and it won't complain - it slices the image into what it believes are faces and projects nonsense. If your output looks like six unrelated wedges, you picked the wrong preset, not a broken install.
Exporting a low-res source to high face_size doesn't create detail; you're resampling a 2048-wide panorama into six 1024 faces and up with soft poles. Go the other direction if you can: do the heavy work on the cubemap faces and import back.
One genuinely useful pattern for the 3D crowd: export a panorama to cubemap, run Depth Anything on the faces, and rebuild geometry per face. A January 2026 thread describing exactly that pipeline in Nuke hit the wall you'd expect - the faces don't line up into a coherent sphere at the end. Cross-face filtering is a known limitation of the pack; reconstruction clamps at each face's own edge, so check those joins rather than trusting them.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| direction | COMBO | 2 options: export, import | |
| preset | COMBO | 4 options: LatLong 3x2 (L F R / B U D), Cross 4x3 (U / L F R B / D), Strip FRBLUD, Stack FRBLUD | |
| face_size | INT | 51216–4096 | — |
| panorama_width | INT | 204832–16384 | — |
| flip_face_vertical | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |