Nodes/IG Interpolation Nodes/🌐 IG PointCloud From Cylindrical
ComfyUI Node

🌐 IG PointCloud From Cylindrical

Wrap a 360Β° panorama + depth into a full surround point cloud

By IDGallagherΒ·Created 3 years agoΒ·Updated about a year agoΒ· 3
🌐 IG PointCloud From Cylindrical
  • rgb_image
  • depth_image
  • pointcloud
β—„focal_length_px-1β–Ί
β—„principal_y_px-1β–Ί
β—„stride1β–Ί

IG PointCloud From Cylindrical is the sibling of the plain pointcloud node, and the difference is the camera model. The flat version assumes a pinhole looking out through a rectangular window; this one assumes you're standing at the center of an equirectangular 360Β° panorama, looking in every direction at once. Same job - RGB plus metric depth in, [N, 6] point cloud out - but the geometry wraps around you, which is exactly what you want for a 360Β° scene reconstruction or a VR-style environment.

The math is a yaw/pitch sweep rather than a pinhole grid. Each pixel maps to a yaw ΞΈ = 2π·u/W βˆ’ Ο€ (so the image wraps seamlessly left-to-right) and a pitch computed from the pixel row and focal length. The direction vector is (cosφ·sinΞΈ, sinΟ†, cosφ·cosΞΈ), and the point's position is that direction scaled by its metric depth. That wrap behavior is the whole point - a normal projection would tear at the seam where the panorama meets itself, and this node's horizontal FOV is fixed at 360Β° so there's no seam to tear.

Inputs:

  • rgb_image - IMAGE, the equirect panorama.
  • depth_image - IMAGE, metric depth at the same resolution.
  • focal_length_px - FLOAT, default -1, which here falls back to W / 2Ο€ - the focal length of a unit-radius cylinder, a sensible starting point for a full pano.
  • principal_y_px - INT, default -1 (image center). Note there's no principal x: since yaw spans the full 360Β°, there's no horizontal offset to tune.
  • stride - INT, default 1. Sub-sample every Nth pixel to cut the point count down; panoramas at full resolution produce enormous clouds, and stride is the knob to pull first.

Output: pointcloud - the [N, 6] tensor. Batch size must be 1; resolutions must match between RGB and depth.

The depth-map caveat from the flat version carries over and then some: you need metric depth (Depth Anything v2, ZoeDepth), not the relative output of MiDaS, or the surround geometry will be badly distorted - distances in meters is what makes the cylinder actually round. A metric-depth estimate on an equirect panorama is a bit of an unusual request, so expect to generate the depth map yourself rather than finding a turnkey preprocessor for it.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/ComfyUI-IG-Nodes
cd ComfyUI-IG-Nodes && pip install -r requirements.txt

Or ComfyUI Manager β†’ search "IG Interpolation Nodes" β†’ Install, restart. Feed its output to IG Save PLY PointCloud and you can open the result in any PLY-capable viewer. The README is :), so the projection formulas above come from nodes/pointcloud_cylindrical.py.

CategoryπŸ“ IG Nodes/IO

Inputs (5)

NameTypeDefaultDescription
rgb_imageIMAGEβ€”
depth_imageIMAGEβ€”
focal_length_pxFLOAT-1-1–99999999β€”
principal_y_pxINT-1-1–99999999β€”
strideINT1β€”

Outputs (1)

NameTypeDescription
pointcloudPOINTCLOUDβ€”