ComfyUI Node

Roll Image Axes

Roll the seam out of your 360 — seam repair starts here

By ProGamerGov·Created 2 years ago·Updated 11 months ago· 37
Roll Image Axes
  • image
  • Rolled Image
roll_x0
roll_y0
roll_x_by_50_percentfalse

Equirectangular 360° images have a dirty secret: the left edge and the right edge are the same point in space. So when you generate one, whatever the model does at that seam - a color break, a duplicated building, a row of artifacts - gets wrapped around and repeated. Fixing it means getting that seam somewhere you can actually work on it, and that's what "Roll Image Axes" does: it shifts the whole image sideways (or vertically) with everything wrapping around, so the seam lands where you want it instead of where the generator left it.

It's from the pytorch360convert pack, ProGamerGov's collection that wraps the pytorch360convert library as ComfyUI nodes. Think of this node as the "reposition the damage" tool in a bigger seam-repair workflow.

How it works

It's a torch.roll - pixels that leave one edge re-enter on the opposite edge. Nothing is cropped, nothing is lost, the image just shifts with wraparound. For an equirectangular image, a horizontal roll is a genuine rotation of the whole environment around the vertical axis, so it's perfectly valid to do this on your final output.

Three inputs matter:

  • roll_x - how many pixels to shift left/right. Positive values roll one way, negative the other.
  • roll_y - vertical shift. Careful here: the README is explicit that rolling along the height is not geometrically correct for a final equirectangular image. A horizontal roll is a real rotation; a vertical roll is just a flat image shift that breaks the spherical projection. If you want a proper vertical rotation, use the pack's "Equirectangular Rotation" (E2E) node instead.
  • roll_x_by_50_percent - the one beginners actually reach for. Toggles to ignore both roll_x and roll_y and just shift horizontally by half the image width. On an equirectangular image that's exactly a 180° rotation, which is the standard move for seam work: it puts the seam dead center where your inpainting and masking nodes are happiest working.

Output is Rolled Image, an IMAGE you can wire into inpaint, mask compositing, or another roll.

The classic workflow

The author's own docs lay this out: set roll_x_by_50_percent to True to move the seam to the center, use the pack's "Create Seam Mask" to build a mask right over that seam, inpaint the boundary, and then roll back (or wrap) to put things where they started. It's the seam-repair loop this pack is built around, and it's genuinely handy - 360 generation artifacts at the wrap point are the single most common way people notice a bad skybox.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/ProGamerGov/ComfyUI_pytorch360convert
python -m pip install pytorch360convert

Or just use ComfyUI Manager and search "ComfyUI_pytorch360convert". The only dependency is the pytorch360convert library - no models, no weights, no download marathon.

Gotchas

  • Don't use roll_y on an image you're about to call "final" - it produces a flat shift, not a spherical rotation. Your environment will look subtly wrong.
  • The roll is exact: if you roll 50% one direction to work on the seam, roll 50% the other way to put it back. The math doesn't drift, but your mask alignment can - which is exactly what "Roll Mask Axes" exists to fix.
  • Half-width rolls on odd-width images round down by a pixel. Not worth losing sleep over, but if you're doing pixel-perfect seam repair, mind it.
Categorypytorch360convert/miscellaneous

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
roll_xINT0
roll_yINT0
roll_x_by_50_percentBOOLEANfalseIgnores roll_x and roll_y. Shifts image horizontally by 50%.

Outputs (1)

NameTypeDescription
Rolled ImageIMAGE