ComfyUI Node

Stack Cubemap Faces (Stack)

Pack six cube faces into one batch tensor — the tidy cubemap carrier

By cedarconnor·Created about a year ago·Updated 7 months ago· 2
Stack Cubemap Faces (Stack)
  • Front
  • Right
  • Back
  • Left
  • Up
  • Down
  • face_stack
face_orderF,R,B,L,U,D

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 required IMAGE batches. ComfyUI will refuse to run with any of them unconnected, so wire all six.
  • face_order - optional string, default F,R,B,L,U,D. Keep it identical to the order used when you later split or convert back.
  • Output: one face_stack tensor 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 Up and the node just won't run.
  • The faces in each input must have matching dimensions - stacking is torch.cat along 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.

CategoryLatLong/Cubemap

Inputs (7)

NameTypeDefaultDescription
FrontIMAGEFront face image batch.
RightIMAGERight face image batch.
BackIMAGEBack face image batch.
LeftIMAGELeft face image batch.
UpIMAGEUp face image batch.
DownIMAGEDown face image batch.
face_orderoptSTRINGF,R,B,L,U,DOutput stack face order. Must match the order you use when converting back from stack.

Outputs (1)

NameTypeDescription
face_stackIMAGE