Nodes/ComfyUI_agilly1989_motorway/LatentFlip_motorway_edition
ComfyUI Node

LatentFlip_motorway_edition

Mirror your latent, because flipping pixels is wasteful

By agilly1989·Created 2 years ago·Updated about a year ago· 7
LatentFlip_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_samples_keysamples
flip_method
OUTPUT_LATENT_keyLATENT

LatentFlip_motorway_edition wraps core's LatentFlip: it mirrors a latent horizontally or vertically - in latent space, before the VAE ever decodes anything. The motorway edition takes the source from a pipe key and writes the flipped result back to a key.

When mirroring a latent instead of pixels pays off

The case for doing it in latent space is efficiency plus workflow continuity. If you're going to sample a flipped version of something - a batch where you mirror every image to double your candidate count, a flipped reference for a ControlNet pass, an img2img run where you want the composition reversed - flipping the latent means the diffusion model sees the flipped layout directly, and you never pay for a decode/encode round trip just to turn the image around. It's the same logic as LatentCrop: keep the whole pipeline in the compressed representation until the end.

You set two things:

  • flip_method - "x-axis: vertically" flips top-to-bottom; "y-axis: horizontally" flips left-to-right. The naming is the classic source of confusion: the x-axis is the horizontal line, so flipping over the x-axis flips the image vertically. Read it twice; everyone trips on it once.
  • INPUT_samples_key (default "samples") - where the source latent lives in the pipe.
  • OUTPUT_LATENT_key (default "LATENT") - where the mirrored result goes.

Only output socket is MOTORWAY 🚌💨; pull the flipped latent out via a Motorway AxB ramp to sample or decode it.

Motorway notes

One key in, one key out, no widgets beyond the flip choice. The usual failure mode applies: if INPUT_samples_key doesn't match something a node actually wrote into the pipe, you get the pack's 'MotorwayClass' object has no attribute 'hash_' error. And don't expect flipping to be free of consequence for your prompt - a mirrored latent will happily sample a mirror-image of whatever the prompt describes, so if you flip, keep the composition in mind.

Install and the standing caveats

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart ComfyUI, or install via ComfyUI Manager. No pip deps, no models.

The pack-wide truth applies: one-developer beta, README-explicit about breakage, and the current repo HEAD has the _motorway_edition registration commented out mid-refactor, so a fresh clone may not even show this node. If flipping a latent is your only need, the stock LatentFlip does the identical mirror with a socket - this wrapper only earns its keep once your graph is already routing latents through the motorway.

Categoryagilly1989 Nodes/Motorway-ed/latent/transform

Inputs (4)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_samples_keySTRINGsamples
flip_methodCOMBO2 options: x-axis: vertically, y-axis: horizontally
OUTPUT_LATENT_keySTRINGLATENT

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨