Nodes/ComfyUI_pytorch360convert/Cubemap to Equirectangular
ComfyUI Node

Cubemap to Equirectangular

Stitch your six flat faces back into a panorama without wrecking it

By ProGamerGov·Created 2 years ago·Updated 11 months ago· 37
Cubemap to Equirectangular
  • e_img
  • Equirectangular Image
h-1
w-1
padding_modebilinear
cube_formatstack

You did the work on the flat faces - upscaled them, inpainted the seam, regenerated the Down face. Now you need a panorama again, because nothing downstream (save, preview, a video of the 360) wants a cubemap. That's this node's entire job: take six cube faces and re-project them into one equirectangular image.

Cubemap to Equirectangular (C2E) is the inverse of Equirectangular to Cubemap, and it's in the same ComfyUI_pytorch360convert pack. If the E2C node is the pack's starting gun, this is the finish line - almost every workflow that converts to a cubemap eventually converts back.

How it works

It wraps c2e from pytorch360convert. Each cube face's pixels are mapped back onto the sphere - the flat face is treated as the view a camera in the cube's center would see - and the spherical result is unwrapped to a 2:1 equirectangular image. padding_mode (bilinear/bicubic/nearest) controls the sampling quality at face boundaries, and bilinear is the sensible default.

The inputs that matter:

  • e_img - the cubemap, which must be a batch of exactly 6 faces. The node asserts shape[0] == 6, so if you feed it a single image you'll get an error immediately (good - it fails loud instead of producing garbage).
  • h and w - output height/width. Default -1 means "derive from the face size," which is what you want almost always. Set them explicitly only if you need a specific output resolution.
  • cube_format - must match the layout you produced in E2C: stack, dice, horizon, list, or dict. If the faces came from a dict conversion, pass dict here and the node reads the labeled faces. Mismatch the format and the six images get interpreted in the wrong order - the result is a scrambled sphere that looks broken in a very confusing way. The number one beginner trap with this node.

The output, Equirectangular Image, is the stitched 360 you can then save, preview, or feed into the rest of a pano workflow.

The quality caveat you need to hear

The author is upfront about it: converting equirect → cubemap → equirect is lossy. Each remap resamples the image, and doing it twice softens it a little. For most use it's invisible, but if you're chaining edits, the pack's Masked Diff C2E node exists specifically to avoid the double-conversion loss - it only replaces the pixels that actually changed on the faces, keeping the rest of the original pano bit-identical. If you're doing surgical edits (inpaint one region, leave the rest alone), that's the node to reach for instead of a full C2E round trip.

Install and gotchas

The pack installs via ComfyUI Manager (search "ComfyUI_pytorch360convert") or cd ComfyUI/custom_nodes && git clone https://github.com/ProGamerGov/ComfyUI_pytorch360convert. Its requirements.txt is empty, so you likely need to run python -m pip install pytorch360convert yourself - if the node fails to import, that's the cause. No checkpoints or model downloads. If your final panorama has a visible vertical seam where the left/right edges meet, that's a classic equirect problem and this pack has tools for it (Create Seam Mask plus the circular padding model/VAE nodes), not a bug in the stitch.

Categorypytorch360convert/equirectangular

Inputs (5)

NameTypeDefaultDescription
e_imgIMAGE
hINT-1
wINT-1
padding_modeCOMBObilinear3 options: bilinear, bicubic, nearest
cube_formatCOMBOstack5 options: stack, dice, horizon, list, dict

Outputs (1)

NameTypeDescription
Equirectangular ImageIMAGE