Nodes/Network Bending for ComfyUI/Audio Latent Interpolate
ComfyUI Node

Audio Latent Interpolate

Morph one sound into another in the latent space

By DavidPiazza·Created about a year ago·Updated 9 months ago· 0
Audio Latent Interpolate
  • latent_a
  • latent_b
  • latent
interpolation_factor0.50
interpolation_modespherical
curve_power1.0

If you've ever envied the way image people slide a latent between "photo of a cat" and "photo of a dog" and get a chimera, this is your turn. Audio Latent Interpolate takes two audio latents and walks between them, so you can morph a kick drum into a sine wave, a rain loop into applause, or a vocal into a pad - and land anywhere in between.

How it works

It's pure latent-space math, and it's real: the node reads both latents, blends them on whatever curve you ask for, and hands back a new LATENT. The interesting part is the default mode, spherical (SLERP). Instead of blending in a straight line, it treats the latents as directions in a high-dimensional space and rotates between them along the sphere. That tends to avoid the muddy "averaged" sound that plain linear mixing gives you, because it respects the geometry of the space the VAE actually lives in. If two latents are nearly identical it falls back to linear automatically, so you won't hit the division-by-near-zero edge case.

There's also linear, cubic (smooth start/end, good for easing into a transition), and sine. If you want to bias the midpoint - linger longer at the start or punch through to the end early - the curve_power input reshapes the factor (factor ** curve_power). Leave it at 1 for a plain mix.

The inputs that matter

  • latent_a / latent_b - the two LATENTs, from AudioVAEEncode or AudioReferenceEncoder. There's no size check at the port, but a mismatch in length will bite you on decode; encode your sources the same way.
  • interpolation_factor - 0 to 1. 0 is all A, 1 is all B. This is the knob you'd animate if you're building a crossfade between scenes.
  • interpolation_mode - leave spherical unless you have a reason not to.
  • curve_power - optional fine control over the curve.

Output is a single latent, ready for AudioVAEDecode. To make a real sweep, put the factor on an animated input (or just render a few stills at different factors and pick the one that's not embarrassing).

Installing it

Part of the DavidPiazza/network_bending pack. Via ComfyUI Manager, search "Network Bending"; or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/DavidPiazza/network_bending.git

Restart ComfyUI. Being an audio node, it needs torchaudio and librosa from the pack's requirements-audio.txt - without them the audio nodes don't show up at all (the pack disables them gracefully rather than failing the whole load).

Common issues

The two things that actually go wrong here: feeding it latents from different sources or sample rates, and decoding a factor exactly at 0 or 1 (which is fine, just pointless - you already had that audio). Mostly, though, interpolation is the friendliest node in this pack: no model surgery, no fragility, just a slider between two sounds. If you're poking at the audio side of network_bending for the first time, this is a good place to start.

Categoryaudio/latent

Inputs (5)

NameTypeDefaultDescription
latent_aLATENTFirst audio latent
latent_bLATENTSecond audio latent
interpolation_factorFLOAT0.500–1Interpolation factor (0=A, 1=B)
interpolation_modeCOMBOsphericalInterpolation method
curve_poweroptFLOAT1.00.1–10Power curve for non-linear interpolation

Outputs (1)

NameTypeDescription
latentLATENT