Nodes/ComfyUI-PepeUtils/Pepe Equirectangular to Cylindrical
ComfyUI Node

Pepe Equirectangular to Cylindrical

Wrap a panorama around a cylinder and unroll it, seam-free

By Pepehoschi·Created 5 months ago·Updated 2 days ago· 0
Pepe Equirectangular to Cylindrical
  • image
  • cylindrical
output_width0
output_height0
max_latitude57.5

A cubemap gives you six faces; cylindrical projection gives you something else entirely - the whole horizon in one continuous strip with straight verticals and no visible seams. That's what Pepe Equirectangular to Cylindrical does: it projects your 2:1 equirectangular panorama onto the side of an imaginary vertical cylinder, then unrolls the cylinder into a flat image. Left and right edges wrap around to meet each other, so the result tiles perfectly.

If you've ever wanted a "de-warped" version of a 360 image - one where vertical lines actually stand up straight instead of bowing - this is the projection for it. It's the projection of choice for anything where you want the horizon treated as a straight line over a long horizontal span.

How it works

The math is refreshingly simple once you've seen the equirectangular case. Longitude maps to horizontal position, and physical height on the cylinder surface maps to vertical position. The node then samples the source image along rays out to the cylinder, again with the same torch grid-sampling used by the pack's other projection nodes. Because longitude is periodic, the image wraps: the last column and the first column are neighbors on the sphere, so the unrolled result is seamless.

The inputs that matter:

  • output_width - leave at 0 to keep the panorama's own width, or set a pixel width (up to 16384).
  • output_height - 0 (default) computes square distances on the cylinder surface, meaning equal horizontal and vertical surface distance per pixel. That's the setting that keeps the geometry honest.
  • max_latitude - how far north and south you keep (defaults to roughly 57.52°, which is atan(π/2)). The default is chosen so a normal 2:1 panorama keeps its original dimensions. Raise it to include more of the poles and the automatically calculated height grows; lower it to crop toward the equator.

The output is a single cylindrical IMAGE.

Why you'd reach for it

The headline use is a tileable horizon texture: because the cylinder unrolls seamlessly, the result wraps around forever without a seam, which makes it great as a backdrop texture or a source for looping panorama animation. It's also the more faithful projection for many panorama displays - a cubemap has six discrete faces, a cylinder is one continuous strip.

Installing it

Same pack, same install as the rest of the PepeUtils nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Pepehoschi/ComfyUI-PepeUtils.git

or ComfyUI Manager → search ComfyUI-PepeUtils, then restart. No extra dependencies - torch and the ComfyUI image stack are all it needs.

Gotchas

The one mathematical limit worth internalizing: the poles can't be included. At latitude 90° the cylinder height approaches infinity, so a finite image can never hold the exact north and south poles - max_latitude is capped at 89 for that reason. If you need the full sphere including poles, you want a different projection (an equirectangular or cubemap representation), not a cylinder. And as always with this pack, feed it a 2:1 equirectangular input or the geometry will be off.

CategoryPepeUtils/image

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
output_widthINT00–16384Output width; 0 preserves the panorama width
output_heightINT00–16384Output height; 0 uses square distances on the cylinder surface
max_latitudeFLOAT57.51–89North/south latitude limit; poles cannot fit on a finite cylinder

Outputs (1)

NameTypeDescription
cylindricalIMAGE