ComfyUI Node

Roll Mask Axes

The little node that keeps your seam mask honest

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

This is the mask-sized sibling of "Roll Image Axes", and if you've already met that node you basically know this one. It takes a mask and shifts it with wraparound - same torch.roll mechanics, same inputs, but for MASK tensors instead of images. Output is a Rolled Mask.

Why does that matter? Because in the pack's signature seam-repair workflow you roll your 360 image 50% to drag the seam to the center, mask the seam, inpaint it, and roll everything back. Your image and your mask have to move together, or your inpaint region lands on the wrong sky. Roll the mask by the same amount and it stays glued to the seam you're actually trying to fix.

The inputs are the same trio as the image version:

  • roll_x - horizontal pixel shift.
  • roll_y - vertical shift. Same caveat as the image node: fine for working, wrong for final equirectangular output.
  • roll_x_by_50_percent - the one you'll actually use. Ignores roll_x/roll_y and shifts the mask horizontally by half the image width. The tooltip says the key thing outright: on an equirectangular image this is exactly a 180° rotation. So generate your seam mask on the un-rolled image, then roll the mask 50% to line it up with your rolled image - or vice versa.

The workflow it slots into

Concretely: set "Roll Image Axes" to roll_x_by_50_percent, then build a "Create Seam Mask" on the rolled image (or roll the mask to match a seam mask you built earlier), inpaint the masked seam, and roll both back by the same 50%. The author designed these three nodes to play together, and they do - this one is just the piece that keeps your mask aligned through the round trip.

Installing it

Same as the rest of the pack - one clone, one small library:

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

Or ComfyUI Manager, search "ComfyUI_pytorch360convert". No model downloads.

Gotchas

  • Masks from "Create Seam Mask" are already positioned for the seam's current location - if you roll the image but not the mask, your inpaint region will be floating over clean sky.
  • If you're only working on the image and never touch a mask, you don't need this node at all. It exists precisely for the case where image and mask must move together.

It's a thin utility and proud of it: three inputs, one output, no surprises. When your seam repair suddenly works, this is usually why.

Categorypytorch360convert/mask

Inputs (4)

NameTypeDefaultDescription
maskMASK
roll_xINT0
roll_yINT0
roll_x_by_50_percentBOOLEANfalseShifts the input mask horizontally by 50%. Equivalent to a 180 degree rotation on an equirectangular image.

Outputs (1)

NameTypeDescription
Rolled MaskMASK