Nodes/comfyui-sunflower-nodes/Equirectangular to Rectilinear
ComfyUI Node

Equirectangular to Rectilinear

Turn a 360 panorama into a normal perspective photo

By andygill·Created 2 years ago·Updated 6 months ago· 1
Equirectangular to Rectilinear
  • image
  • IMAGE
input_horizontal_fov360
longitude0
latitude0
output_diagonal_fov60
width512
height512

Equirectangular is how 360 cameras and a lot of VR pipelines store a full view: the whole sphere unfolded into one wide, distorted rectangle. Great for capturing, useless for looking at - the horizon bends, verticals lean, and you can't just crop a face out of it. This node does the projection in reverse: it takes a 360 (or 180) equirect image and renders a normal, rectilinear perspective view of whatever part of the sphere you point it at.

The mechanism is standard projection math. For every output pixel it computes the ray direction through your virtual camera, converts it to spherical longitude and latitude, looks that up in the equirect image, and bilinear-samples it. Net effect: pan around a panorama and get undistorted perspective crops, as if a real camera were floating inside the 360 photo.

The inputs, most of which you'll touch:

  • image - your equirect source. Note it expects a single image; the code asserts a batch of 1.
  • input_horizontal_fov - tell it whether the source is a full 360 or a 180 half-dome. Default 360; pick wrong and the math is subtly off.
  • longitude / latitude - where you point the camera. Defaults 0/0, straight ahead. The latitude range technically goes to ±180, but anything past ±90 is geometric nonsense - keep it between -90 and 90.
  • output_diagonal_fov - the field of view of the output, 30..150 with a default of 60. Small values zoom in like a telephoto; big values go wide.
  • width / height - output resolution, default 512×512.

The single output is an IMAGE at your chosen size and fov. Wire it to a preview or Save Image and you're done.

Why you'd reach for it: you generated a 360 panorama for VR, or you've got an equirect render and want a perspective crop for some other workflow. It's also the fastest way to inspect a pano's seams and details at actual viewing scale instead of the bent sphere.

Expect a black border on the output - out-of-range samples get zero-padded, and that's by design. If you see a hard vertical seam cutting through the middle, you've pointed the camera right at longitude ±180, where the sphere wraps; the author left a TODO about 360 wrapping, so just nudge the longitude off the seam rather than expecting it to wrap cleanly. And if things come out blurrier than you'd like with a high output_diagonal_fov, that's a limited slice of the sphere being stretched to a big canvas - raise the fov or shrink the output rather than blaming the sampler.

Install it via ComfyUI Manager - search comfyui-sunflower-nodes - and restart, or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/andygill/comfyui-sunflower-nodes

Then restart ComfyUI. No model files, no extra dependencies; it's pure numpy/torch projection code. One caveat to file away: the repo has been quiet since spring 2025 and is currently offline, so if that clone 404s, an archived copy of the code installs identically.

Categoryimage/transform

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
input_horizontal_fovCOMBO3602 options: 180, 360
longitudeINT0-180–180
latitudeINT0-180–180
output_diagonal_fovINT6030–150
widthINT5121–16384
heightINT5121–16384

Outputs (1)

NameTypeDescription
IMAGEIMAGE