Roll Image (Wrap)
Shove the 360° seam out of your way without resampling a single pixel
- image
- rolled_image
Every equirectangular (2:1) 360° image has one thing you didn't ask for: a seam. The left and right edges of the panorama are the same point in space, and when you process or inpaint across that boundary, the world visibly doesn't line up. Roll Image (Wrap) is the node that moves that seam somewhere else - usually to the middle of the frame - so you can work, then roll it back. No reprojection, no resampling, no quality loss. It's the digital equivalent of spinning a globe until the meridian you don't want to look at is behind you.
It ships in the LatLong pack from cedarconnor, a collection of equirectangular processing nodes. The README's own seam-inpaint recipe puts it front and center: roll 50% → Create Seam Mask → inpaint/composite → roll back → optionally Equirectangular Edge Blender. If you've ever fought a visible line running down a generated panorama, this is the workflow you were missing.
How it works
Under the hood it's a single torch.roll - a pure circular shift along the width and height axes. Pixels that fall off one edge wrap around to the other, and nothing is interpolated or redrawn. That's why it's instant and lossless where Equirectangular Rotate is doing a real spherical transform. Because it's just a tensor shift, it handles whole batches and huge resolutions without any special casing.
Only a few inputs matter, and honestly two of them do the work:
image- your equirectangular tensor, batch(B,H,W,C)in [0,1].roll_x/roll_y- horizontal and vertical shift in pixels (range ±8192). Negative values roll the other way.roll_x_by_50_percent- a checkbox that setsroll_xto exactly half the image width (a 180° shift) and overrides the manual values. This is the one you'll reach for in the seam workflow.
Output is a single rolled_image at the same size, ready to feed an inpainting setup or the pack's Equirectangular Edge Blender on the way out.
How to install
It's part of the LatLong pack, so install the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong.git
cd comfyui-LatLong
pip install -r requirements.txt
Restart ComfyUI, or install it the lazy way via ComfyUI Manager (search "LatLong"). Dependencies are just numpy, opencv-python, scipy, torch and Pillow - nothing exotic, and no model files to download. If you only use this node, you could even get away without opencv/scipy, since torch.roll is pure PyTorch; pip installing the requirements anyway keeps the rest of the pack happy.
Gotchas
- The 50% checkbox overrides both manual rolls. If your image "didn't move," that toggle is why.
- This shifts, it doesn't rotate. If you want yaw/pitch/roll camera control, you want Equirectangular Rotate instead - roll is for moving the seam, not steering the view.
- The ±8192px range covers anything up to ~16K wide. That's beyond what most people process, and if you're somehow in 32K territory, chain two rolls.
For a one-parameter node that does one trick, it earns its place: it's the difference between a panorama with a visible seam and one where the horizon wraps around cleanly.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image batch (B,H,W,C) to roll. | |
| roll_xopt | INT | 0-8192–8192 | Horizontal roll (pixels). |
| roll_yopt | INT | 0-8192–8192 | Vertical roll (pixels). |
| roll_x_by_50_percentopt | BOOLEAN | false | Set roll_x to half the image width (180° equirectangular shift). Overrides roll_x/roll_y. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| rolled_image | IMAGE | — |