ComfyUI Node

Latent Travel

Morph between two latents without ever decoding

By NicholasMcCarthy·Created 3 years ago·Updated 2 years ago· 16
Latent Travel
  • A
  • B
  • vae
  • LATENTS
  • IMAGES
  • FILEPATHS
steps5
factor0.50
blend_mode
travel_mode
reflect_traveltrue
output_imagesfalse
filepathoutput/travel
prefixtravel
write_imagesfalse

Latent Travel is one of those nodes whose name oversells it in the best way. No API, no model download, no motion module, no magic. It takes two latents, blends them across a sequence of steps, and hands you the intermediate latents so you decide what to do with them. The whole pack is this one node, and it's been quietly showing up for years whenever someone searches "travel" in ComfyUI Manager - right alongside the fancier prompt-traveling packs - because it does the boring, essential thing well.

Why you'd reach for it

You've got two images you like: a cat at seed 100 and a fox at seed 200, or two frames of the same scene with different prompts. You want to see what's between them. That's latent space animation, the same trick behind a lot of "prompt traveling" and morph videos on CivitAI: generate both latents, interpolate between them, then feed every intermediate through a sampler (or an AnimateDiff-style chain) to render a smooth morph. Latent Travel is the interpolation step, packaged so you don't hand-roll a dozen blend nodes.

The clean part is that it works entirely in latent space. You never decode and re-encode, so you skip the lossy round trip that pixel-space blending pays for. The VAE section of the modidex knowledge base makes the point nicely: a decode-encode cycle is a lossy detour, and this node is the detour you don't take.

How it works

The node computes steps cutpoints - values of t from 0 to 1 - using the travel_mode, then blends latent A and latent B at each cutpoint using the blend_mode. Two separate knobs, easy to conflate, and they do very different jobs:

  • travel_mode sets the pacing: linear spaces the steps evenly (the sane default), circle follows the X-axis of a circle for a smooth ease-in-out, norm uses a normal distribution centered at 0.5 where factor acts as the gaussian scale, hinge takes factor as a cutpoint and splits the steps evenly above and below it, and quadratic/cubic/quartic/geometric bunch the steps toward one end using power or log spacing.
  • blend_mode sets how the two latents combine at each point: lerp is the straight linear blend you'll use 90% of the time, slerp blends along the sphere of the vectors (nicer for rotations, keeps magnitudes stable), and the rest - add, multiply, overlay, screen, difference, and friends - are image-compositing operators applied to raw latent values. Fun to poke at, usually garbage when re-sampled. random just injects noise.

One setting to know about: reflect_travel (on by default) mirrors the quadratic/cubic/quartic/geometric curves around the center, so instead of bunching steps at one end you get an ease-in at both ends. It only applies to those power/log modes; linear, circle, and norm ignore it.

The inputs and outputs that matter

You feed it A and B (both LATENT), set steps (default 5, minimum 3), and pick your two modes. Heads-up: steps includes the endpoints, so a 10-frame morph is steps=10, not 8 - the first and last latents out are always exactly A and B. The vae input is required even if you only want latents back, which is a mild annoyance, not a bug. Turn on output_images (needs the VAE) to get decoded images, and write_images plus filepath/prefix to save PNGs.

The outputs are LATENTS (a batch of steps latents - wire that into your sampler or AnimateDiff loop), IMAGES (only when output_images is on), and FILEPATHS.

Install

Standard fare: ComfyUI Manager → search "ComfyUI_TravelSuite", or:

cd ComfyUI/custom_nodes
git clone https://github.com/NicholasMcCarthy/ComfyUI_TravelSuite

Restart ComfyUI. Dependencies are torch, numpy, Pillow, scipy - every one already ships with ComfyUI (scipy powers the norm mode's CDF), so there's nothing heavy to download and no model files. One of the rare packs that just works.

Where people get burned

Two gotchas, both visible in the source. First, the write_images trap: the node only writes files if output_images is also true - it loops over the decoded images, so with output_images off you get a log line and zero PNGs. Set both, with a VAE connected. Files land in ComfyUI/output/travel by default (the filepath is relative to your ComfyUI folder) as prefix_00000.png and up.

Second, don't expect raw decoded intermediates to look clean. Blended latents sit in a fuzzy in-between region of latent space; decoding one directly usually gives a muddy frame. The intended flow is to push each intermediate through a sampler at low denoise (or an AnimateDiff-style chain) so the model rebuilds coherent detail. That's the whole point of latent travel - and the reason it still gets pulled out of Manager's "travel" search today.

Categorytravel/latent

Inputs (12)

NameTypeDefaultDescription
ALATENT
BLATENT
stepsINT53–10000
factorFLOAT0.50
blend_modeCOMBO14 options: lerp, slerp, add, multiply, divide, subtract, +8
travel_modeCOMBO8 options: linear, hinge, circle, norm, quadratic, cubic, +2
reflect_travelBOOLEANtrue
vaeVAE
output_imagesBOOLEANfalse
filepathSTRINGoutput/travel
prefixSTRINGtravel
write_imagesBOOLEANfalse

Outputs (3)

NameTypeDescription
LATENTSLATENT
IMAGESIMAGE
FILEPATHSSTRING