Nodes/ComfyUI/Flip Latent
ComfyUI Node Runs on cloud

Flip Latent

Mirror the latent before the model ever sees it

By Comfy-Org·Created 4 years ago·Updated 6 minutes ago· 129,910
Flip Latent
  • samples
  • LATENT
flip_method

Sometimes the simplest nodes are the ones you forget exist. LatentFlip mirrors your latent in place - no sampler, no conditioning, no re-encode. It's the latent-space version of flipping an image, with one naming quirk that trips everyone up on first read.

The naming trap

The two choices are x-axis: vertically and y-axis: horizontally. Read those as "flip across the x-axis" and "flip across the y-axis," not "flip it vertically" / "flip it horizontally."

  • x-axis: vertically → flips top-to-bottom (a vertical mirror).
  • y-axis: horizontally → flips left-to-right (the mirror you're probably picturing).

Under the hood it's a torch.flip on the height or width axis of the latent tensor. That's the entire mechanism - instant, free, no quality cost.

Why you'd bother

The main use is the mirror trick. People generate a composition, flip the latent, and either use it directly as a variation or pair it with the original to make a symmetric scene. It also shows up in inpainting, where you mirror a latent region so the model sees the same content from the other side, and in batch work where you want left/right variants of every sample without re-running the sampler.

Because it happens in latent space, it's cheaper than flipping pixels and re-encoding - the flip is just a memory reorder on the tensor, before the KSampler ever runs.

Inputs and output

LatentFlip takes samples (LATENT) and flip_method, and passes the same latent straight through with the flip applied. Nothing else. The output feeds anywhere a normal latent goes - a sampler, a VAE decode, whatever.

Gotchas

Two things worth knowing. First, don't use it on anything with readable text or a known handedness unless a mirrored result is the point - flipping a latent flips the final image, so logos, signs, and asymmetry come out wrong by design. Second, keep in mind that flipping a latent isn't quite the same as flipping pixels: the model's positional structure isn't perfectly symmetric in latent space, so a flipped result can occasionally look subtly off in a way that surprises you. In practice it's close enough for the mirror trick and infinitely cheaper than the alternative, which is why this node keeps existing despite being a one-liner.

Categorymodel/latent/transform

Inputs (2)

NameTypeDefaultDescription
samplesLATENT
flip_methodCOMBO2 options: x-axis: vertically, y-axis: horizontally

Outputs (1)

NameTypeDescription
LATENTLATENT