Equirectangular Rotation
The correct way to spin a 360 — yaw, pitch, and roll without breaking the projection
- e_img
- Rotated Image
Rotating a normal image is easy - roll the pixels. Rotating an equirectangular image correctly is not, because the image is a sphere flattened into a rectangle and a naive pixel shift only handles one axis. Pan the camera up and the whole projection should warp, not slide. Equirectangular Rotation (E2E, for "equirect to equirect") is the node that does this the right way: a proper 3D rotation of the sphere, re-projected back to 2:1.
Why would you want to rotate a panorama at all? Mostly to move the seam, and to re-orient a skybox so it "starts" at a different direction. The pack README's seam-fixing recipe is: rotate the pano so the visible seam lands dead center, mask and inpaint it there, then rotate back. That whole workflow starts here.
How it works
It wraps e2e from pytorch360convert. The equirect image is sampled onto the sphere, rotated in 3D by the three angles you give it, and re-projected flat. The inputs:
- e_img - the equirectangular image.
- roll - rotation around the camera's view axis (the "tilt your head" axis). In degrees.
- h_deg - yaw. This is your horizontal pan, and it wraps around: 360° of h_deg is a full spin. A 180° yaw is exactly equivalent to shifting the image horizontally by half its width.
- v_deg - pitch, looking up (positive) or down (negative).
- padding_mode - sampling mode at the re-projection, bilinear default.
Output is a single Rotated Image, same format as the input.
The gotcha that will save you hours
This pack also ships a Roll Image Axes node that does a dumb horizontal/vertical pixel roll, and the README is careful to warn you: y-axis rolls (vertical shifts) are not correct for final equirectangular outputs, because in a real sphere a vertical shift is a pitch rotation that warps the projection. If you just torch.roll a pano vertically, the poles smear and the geometry is wrong. Use E2E for anything you're keeping as a final equirectangular. The dumb roll has its uses - it's fine for bringing a seam to the center where you'll inpaint and fix it - but for any "this is the finished panorama" rotation, E2E is the one.
A smaller practical note: rotating is a resample, so it softens the image a little, same as any conversion. If you're doing a rotate-inpaint-rotate-back cycle, keep rotations to a minimum and do the heavy editing in between.
Install
Same story as the whole pack: install via ComfyUI Manager (search "ComfyUI_pytorch360convert") or git clone https://github.com/ProGamerGov/ComfyUI_pytorch360convert into ComfyUI/custom_nodes and restart. The pack's requirements.txt is empty, so you'll probably need python -m pip install pytorch360convert yourself. No model downloads. If you're doing the seam-fix dance, pair this with Create Seam Mask (which has a roll_x_by_50_percent shortcut so your mask lands on the seam you just rotated to center) and the Mask Equirectangular Rotation node so your masks stay aligned with the rotated image.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| e_img | IMAGE | — | |
| roll | FLOAT | 0.00 | — |
| h_deg | FLOAT | 0.00 | — |
| v_deg | FLOAT | 0.00 | — |
| padding_mode | COMBO | bilinear | 3 options: bilinear, bicubic, nearest |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Rotated Image | IMAGE | — |