ComfyUI Node

Equirectangular Crop 180

Cut a 180° window out of a 360° panorama — the social-media money crop

By cedarconnor·Created about a year ago·Updated 7 months ago· 2
Equirectangular Crop 180
  • image
  • cropped_image
output_width1024
output_height512
maintain_aspecttrue
center_longitude_deg0.0
fov_degrees180
interpolationlanczos

A 360° photo is great until you have to show it to someone on a flat screen. Equirectangular Crop 180 is the node that pulls a wide horizontal window out of the panorama - half the world by default, or any FOV you set - and hands it back as a normal-looking image you can post or print.

Think of it as "what you'd see if you turned your head from one side to the other." The default fov_degrees of 180 covers half the sphere, which is the classic immersive-but-flat presentation: wide, wraparound, and big enough that the perspective still reads as "you're inside this." Drop the FOV to 120 or 90 and you get a tighter, less distorted slice.

How it works

The node re-projects a horizontal window of the sphere onto a flat rectangle, centered on a longitude you choose. The center_longitude_deg input picks what's dead center - 0° is the front of the panorama, and you can pan left or right in degrees up to ±180. The fov_degrees input is the window's horizontal width. Because it's a projection (not just a rectangle slice of pixels), the result is geometrically consistent: straight lines in the world stay straighter than they'd ever look in a raw equirectangular crop.

maintain_aspect (on by default) is what keeps it honest. It computes the crop's native height so the proportions match what the FOV actually covers on the sphere, instead of stretching your chosen output height over the wrong shape. With it on, your output_height is overridden; turn it off if you want a specific pixel size no matter what.

Inputs that matter

  • image (required) - equirectangular tensor (B,H,W,C) in [0,1].
  • output_width (default 1024) - the crop's width.
  • maintain_aspect - on by default; off if you need a fixed height.
  • center_longitude_deg (default 0) - where the window is centered.
  • fov_degrees (default 180, range 1–360) - how wide the window is. Yes, it goes all the way to 360, which is just the whole panorama back.
  • interpolation - lanczos default, keep it.

Output is a single cropped_image.

Installing it

Same pack install, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong
cd comfyui-LatLong
pip install -r requirements.txt

Or just install "LatLong" via ComfyUI Manager and restart. Node under LatLong. Deps: numpy, opencv-python, scipy, torch, Pillow; no model downloads.

Gotchas

Two things to know. First, wide FOVs distort - a 180° window pushed into a rectangle stretches the edges noticeably. That's inherent to flatting the sphere, not a bug; if the edge stretch bothers you, shrink the FOV. Second, the node crops through projection, so if you're coming from a plain rectangle crop expecting "just the middle pixels," this is doing more than that - which is exactly why the result looks right and the rectangle crop doesn't. For a true center-pixel square crop, that's the separate Crop Square node.

CategoryLatLong

Inputs (7)

NameTypeDefaultDescription
imageIMAGEEquirectangular input image tensor (B,H,W,C) in [0,1].
output_widthoptINT102464–8192Target width of the extracted window in pixels.
output_heightoptINT51264–8192Target height of the extracted window in pixels (overridden if Maintain Aspect).
maintain_aspectoptBOOLEANtruePreserve the natural aspect ratio of the selected FOV by adjusting height.
center_longitude_degoptFLOAT0.0-180–180Longitude center of the crop in degrees (0° is center).
fov_degreesoptFLOAT1801–360Horizontal field of view to extract (degrees).
interpolationoptCOMBOlanczosResampling filter for resizing after extraction.

Outputs (1)

NameTypeDescription
cropped_imageIMAGE