Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 12 min read How-to mediumAdept

AudioLDM 2, but faster ⚡️

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.

Assumes: PyTorch basicsdiffusion modelsGPU inference

Related posts

  • Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints

    Hugging Face mediumAdept

    A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint. The handler is split into model settings, inference config and diarization utilities, with models chosen via Pydantic environment variables. Creating the endpoint through the API is needed to pass the HF token that diarization requires. A k6 benchmark on an A10 GPU shows distil-large-v3 as assistant model cutting latency on 8s audio from ~784ms to ~327ms but slowing 60s audio (3.48s to 4.15s). Speculative decoding requires batch size 1, so batching wins for long, chunked inputs.

  • Blazingly fast whisper transcriptions with Inference Endpoints

    Hugging Face easyNovice

    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. It targets NVIDIA Ada Lovelace GPUs (L4, L40s) and gets its speedup from torch.compile JIT kernels, CUDA graphs that batch GPU kernel launches, and a float8 KV cache that halves cache memory versus bfloat16. Whisper Large V3, V3-Turbo and Distil-Whisper V3.5 were benchmarked for WER on 8 Open ASR Leaderboard datasets and for RTFx on 45+ minute rev16 audio using a single L4. Deployment is one click, and the endpoint is called through an OpenAI-style /audio/transcriptions HTTP API; a FastRTC demo shows real-time transcription.

  • Deploy MusicGen in no time with Inference Endpoints

    Hugging Face mediumAdept

    MusicGen, which has no transformers pipeline, can be served on Hugging Face Inference Endpoints by writing a custom handler. You duplicate the facebook/musicgen-large repo, add a handler.py whose EndpointHandler loads the model in float16 on CUDA and runs generate with the request's parameters, and add a requirements.txt pinning transformers and accelerate. An instance with at least 16 GB RAM is enough for musicgen-large. You can then query the endpoint via curl or huggingface_hub's InferenceClient and write the returned waveform to a 32 kHz WAV with scipy, and the same pattern works for any Hub model without a pipeline.

  • How Together AI built the world’s fastest speech-to-text stack

    Together AI hardMaster

    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. Together optimized Parakeet-TDT 0.6B v3 and Whisper Large v3 at each layer of that path. Multi-profile TensorRT engines tune the encoder for real audio shapes instead of padding short chunks. Conditional CUDA graph nodes move the decoder's BLANK-token branch onto the GPU, making the decoder 2-3x faster. Persistent Unix domain sockets, shared memory and fewer process hops cut copy overhead, epoll replaces thread-per-connection streaming to tame GIL contention, and gc.freeze() after startup preallocation removed periodic ~200 ms p95 spikes caused by full Python GC passes.

  • Diffusers welcomes Stable Diffusion 3

    Hugging Face mediumAdept

    Stable Diffusion 3 Medium (2B parameters) is now usable through Diffusers. Its architecture pairs three text encoders (two CLIP models and T5-XXL) with a Multimodal Diffusion Transformer that runs joint attention over text and image-patch sequences, and it is trained with rectified flow matching, served by a new FlowMatchEulerDiscreteScheduler (shift=3.0 recommended). Benchmarks on an A100 show the memory tradeoffs: CPU offloading cuts VRAM from 18.8GB to 12GB at roughly 6.8x latency, dropping T5 brings it to 4.3GB, and 8-bit T5 reaches 10.6GB with almost no slowdown. torch.compile delivers about a 4x speedup (0.585s), and a DreamBooth LoRA fine-tuning script is included.

The quest for software engineering knowledge.

Look:
Layout: