Nodes/ComfyUI_pytorch360convert/Face Mask to Equirectangular
ComfyUI Node

Face Mask to Equirectangular

Put a face mask back into the pano, aligned to the same projection

By ProGamerGov·Created 2 years ago·Updated 11 months ago· 37
Face Mask to Equirectangular
  • mask
  • Equirectangular Mask
faceDown
base_equi_color0.00
padding_modebilinear

Face Mask to Equirectangular is the return trip for masks in this pack's single-face workflow. You did your masked editing on a flat cube face - because that's where masks behave like masks - and now the mask needs to come back into equirectangular space so it lines up with the pano you're about to composite into. It takes a single face mask and rebuilds a full equirectangular mask around it, with every other face filled with a flat value.

Like its image counterpart Face to Equirectangular, the output is not your original mask with the face dropped in. It's a fresh full-pano mask where one face is your mask and the other five are a constant color. That's the building-block design - you use it to composite, not to replace.

Inputs

  • mask - your flat face mask (MASK tensor).
  • face - which face it belongs to: Up, Down, Front, Right, Left, Back (default Down - the nadir, where the tripod hole lives).
  • base_equi_color - the fill value for the other five faces, default 0.0 (mask-off).
  • padding_mode - sampling mode for the conversion, bilinear default.

Output is Equirectangular Mask, sized like the pano.

How it works

It builds a cubemap dict with your mask on the chosen face and base_equi_color elsewhere, then runs c2e from pytorch360convert to project it back to a 2:1 equirectangular mask. Same conversion path the image twin uses, which is the whole point: if you extract with Equirectangular Mask to Face and reinsert with this node using the same face and settings, the mask lands exactly where it started.

The workflow

The full round trip: mask the pole in the pano → Equirectangular Mask to Face to get the flat mask → inpaint the face image (masked) → Face to Equirectangular to rebuild the pano with the new face → Face Mask to Equirectangular to rebuild the mask. Composite the new pano into the original using the mask, and only the edited region changes - the rest of the pano stays bit-identical. That's the surgical-edit pattern the whole pack is built around, and this node is the "don't lose your mask" piece of it.

The face and base_equi_color settings need to match what you used on the image side, and the mask will be slightly softened by the resample - usually a feature, since soft mask edges blend better.

Install

Same pack, same install: ComfyUI Manager → "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 required by hand. No model downloads.

Categorypytorch360convert/mask

Inputs (4)

NameTypeDefaultDescription
maskMASK
faceCOMBODown6 options: Up, Down, Front, Right, Left, Back
base_equi_colorFLOAT0.00
padding_modeCOMBObilinear3 options: bilinear, bicubic, nearest

Outputs (1)

NameTypeDescription
Equirectangular MaskMASK