Downloads · 30 days
593
1% of all-time downloads
cvssp/audioldm-m-full
audioldm-m-full is a machine learning model from cvssp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers. The card lists the license as cc-by-nc-sa-4.0.
AudioLDM is a latent text-to-audio diffusion model capable of generating realistic audio samples given any text input. It is available in the 🧨 Diffusers library from v0.15.0 onwards.
Downloads · 30 days
593
1% of all-time downloads
All-time downloads
61.6K
Public
Parameters
416M
5.2 GB on disk
Likes
31
Public
Click a slice to open those files.
.bin2.6 GB · 50%
From the Hugging Face model README
AudioLDM is a latent text-to-audio diffusion model capable of generating realistic audio samples given any text input. It is available in the 🧨 Diffusers library from v0.15.0 onwards.
AudioLDM was proposed in the paper AudioLDM: Text-to-Audio Generation with Latent Diffusion Models by Haohe Liu et al.
Inspired by Stable Diffusion, AudioLDM is a text-to-audio latent diffusion model (LDM) that learns continuous audio representations from CLAP latents. AudioLDM takes a text prompt as input and predicts the corresponding audio. It can generate text-conditional sound effects, human speech and music.
This is the medium version of the AudioLDM model, which has a larger UNet, CLAP audio projection dim, and is trained with audio embeddings as condition. The four AudioLDM checkpoints are summarised below:
Table 1: Summary of the AudioLDM checkpoints.
| Checkpoint | Training Steps | Audio conditioning | CLAP audio dim | UNet dim | Params |
|---|---|---|---|---|---|
| audioldm-s-full | 1.5M | No | 768 | 128 | 421M |
| audioldm-s-full-v2 | > 1.5M | No | 768 | 128 | 421M |
| audioldm-m-full | 1.5M | Yes | 1024 | 192 | 652M |
| audioldm-l-full | 1.5M | No | 768 | 256 | 975M |
First, install the required packages:
pip install --upgrade diffusers transformers accelerate
For text-to-audio generation, the AudioLDMPipeline can be used to load pre-trained weights and generate text-conditional audio outputs:
from diffusers import AudioLDMPipeline
import torch
repo_id = "cvssp/audioldm-m-full"
pipe = AudioLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "Techno music with a strong, upbeat tempo and high melodic riffs"
audio = pipe(prompt, num_inference_steps=10, audio_length_in_s=5.0).audios[0]
The resulting audio output can be saved as a .wav file:
import scipy
scipy.io.wavfile.write("techno.wav", rate=16000, data=audio)
Or displayed in a Jupyter Notebook / Google Colab:
from IPython.display import Audio
Audio(audio, rate=16000)
<audio controls>
<source src="https://huggingface.co/datasets/sanchit-gandhi/audioldm-readme-samples/resolve/main/audioldm-m-full-techno.wav" type="audio/wav">
Your browser does not support the audio element.
</audio>
Prompts:
Inference:
num_inference_steps argument: higher steps give higher quality audio at the expense of slower inference.audio_length_in_s argument.BibTeX:
@article{liu2023audioldm,
title={AudioLDM: Text-to-Audio Generation with Latent Diffusion Models},
author={Liu, Haohe and Chen, Zehua and Yuan, Yi and Mei, Xinhao and Liu, Xubo and Mandic, Danilo and Wang, Wenwu and Plumbley, Mark D},
journal={arXiv preprint arXiv:2301.12503},
year={2023}
}