Stack Cubemap Faces (Stack)
Pack six cube faces into one batch tensor — the tidy cubemap carrier
- Front
- Right
- Back
- Left
- Up
- Down
- face_stack
A cubemap is a 360° image unrolled into six flat squares - front, right, back, left, up, down. Most tools glue those squares into a 3×2 atlas, but the LatLong pack also has a stack format where all six faces live in one tensor of batch dimension B*6. Stack Cubemap Faces (Stack) is the node that builds that stack from six named inputs, so you can pass an entire cubemap through a model or into another node as a single tensor instead of six separate wires.
Why bother? The stack format is what the pack's flexible converter consumes (cube_format='stack'), and it's the natural shape for seam-edit workflows where you want to process faces as a batch. It also plays nicely with the pack's Split node, which hands you the six faces back. Think of it as the envelope you stuff six letters into.
How it works
Simple and honest: it takes the six face batches, validates the face_order, and concatenates them along the batch axis so the output is (B*6, H, W, C). The face_order string (default F,R,B,L,U,D) decides the output order - the position each face lands at in the stack. The parser accepts single letters or full words, and treats top/bottom as synonyms for up/down, so F,R,B,L,U,T works fine too. What matters is that the order you write here matches whatever reads the stack back, or your left and front swap identities and you'll be debugging a very confusing cubemap.
Inputs and output:
Front,Right,Back,Left,Up,Down- all requiredIMAGEbatches. ComfyUI will refuse to run with any of them unconnected, so wire all six.face_order- optional string, defaultF,R,B,L,U,D. Keep it identical to the order used when you later split or convert back.- Output: one
face_stacktensor of shape(B*6, H, W, C).
A natural round trip: use the pack's Cubemap Faces Extract or Equirectangular To Cubemap (Flexible) with cube_format='stack' to get faces, process the stack, then Stack → Split to recover named faces.
How to install
This ships in the LatLong pack:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong.git
cd comfyui-LatLong
pip install -r requirements.txt
Restart ComfyUI, or search "LatLong" in ComfyUI Manager. The pack's dependencies - numpy, opencv-python, scipy, torch, Pillow - are light, and there are no model files to download.
Gotchas
- Order matters everywhere. Stack, Split, and the flexible converter all take a
face_order, and they must agree. Pick one order (the default is fine) and use it consistently. - All six inputs are required. Forget to wire
Upand the node just won't run. - The faces in each input must have matching dimensions - stacking is
torch.catalong the batch axis, and mismatched heights or widths will fail.
It's a boring little logistics node, and that's the compliment: when your cubemap needs to travel as one tensor instead of six, this is the cleanest way to pack it.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| Front | IMAGE | Front face image batch. | |
| Right | IMAGE | Right face image batch. | |
| Back | IMAGE | Back face image batch. | |
| Left | IMAGE | Left face image batch. | |
| Up | IMAGE | Up face image batch. | |
| Down | IMAGE | Down face image batch. | |
| face_orderopt | STRING | F,R,B,L,U,D | Output stack face order. Must match the order you use when converting back from stack. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| face_stack | IMAGE | — |