Equirectangular To Cubemap (Flexible)
Cubemaps in dice, strip, or stack — pick your poison
- image
- cubemap
The plain Equirectangular → Cubemap (3x2) node gives you one layout, full stop. This one gives you five. If you've ever opened a 360° panorama and thought "I wish this were a dice cross in Photoshop," this is your node.
Equirectangular To Cubemap (Flexible) converts a panorama into a cubemap in any of these formats:
atlas_3x2- the standard 3×2 grid, same as the non-flexible node.dice- the six faces unfolded into a cross. This is the layout people paint in Photoshop and Substance: the cross shape maps to how you'd wrap a cube's texture.horizon- the faces laid out in a horizontal strip. Nice for eyeballing all six sides side by side, or for feeding a strip-based tool.stack- faces stacked vertically, a B*6 batch. This is the one to pick when you want to process the faces as a batched tensor (each face is a separate frame to ComfyUI) and unstack them later with the pack's Split/Stack face nodes.listanddictare listed as options but are aliases ofstackfor ComfyUI compatibility.
The face_order string (default F,R,B,L,U,D, i.e. front, right, back, left, up, down) controls the order of faces in horizon and stack. It also accepts full words (front,right,...) if that reads better than initials. For atlas_3x2 and dice the order is fixed, so face_order is ignored there.
How it works
Same rendering engine as the rest of the pack: each face is built by inverse-mapping - every pixel of the face is traced back to a latitude/longitude on the sphere and sampled from the source with OpenCV cv2.remap and BORDER_WRAP for clean wraparound. The only difference from the non-flexible node is how the rendered faces get packed into the output image, which is where cube_format earns its keep.
Inputs that matter
image(required) - the equirectangular tensor (B,H,W,C) in [0,1].face_size- pixels per face, default 512, up to 4096.cube_format- the layout, defaultatlas_3x2.face_order- only matters forhorizon/stack/list/dict, as above. Get it wrong and the stack is scrambled, but at least it's your scramble to fix with a matching string on the way back in.interpolation-lanczosdefault; keep it for the geometry resampling.
Output is a single cubemap IMAGE in the format you picked.
Installing it
ComfyUI Manager, search "LatLong", or:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong
cd comfyui-LatLong
pip install -r requirements.txt
Restart ComfyUI. Found under LatLong/Cubemap. Deps: numpy, opencv-python, scipy, torch, Pillow - no model files.
Gotchas
The flexible formats are a commitment. Once you output a stack, only another flexible node (or the pack's Stack/Split helpers) can read it back meaningfully - the plain 3×2 converter will treat it as an atlas and give you nonsense. Keep track of the face_order you used, because there's no metadata embedded in the image; you have to feed the same order back into the Flexible To-Equirectangular node to reconstruct your panorama.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Equirectangular input image tensor (B,H,W,C) in [0,1]. | |
| face_sizeopt | INT | 51216–4096 | Resolution (pixels) per cube face. |
| cube_formatopt | COMBO | atlas_3x2 | Output cubemap layout: 3x2 atlas, dice cross, horizon strip, or stack (B*6 faces). Note: list/dict are aliases of stack for ComfyUI compatibility. |
| face_orderopt | STRING | F,R,B,L,U,D | Face order for stack/horizon (and list/dict alias) formats. Tokens: F,R,B,L,U,D (also accepts front/right/back/left/up/down). Example: 'F,R,B,L,U,D'. |
| interpolationopt | COMBO | lanczos | Resampling filter used during face generation. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| cubemap | IMAGE | — |