What AudioLDM is
AudioLDM makes sound from a text prompt with latent diffusion, the recipe of Stable Diffusion applied to pictures of sound: a VAE compresses a mel spectrogram (energy per frequency band over time) into a small latent, a U-Net denoises that latent, the VAE decodes a spectrogram, and a vocoder turns the spectrogram into a waveform.
Its idea is in the conditioning. The diffusion model is trained on audio alone, conditioned on the audio's embedding from CLAP, a model that maps sounds and their descriptions to the same space; at sampling time the prompt's CLAP text embedding takes its place. No paired text–audio data is needed to train the diffusion model.
The page records AudioLDM S full v2 on a church bell ringing: 5.12 s of audio, a 512-frame × 64-band log-mel spectrogram, an 8 × 16 × 128 latent, made in 10 DDIM steps with guidance 2.5 and seed 0. The parts have 185 M (U-Net), 55 M (VAE), 125 M (CLAP text tower) and 55 M (HiFi-GAN vocoder) parameters.
CLAP: the prompt as one direction
CLAP is trained like CLIP, on pairs of audio clips and captions: an audio encoder and a text encoder each produce a unit vector, and a contrastive loss pulls each clip towards its own caption and away from the others in the batch:
After training, a sound and a sentence describing it point in similar directions, which is what lets AudioLDM swap one for the other. The CLAP text encoder panel shows the text side: a 12-layer RoBERTa-base reads the prompt (padded to 512 tokens, padding masked), only its first token is read out, and a projection and an MLP map it to 512 numbers, divided by their norm. The empty prompt used for guidance gets its own vector; the two have cosine −0.023.
The text as a class embedding
Stable Diffusion's U-Net reads the prompt's tokens through cross-attention. AudioLDM's has nothing to attend to, only one vector, and uses it like a class label. The The text as a class embedding panel shows one Linear 512 → 512, placed beside the timestep's 512-number embedding; every ResNet block reads the concatenation , 1,024 numbers, and turns it into a per-channel shift of its features. Splitting that projection by its two halves shows how much of the shift each part supplies:
No layer attends to the text. The transformer blocks keep both of their attention layers, but the second one, where Stable Diffusion reads the prompt, attends over the latent itself here. Selecting the ResNet block shows the timestep's and the text's parts of its shift separately; the bars under the U-Net compare the two parts in every ResNet block at the selected step, for the prompt pass or the empty-prompt pass.
A U-Net over a spectrogram latent
The VAE compresses the 64 × 512 log-mel spectrogram 4 × along both axes into 8 channels, so the U-Net works on 16 bands × 128 frames. Its four levels have 128, 256, 384 and 640 channels at 16 × 128, 8 × 64, 4 × 32 and 2 × 16 latent pixels, and like Stable Diffusion's it predicts the noise in its input. A spectrogram is not translation-invariant the way a photo is: moving a pattern along the time axis keeps the sound, moving it along the frequency axis changes its pitch. The U-Net's convolutions nevertheless treat both axes alike.
Selecting the transformer block at up level 0 opens its 2 × 16 = 32 tokens, 640 wide, with all 8 heads of 80 for both attention layers.
DDIM steps and guidance
The latent follows the usual discrete schedule, , with scaled-linear from 0.0015 to 0.0195 over 1,000 steps. Sampling takes 10 deterministic DDIM steps at = 901, 801, …, 1, each with two U-Net passes, prompt and empty prompt, mixed by classifier-free guidance:
The Guidance panel shows the two predictions and their mix at the selected step, the Sampling loop strip each step's , and decoded to spectrograms, and the x̂₀ at every step card the spectrogram of every step's estimate side by side. The AudioLDM paper sampled with 200 DDIM steps and guidance 2; this run uses the pipeline's 10 steps and 2.5.
From latent to sound
The Latent → spectrogram → sound panel finishes the chain. The VAE decoder turns the final latent back into a 64-band log-mel spectrogram of 512 frames. Each frame stands for 160 samples of 16 kHz audio (10 ms), so the vocoder has to produce 81,920 samples from 32,768 numbers, inventing the phase the spectrogram does not store.
HiFi-GAN does this with transposed convolutions that upsample by 5, 4, 2, 2 and 2, 160 × in all, each followed by residual stacks with kernels 3, 7 and 11 that see patterns at several lengths. It is trained as a GAN, against discriminators that look at the waveform at several periods and scales, plus a mel-spectrogram reconstruction loss. The panel shows every stage's activity pooled to the mel frames, the waveform's envelope and 30 ms of samples, and lets you play the result.
Where it came from
AudioLDM (2023) brought latent diffusion to general sound with CLAP conditioning. AudioLDM 2 replaced the CLAP vector with a sequence of self-supervised audio features predicted from the text by a language model, so speech, music and sound effects share one framework. Stable Audio moved to a transformer on the latent of a waveform VAE with timing conditioning (see the Stable Audio tab).
Papers
- AudioLDM: Text-to-Audio Generation with Latent Diffusion Models The model this tab records: latent diffusion on mel spectrograms, trained on CLAP audio embeddings and sampled with CLAP text embeddings.
- Large-scale Contrastive Language-Audio Pretraining with Feature Fusion and Keyword-to-Caption Augmentation Contrastive language–audio pretraining with a RoBERTa text encoder: the joint space AudioLDM's conditioning lives in.
- HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis The vocoder that turns the decoded mel spectrogram into a waveform: transposed convolutions, multi-receptive-field residual stacks, multi-period and multi-scale discriminators.
- High-Resolution Image Synthesis with Latent Diffusion Models Latent diffusion, the VAE-plus-U-Net design AudioLDM applies to spectrograms (see the SD 1.5 tab).
- Denoising Diffusion Implicit Models DDIM, the deterministic sampler of the page's 10 steps.
- Classifier-Free Diffusion Guidance Guidance by mixing a conditional and an unconditional prediction, here the prompt and the empty prompt.
- AudioLDM 2: Learning Holistic Audio Generation with Self-supervised Pretraining The follow-up: a language model maps text to self-supervised audio features that condition the diffusion model.