Nodes/ComfyUI Essentials/🔧 Mask Flip
ComfyUI Node Runs on cloud

🔧 Mask Flip

Mirror a mask without touching the image it's paired with

By cubiq·Created 3 years ago·Updated about a year ago· 1,155
🔧 Mask Flip
  • mask
  • MASK
◄axis▾►

Exactly what it says on the tin: Mask Flip mirrors a mask horizontally, vertically, or both, independent of whatever image it's paired with. Reach for it when you've built a mask for one side of a symmetric subject and want the mirror version for the other side, or when something upstream flipped the image and you need the matching mask flipped to stay in sync with it.

It shows up most often paired with an image-flip step: augmenting a small dataset by mirroring both image and mask together, testing whether a ControlNet or inpaint region behaves the same reflected as it does normally, or fixing a mask that was drawn against a reference photo shot the "wrong way round" from your working canvas. None of that needs a general-purpose image editor - a mask by itself doesn't have a left or right until you decide it does, and this node is the one-node way to decide that.

How it works

axis picks the flip direction: x, y, or xy for both at once. There's no other configuration - it's a one-parameter node, and that's not a limitation, it's the whole job.

Inputs and outputs

mask, axis (enum: x / y / xy). Output: MASK.

Installing it

Via ComfyUI Manager, search "ComfyUI Essentials". Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_essentials

Restart. Pack's been maintenance-only since April 2025 - this particular node is simple enough that "maintenance-only" barely matters; there isn't much surface area left to break.

Common issues & troubleshooting

There's genuinely not much to go wrong here, which is the appeal. The one real gotcha: if a masked region ends up on the wrong side of your subject after this node, check whether the paired image also needs flipping (or already was, and didn't need to be) - this node only ever touches the mask, never the image, so keeping the two in sync is on you. If you're chaining this after an image-flip node, make sure both are set to the same axis, or you'll end up with a flipped image and a mask that's still pointing at the original orientation.

Non-symmetric masks flip fine but stop making sense. Flipping is a pure geometric operation - it doesn't know or care whether the result is meaningful. Mirroring a mask that was shaped specifically for an asymmetric feature (a scar on one cheek, hair falling to one side) will happily hand you a technically-correct but semantically-wrong mask. This node can't tell the difference between "this should be mirrored" and "this really shouldn't"; that judgment call is yours.

Categoryessentials/mask

Inputs (2)

NameTypeDefaultDescription
maskMASK—
axisCOMBO3 options: x, y, xy

Outputs (1)

NameTypeDescription
MASKMASK—