teticio commited on
Commit
8c2e759
1 Parent(s): c1e3d89

update apps to incude latent diffusion

Browse files
Files changed (2) hide show
  1. app.py +23 -21
  2. streamlit_app.py +9 -6
app.py CHANGED
@@ -15,28 +15,30 @@ def generate_spectrogram_audio_and_loop(model_id):
15
  return image, (sample_rate, audio), (sample_rate, loop)
16
 
17
 
18
- demo = gr.Interface(fn=generate_spectrogram_audio_and_loop,
19
- title="Audio Diffusion",
20
- description="Generate audio using Huggingface diffusers.\
21
- This takes about 20 minutes without a GPU, so why not make yourself a \
22
- cup of tea in the meantime? (Or try the teticio/audio-diffusion-ddim-256 \
23
- model which is faster.)",
24
- inputs=[
25
- gr.Dropdown(label="Model",
26
- choices=[
27
- "teticio/audio-diffusion-256",
28
- "teticio/audio-diffusion-breaks-256",
29
- "teticio/audio-diffusion-instrumental-hiphop-256",
30
- "teticio/audio-diffusion-ddim-256"
31
- ],
32
- value="teticio/audio-diffusion-256")
33
  ],
34
- outputs=[
35
- gr.Image(label="Mel spectrogram", image_mode="L"),
36
- gr.Audio(label="Audio"),
37
- gr.Audio(label="Loop"),
38
- ],
39
- allow_flagging="never")
 
 
40
 
41
  if __name__ == "__main__":
42
  parser = argparse.ArgumentParser()
 
15
  return image, (sample_rate, audio), (sample_rate, loop)
16
 
17
 
18
+ demo = gr.Interface(
19
+ fn=generate_spectrogram_audio_and_loop,
20
+ title="Audio Diffusion",
21
+ description="Generate audio using Huggingface diffusers.\
22
+ The models without 'latent' or 'ddim' give better results but take about \
23
+ 20 minutes without a GPU.",
24
+ inputs=[
25
+ gr.Dropdown(label="Model",
26
+ choices=[
27
+ "teticio/audio-diffusion-256",
28
+ "teticio/audio-diffusion-breaks-256",
29
+ "teticio/audio-diffusion-instrumental-hiphop-256",
30
+ "teticio/audio-diffusion-ddim-256",
31
+ "teticio/latent-audio-diffusion-256",
32
+ "teticio/latent-audio-diffusion-ddim-256"
33
  ],
34
+ value="teticio/latent-audio-diffusion-ddim-256")
35
+ ],
36
+ outputs=[
37
+ gr.Image(label="Mel spectrogram", image_mode="L"),
38
+ gr.Audio(label="Audio"),
39
+ gr.Audio(label="Loop"),
40
+ ],
41
+ allow_flagging="never")
42
 
43
  if __name__ == "__main__":
44
  parser = argparse.ArgumentParser()
streamlit_app.py CHANGED
@@ -8,16 +8,19 @@ from audiodiffusion import AudioDiffusion
8
 
9
  if __name__ == "__main__":
10
  st.header("Audio Diffusion")
11
- st.markdown("Generate audio using Huggingface diffusers.\
12
- This takes about 20 minutes without a GPU, so why not make yourself a \
13
- cup of tea in the meantime? (Or try the teticio/audio-diffusion-ddim-256 \
14
- model which is faster.)")
15
 
16
  model_id = st.selectbox("Model", [
17
  "teticio/audio-diffusion-256", "teticio/audio-diffusion-breaks-256",
18
  "teticio/audio-diffusion-instrumental-hiphop-256",
19
- "teticio/audio-diffusion-ddim-256"
20
- ])
 
 
 
21
  audio_diffusion = AudioDiffusion(model_id=model_id)
22
 
23
  if st.button("Generate"):
 
8
 
9
  if __name__ == "__main__":
10
  st.header("Audio Diffusion")
11
+ st.markdown(
12
+ "Generate audio using Huggingface diffusers.\
13
+ The models without 'latent' or 'ddim' give better results but take about \
14
+ 20 minutes without a GPU.", )
15
 
16
  model_id = st.selectbox("Model", [
17
  "teticio/audio-diffusion-256", "teticio/audio-diffusion-breaks-256",
18
  "teticio/audio-diffusion-instrumental-hiphop-256",
19
+ "teticio/audio-diffusion-ddim-256",
20
+ "teticio/latent-audio-diffusion-256",
21
+ "teticio/latent-audio-diffusion-ddim-256"
22
+ ],
23
+ index=5)
24
  audio_diffusion = AudioDiffusion(model_id=model_id)
25
 
26
  if st.button("Generate"):