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

Audio Latent Guidance

Steer an audio diffusion model toward a reference sound

By DavidPiazza·Created about a year ago·Updated 9 months ago· 0
Audio Latent Guidance
  • model
  • reference_latent
  • features
  • model
guidance_strength0.50
guidance_modeattention
start_at_step0
end_at_step1000

Text prompts get you close, but "close" isn't a bassline that slaps. Audio Latent Guidance is the audio version of feeding a reference image to an image model - you hand it a sound you like, and it nudges the diffusion process toward that sound while it generates. It's the node that turns Stable Audio text-to-audio into something more like "text-to-audio, but make it sound like this."

How it works

The node doesn't train anything and it doesn't call an API. It takes your Stable Audio diffusion model, clones it in memory, and patches the clone's forward pass. Every denoising step between start_at_step and end_at_step, it compares the in-progress latent to your reference latent and pushes them closer together - using whichever mode you picked. additive just adds a slice of the reference into the latent; multiplicative scales by normalized reference values; attention folds reference info into the cross-attention context; gradient pushes x toward the reference by an amount that shrinks as they get more similar. attention is the default and, honestly, the one you'll leave it on.

This is a conditioning node, so it takes a MODEL in and hands a patched MODEL out. Wire it the same way you'd wire a LoRA-loaded model: checkpoint → Audio Latent Guidance → the KSampler.

The inputs that matter

The ones a beginner actually touches:

  • reference_latent - the sound you want to steer toward, as a LATENT. You'll typically get it from AudioReferenceEncoder (several references mashed together) or AudioVAEEncode (a single clip).
  • guidance_strength - 0 to 2, default 0.5. Crank it and the output leans harder on the reference.
  • guidance_mode - the four strategies above; attention by default.
  • start_at_step / end_at_step - a guidance window, if you only want the reference to shape the early structure or the final polish.

The output is just the patched model, which drops straight into your audio sampler. There's also an optional features input (type AUDIO_FEATURES) that modulates the guidance if another node in the pack is extracting features - skip it until you're showing off.

Installing it

This ships in the DavidPiazza/network_bending pack ("Network Bending for ComfyUI"). Either install it through ComfyUI Manager (search "Network Bending") or:

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

Then restart ComfyUI. The core nodes need no extra pip packages, but this is an audio node, so you need torchaudio and librosa - they're in the pack's requirements-audio.txt. If they're missing, ComfyUI just doesn't load the audio nodes; the rest of the pack still works, which is a confusing way to discover you forgot them.

Where people get burned

The reference has to be a latent - you can't plug a raw audio file in here. And the MODEL in has to be a Stable Audio diffusion model, the kind ComfyUI's native audio workflow loads (Stable Audio Open checkpoint plus its t5-base CLIP). If you're new to audio in ComfyUI, get that base workflow working first - Workflow → browse templates → audio - before you start bending anything. The pack itself doesn't ship a Stable Audio loader, so treat that as a prerequisite, not a bug.

One more thing worth knowing about this pack generally: it's version 0.0.1 and some dropdowns are declared but not wired up in the shipped code. Audio Latent Guidance is one of the fully-implemented ones, which is more than I can say for a couple of its cousins.

Categoryaudio/conditioning

Inputs (7)

NameTypeDefaultDescription
modelMODELStable Audio diffusion model
reference_latentLATENTReference audio latent for guidance
guidance_strengthFLOAT0.500–2Strength of latent guidance
guidance_modeCOMBOattentionHow to apply guidance
start_at_stepoptINT00–1000Step to start applying guidance
end_at_stepoptINT10000–1000Step to stop applying guidance
featuresoptAUDIO_FEATURESOptional features to modulate guidance

Outputs (1)

NameTypeDescription
modelMODEL