ComfyUI Node

Equirectangular Mirror/Flip

Mirror or flip a panorama without breaking the sphere

By cedarconnor·Created about a year ago·Updated 7 months ago· 2
Equirectangular Mirror/Flip
  • image
  • flipped_image
mirror_horizontalfalse
mirror_verticalfalse

Two booleans. That's the entire interface of Equirectangular Mirror Flip: flip it left-right, flip it top-bottom, or both. It's the node you reach for when the panorama came out of the camera upside down, or when you want a mirrored world for a creative effect, or when you've round-tripped through a cubemap and the orientation came back wrong.

The thing that makes it equirectangular-aware rather than a generic image flip is where it lives in your workflow. Flip any image and you flip a picture; flip a 360° panorama and you need to think about what happens to the wrap. When you mirror a panorama horizontally, the content at the left edge has to stay continuous with the content at the right edge - the mirror has to happen around the sphere, not as a flat rectangle reversal. That's the "proper spherical wrapping" this node's description is about.

How it works

Honest mechanism time: the implementation is a plain np.fliplr for mirror_horizontal and np.flipud for mirror_vertical on the image tensor. That sounds trivial, but for an equirectangular image those two operations are the spherical mirrors - flipping the image left-right reverses the longitude mapping, and flipping top-bottom inverts the latitude. Since a 2:1 equirectangular's left and right edges are the same line of longitude (the ±180° seam), a left-right mirror maps that seam onto itself and the result stays a valid, wrappable panorama. Nothing falls off the sphere.

So what each flag does, straight from the author's tooltips:

  • mirror_horizontal (default off) - flip left-right: reverses longitude.
  • mirror_vertical (default off) - flip top-bottom: inverts latitude.

Both on at once is equivalent to a 180° roll of the view. The output is a single flipped_image.

Why you'd use it

The most common real-world case is fixing a mount: a 360° camera installed upside down, or a source that came out of another tool with the poles swapped. Mirroring is also the cheap way to get a mirror-reflection effect in a scene that's supposed to be a mirror hall or a symmetric space - though remember a mirror flips handedness, so text in the scene will read backwards (that's what a mirror does; if you wanted to reorient without mirroring, use the Rotate node instead).

Installing it

Part of the LatLong pack. ComfyUI 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. Node under LatLong. Deps: numpy, opencv-python, scipy, torch, Pillow; no model downloads.

Gotchas

Almost nothing to trip on - two booleans, no interpolation, no geometry to tune. The only thing worth saying is the mirror-versus-rotate distinction: if your goal is to reorient the view (look behind you, or level a crooked horizon), use Rotate, because mirroring reverses handedness in a way rotation never does. If your goal is genuinely a mirrored world, this is the node. And since a mirror of a panorama is still a valid panorama, you can chain it with the Edge Blender afterward without worrying about a broken wrap.

CategoryLatLong

Inputs (3)

NameTypeDefaultDescription
imageIMAGEEquirectangular input image tensor (B,H,W,C) in [0,1].
mirror_horizontaloptBOOLEANfalseFlip left-right: reverses longitude (horizontal 180° rotation).
mirror_verticaloptBOOLEANfalseFlip top-bottom: inverts latitude (vertical inversion).

Outputs (1)

NameTypeDescription
flipped_imageIMAGE