---
title: "AudioLDM 2, but faster ⚡️"
description: "AudioLDM 2, a text-to-audio latent diffusion model conditioned on CLAP, Flan-T5 and GPT2-generated embeddings, can be made over 10x faster in Hugging Face Diffusers with minimal quality loss."
url: "https://swe.quest/articles/audioldm-2-but-faster-8e94e6dd82533c03"
canonical: "https://huggingface.co/blog/audioldm2"
source: "Hugging Face"
published: "2023-08-30"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["inference","speech-audio","python","performance"]
---

# AudioLDM 2, but faster ⚡️

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-08-30, 12 min read, How-to. Original: [https://huggingface.co/blog/audioldm2](https://huggingface.co/blog/audioldm2)

## Summary

AudioLDM 2, a text-to-audio latent diffusion model conditioned on CLAP, Flan-T5 and GPT2-generated embeddings, can be made over 10x faster in Hugging Face Diffusers with minimal quality loss. Half precision, PyTorch 2.0 SDPA (flash-attention-style) attention and torch.compile on the UNet cut a 200-step generation from about 13 seconds to 4 seconds. Swapping the default DDIM scheduler for DPMSolverMultistep at 20 steps brings a 10-second clip under 1 second. Negative prompting improves quality at no extra inference cost. Memory scales quadratically with audio length in cross-attention, which matters for long samples and large batches.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Speech & audio](https://swe.quest/tags/speech-audio.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- PyTorch basics
- diffusion models
- GPU inference ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

AudioLDM 2, Hugging Face Diffusers, torch.compile, Flash Attention, DPMSolverMultistepScheduler, Flan-T5, CLAP, GPT2

## Related posts

- [Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints](https://swe.quest/articles/powerful-asr-diarization-speculative-decoding-with-hugging-face-inference-ed388c1f3bfe4f4b.md): Hugging Face · 2024-05-01 · Medium · 7 min read · Speech & audio, Inference & serving, Python
  A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint.
- [Blazingly fast whisper transcriptions with Inference Endpoints](https://swe.quest/articles/blazingly-fast-whisper-transcriptions-with-inference-endpoints-d93b7d262c3a1210.md): Hugging Face · 2025-05-13 · Easy · 6 min read · Inference & serving, Speech & audio, Performance engineering
  Hugging Face Inference Endpoints now offers a Whisper deployment built on vLLM that delivers up to roughly 8x higher real-time factor (RTFx) than the Transformers implementation, with comparable word error rate.
- [Deploy MusicGen in no time with Inference Endpoints](https://swe.quest/articles/deploy-musicgen-in-no-time-with-inference-endpoints-bd09aae14ffb65dc.md): Hugging Face · 2023-08-04 · Medium · 4 min read · Inference & serving, Speech & audio, Python, Machine learning
  MusicGen, which has no transformers pipeline, can be served on Hugging Face Inference Endpoints by writing a custom handler.
- [How Together AI built the world’s fastest speech-to-text stack](https://swe.quest/articles/how-together-ai-built-the-world-s-fastest-speech-to-text-stack-b5ccd6ddea6a414d.md): Together AI · 2026-05-29 · Hard · 7 min read · Inference & serving, Speech & audio, Performance engineering, Python, Linux
  Speech-to-text serving is a full-path systems problem, because ASR models are small while audio inputs are large and need heavy CPU preprocessing.
- [Diffusers welcomes Stable Diffusion 3](https://swe.quest/articles/diffusers-welcomes-stable-diffusion-3-f6ced777e2fcbd47.md): Hugging Face · 2024-06-12 · Medium · 7 min read · Computer vision, Inference & serving, Model training, Python
  Stable Diffusion 3 Medium (2B parameters) is now usable through Diffusers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
