File size: 1,482 Bytes
57ac55d
 
 
 
86766cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: mit
library_name: transformers
pipeline_tag: text-to-audio
---
# 🎵🎵🎵AudioLCM:Text-to-Audio Generation with Latent Consistency Models

We develop **AudioLCM** building on  LCM (latent consistency models) for text-to-audio generation.



## code

Our code is released here : [https://github.com/liuhuadai/AudioLCM)](https://github.com/liuhuadai/AudioLCM)

Please follow the instructions in the repository for installation, usage and experiments.



## Quickstart Guide

Download the **AudioLCM** model and generate audio from a text prompt:

```python
from infer import AudioLCMInfer


prompt="Constant rattling noise and sharp vibrations"
config_path="./audiolcm.yaml"
model_path="./audiolcm.ckpt"
vocoder_path="./model/vocoder"
audio_path = AudioLCMInfer(prompt, config_path=config_path, model_path=model_path, vocoder_path=vocoder_path)


```



Use the `AudioLCMBatchInfer` function to generate multiple audio samples for a batch of text prompts:

```python
from infer import AudioLCMBatchInfer


prompts=[
    "Constant rattling noise and sharp vibrations",
    "A rocket flies by followed by a loud explosion and fire crackling as a truck engine runs idle",
    "Humming and vibrating with a man and children speaking and laughing"
        ]
config_path="./audiolcm.yaml"
model_path="./audiolcm.ckpt"
vocoder_path="./model/vocoder"
audio_path = AudioLCMBatchInfer(prompts, config_path=config_path, model_path=model_path, vocoder_path=vocoder_path)
```