Nodes/comfyui-dap/DAP ERP to Cubemap
ComfyUI Node

DAP ERP to Cubemap

360° photo to cubemap, six faces at once

By maxious·Created 8 months ago·Updated 8 months ago· 1
DAP ERP to Cubemap
  • image
  • image
face_size1024
layoutsix_faces
interpolationlanczos

DAP ERP to Cubemap converts an equirectangular (2:1) panorama into cube map faces. It's the quiet utility of the pack - no model involved, no heavy lifting, just a conversion you'll reach for because almost nothing downstream wants a panorama in its native form.

Equirectangular images are the storage format for 360° captures: a 2:1 rectangle where the whole sphere is stretched flat. Great for cameras and for neural networks (DAP is trained on them), awkward for everything else. Game engines, many 3D viewers, skybox loaders, and a lot of mesh/texture tooling want cube faces instead - six square images, each a 90° view. That's the gap this node fills.

How it works

For each of the six faces (right, left, top, bottom, front, back - the standard OpenGL ordering) it builds a UV remap and resamples from the equirectangular source with OpenCV's remap. The nice detail is BORDER_WRAP: instead of clamping at the image edge, it samples across the wrap boundary, so each face's edge stays seamless with its neighbor. No visible seams where the cube folds.

Inputs and outputs

  • image - the equirectangular panorama. 2:1 aspect ratio is assumed, so feed it a true ERP.
  • face_size - default 1024, range 256–4096 in steps of 64. The resolution of each cube face. This is the knob that controls memory: six faces at 4096 is a lot of VRAM, six at 1024 is very comfortable.
  • layout - six_faces (default) or cross. six_faces returns a batch of 6 images - one per cube face, in right/left/top/bottom/front/back order. cross returns a single image laid out in the classic 3×4 strip, which is mostly useful for eyeballing the whole cube at once or feeding old-school tools that expect that format.
  • interpolation - lanczos (default), cubic, linear, nearest. Lanczos is the right default for quality; nearest is there if you're doing something fast and loose.

The single image output is a batch tensor in six_faces mode, not a grid - each face is its own image in the batch, so you can preview them individually or split them with the usual image-manipulation nodes.

Install and usage

Standard for the pack: Manager → "comfyui-dap", or git clone --recursive https://github.com/maxious/comfyui-dap into custom_nodes, then pip install -r requirements.txt in the ComfyUI venv. Note this is the one node in the pack that doesn't need the DAP model at all - the conversion is pure OpenCV math - so you can use it on any equirectangular image you have, generated or shot.

Common gotchas

  • Wrong aspect input - it assumes 2:1. A squashed or padded image gives distorted faces; make sure your input is a true equirect.
  • Face order surprises you - right, left, top, bottom, front, back is the ordering, which isn't always the order downstream tools assume. Check the docs of whatever you're feeding the batch into.
  • cross vs six_faces - don't assume the single-image cross layout is what a mesh tool wants. Most 3D tooling wants the six-face batch. The cross is a preview format.

It's a small node that does one conversion well. If you work with 360° imagery at all, it'll quietly become a fixture in your graphs.

CategoryDAP/Conversions

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
face_sizeINT1024256–4096
layoutCOMBOsix_faces2 options: six_faces, cross
interpolationCOMBOlanczos4 options: lanczos, cubic, linear, nearest

Outputs (1)

NameTypeDescription
imageIMAGE