Nodes/ComfyUI_Lam/全景图转球面图
ComfyUI Node

全景图转球面图

Turn an equirectangular panorama into a spherical (fisheye) view

By yanlang0123·Created 2 years ago·Updated about a month ago· 76
全景图转球面图
  • images
  • 图片

If you work with 360° imagery, you've met the two coordinate systems that both call themselves "panorama." An equirectangular image is the flat unwrapped map of a sphere - 2:1, stretched at the poles. A spherical (or fisheye/dome) projection is what the sphere actually looks like from the inside - a circle with the distortion pushed to the edges. LamPanorama2Spherical (全景图转球面图) converts the former to the latter, in place, inside your ComfyUI graph.

Why would you want that in a workflow? The honest answer: mostly as one half of a round-trip. The classic trick is to convert your equirectangular panorama to spherical, do your edits/inpainting on that projection, then convert back with LamSpherical2Panorama. Some tools and models also just expect a spherical/dome input (projector mapping, VR skybox pipelines), and this node hands it to them without leaving the graph.

How it works

It's a pure image remap with OpenCV: for each pixel of the output square it computes the corresponding polar coordinates (radius from center, angle) and samples the source panorama, using Lanczos interpolation for quality. The author even left a note in the source about bumping the intermediate resolution - the remap now uses the image height as the radius, so you don't lose the vertical detail the older math did. The output is a square image (diameter = 2× source height). Black border where the sphere falls off.

Inputs and outputs

  • images (required) - an IMAGE batch. It processes each frame in the batch independently, so animated equirectangular footage works too.
  • 图片 (output) - the spherical-projection images, same batch size.

Install

Part of the ComfyUI_Lam pack:

cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam

or via ComfyUI Manager, then the README's install + 修改文件 steps. Needs OpenCV (opencv-python), which is in the pack's requirements.

Gotchas

The output size is derived from the source height, not your choice - a 4096×2048 equirect gives you a 4096×4096 sphere. That's a 4x pixel jump, so watch memory on batches. And remapping is lossy at the edges: the poles of the equirect (the extreme top/bottom rows) get compressed into the outer ring of the sphere, so heavy edits there can show seams when you convert back. For inpainting workflows, work on the spherical image and accept some edge stretch, or keep your edits away from the rim.

Categorylam

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
图片IMAGE