Cubemap To Equirectangular (Flexible)
Convert any cubemap layout back to a panorama
- cubemap
- equirectangular_image
The plain Cubemap (3x2) → Equirectangular node only accepts one specific atlas layout. This Flexible version accepts several, which matters the moment your cubemap didn't come out of this pack. Did you paint the six faces as a dice cross in Photoshop? Generate a horizontal strip in some other tool? Need to feed a stacked face batch back through? This is the node that reads all of them.
It's the ingest half of the pack's "flexible" cubemap story. The flexible pair exists so you're not locked into the 3×2 atlas convention - you can convert to whatever layout your downstream tool wants, and convert back from whatever you get. list and dict are also listed as options, but they're aliases of stack for ComfyUI compatibility, so don't go looking for JSON semantics there.
How it works
Mechanically it's the same inverse remap as the non-flexible version: each output pixel is traced back to a cube face and sampled. The difference is in the unpacking step before that - the node has to know where each face sits in whatever layout you hand it. That's the whole job of cube_format and face_order:
atlas_3x2- the standard 3×2 grid (top: left, front, right; bottom: back, top, bottom). Fixed face order,face_orderignored.dice- the six faces unfolded into a cross.horizon- a horizontal strip of faces, order controlled byface_order.stack(and its aliaseslist/dict) - faces stacked vertically as a B*6 batch, order controlled byface_order.
Inputs that matter
cubemap(required) - your cubemap IMAGE in whatever layout you declare.cube_format- defaultatlas_3x2; switch it to match the layout you actually have.face_order- defaultF,R,B,L,U,D. This is a string of face tokens and it only applies tohorizon,stack,list, anddict. The tokens areF, R, B, L, U, D(front, right, back, left, up, down), and the parser also accepts the full words if that's clearer. Wrong order in = scrambled faces out, and there's no way for the node to know.output_width(2048) /output_height(1024) - target panorama size; keep 2:1.interpolation-lanczosdefault, and it's the right one for a resampling-heavy operation like this.
Output is a single equirectangular_image, ready for the rest of the LatLong pipeline.
Installing it
Same install as the whole pack - 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. This node lives under the LatLong/Cubemap submenu. Dependencies: numpy, opencv-python, scipy, torch, Pillow. No models to fetch.
Gotchas
The number one mistake is leaving cube_format on atlas_3x2 while feeding it a dice cross. The node will happily read the first faces it finds in the wrong places and hand you back a panorama that looks like a Jackson Pollock of your own scene.
Second: face_order is easy to forget because it's buried in the optional inputs, and a stack's order is invisible until you convert it. If you generated the stack with this pack's own Flexible To-Cubemap node, note the order that node wrote it with - the default is F,R,B,L,U,D on both sides, so round-trips just work as long as you don't touch one side and not the other.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| cubemap | IMAGE | Cubemap input tensor. Use cube_format=atlas_3x2/dice/horizon for packed layouts, or stack/list/dict (alias) for face stacks (B*6 faces). | |
| cube_formatopt | COMBO | atlas_3x2 | How to interpret the input cubemap. 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. Must match how the cubemap was packed. |
| output_widthopt | INT | 2048256–8192 | Width of output equirectangular panorama (typically 2x height for standard 2:1 ratio). |
| output_heightopt | INT | 1024128–4096 | Height of output equirectangular panorama. |
| interpolationopt | COMBO | lanczos | Resampling quality when mapping cubemap -> equirectangular. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| equirectangular_image | IMAGE | — |