ComfyUI Node

Create Seam Mask

The node that makes the pano's seam invisible — mask it, inpaint it, move on

By ProGamerGov·Created 2 years ago·Updated 11 months ago· 37
Create Seam Mask
  • image
  • Seam Mask
frac_width0.10
pixel_width0
feather0
roll_x_by_50_percentfalse

Every equirectangular image has a seam. It's where the left and right edges meet to close the sphere, and no matter how the image was made - stitched from photos, generated by a model, converted from a cubemap - something tends to be a little off right there: a visible line, a color jump, mismatched geometry. The fix everyone uses is inpainting, but to inpaint you need a mask covering the seam, and the seam is at the edges of the image, where most mask tools are awkward.

Create Seam Mask makes that mask for you: a vertical strip, full height, positioned where you want it. Combined with this pack's roll nodes, it's the complete seam-fix recipe.

How it works

It builds a full-height vertical strip mask of a given width, centered on the image by default. Inputs:

  • image - your equirectangular image; the mask is sized to match.
  • frac_width - strip width as a fraction of the image width, default 0.1 (10%).
  • pixel_width - strip width in pixels. If it's greater than 0, it overrides frac_width (the tooltip says exactly this). Use this when you want a precise pixel width.
  • feather - softens the mask edges over N pixels, so the inpaint blends rather than leaving a hard boundary. Worth using on real seams.
  • roll_x_by_50_percent - shifts the strip to the image's left/right edges. The tooltip explains it's equivalent to a 180° rotation of the image. Since the actual seam lives at the edges, this is the option you'll reach for most.

Output is Seam Mask, a MASK tensor.

The recipe the README describes

The author's intended flow is: use Roll Image Axes with roll_x_by_50_percent set to True to roll the pano so the seam lands dead center, generate the seam mask (now it's centered by default, no roll needed), inpaint the masked strip, then roll back. That way the seam gets fixed in the most comfortable place to work - the middle of the frame - instead of hugging the edges where sampling and previews fight you.

The same trick works on masks themselves via the pack's Roll Mask Axes node, so you can keep your seam mask aligned with a rolled image. And if your pano has pole artifacts too (the stretched blobs at top and bottom), the companion Create Pole Mask covers that half of the problem.

Install

Same pack, same story: ComfyUI Manager → search "ComfyUI_pytorch360convert", or git clone https://github.com/ProGamerGov/ComfyUI_pytorch360convert into ComfyUI/custom_nodes and restart. The requirements.txt is empty, so python -m pip install pytorch360convert is likely needed by hand. No models - this is a mask you could hand-roll in any image editor, but doing it in-graph keeps everything in the same resolution and lets you feather it precisely.

Categorypytorch360convert/mask

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
frac_widthFLOAT0.10
pixel_widthINT0Width of the seam in pixels. If > 0, frac_width is ignored in favour of width_pixel.
featherINT0Pixel size of the feathering.
roll_x_by_50_percentBOOLEANfalseShifts the output mask horizontally by 50%. Equivalent to a 180 degree rotation on an equirectangular image.

Outputs (1)

NameTypeDescription
Seam MaskMASK