Create Pole Mask
Mask the top and bottom of your 360°
- image
- pole_mask
The poles are where equirectangular projection lies to you. The top and bottom of a 360° panorama are tiny patches of the sphere stretched across the whole image width, so whatever the camera saw straight up or down - usually a smeared ceiling or a soft bit of floor - is the lowest-quality region in the whole frame. Create Pole Mask is the node that lets you target exactly those regions for an inpaint pass.
Think of it as the seam mask's sibling, pointed at a different problem. The seam mask handles the vertical wrap; this one handles the poles, and it does it in two modes depending on where you're working:
facemode - makes a centered circle mask on a single cubemap face. This is for when you're working with cube faces (the top and bottom faces of a cubemap are where the poles live as circles in the middle of the square).equirectangularmode - the clever one. It creates the circular pole masks on the Up and Down cube faces first, then maps those masks back into equirectangular space. That gives you a pole mask that correctly targets the stretched pole regions inside your panorama - the right shape for inpainting the top and bottom bands of a 2:1 image.
How it works
The circle is defined by a radius and an optional feather:
circle_radius(default 0.10) - radius as a fraction of the max possible (min(H,W)/2).pixel_radius(default 0) - exact radius in pixels; overridescircle_radiusif greater than 0.feather(default 0) - softens the circle's edge by that many pixels.
In face mode the input image must be a square face (H==W) - the node raises an error otherwise, which is its way of telling you you've fed it the wrong thing. In equirectangular mode you also get face_size (optional, default 512) to pick the cube-face resolution used to generate the pole mask; set it to −1 for auto (H/2 of your panorama).
Output is a single pole_mask, mask-convention-standard: 1 = regenerate, 0 = keep.
Installing it
Standard pack install - Manager search "LatLong", or:
cd ComfyUI/custom_nodes
git clone https://github.com/cedarconnor/comfyui-LatLong
cd comfyui-LatLong
pip install -r requirements.txt
Restart ComfyUI. Under LatLong/Mask. Deps: numpy, opencv-python, scipy, torch, Pillow; no model downloads.
Gotchas
The mode mismatch is the classic stumble. If you feed an equirectangular panorama (2:1, not square) into face mode, the node refuses with a "square faces expected" error - that's the signal to switch modes, not to crop your image to a square. And don't expect magic: even a perfectly targeted pole mask can't make a model invent detail the source never had. The pole region is genuinely low-information, so pair the inpaint with a prompt that describes plausible sky/ceiling, or accept some smoothness at the top and bottom - that's the honest cost of the 360° format.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Reference IMAGE (face or equirectangular) used to size the mask. | |
| circle_radius | FLOAT | 0.100–1 | Circle radius as a fraction of the max possible radius (min(H,W)/2). Ignored if pixel_radius > 0. |
| pixel_radius | INT | 00–8192 | Circle radius in pixels (overrides circle_radius if > 0). |
| feather | INT | 00–4096 | Feather width in pixels. |
| mode | COMBO | face | face: mask matches input face dimensions. equirectangular: creates masks on Up/Down cube faces then maps back to equirectangular. |
| face_sizeopt | INT | 512-1–4096 | Only used for mode=equirectangular. Cubemap face size to generate the pole mask. Set to -1 for auto (H//2). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pole_mask | MASK | — |