radames HF staff commited on
Commit
68bf70a
1 Parent(s): 91dd1a0

set video dimension via bg image

Browse files

following discussion [#15](https://huggingface.co/spaces/haoheliu/audioldm-text-to-audio-generation/discussions/15)
the generated video dimension can be set a given bg image 720x240
fee free to edit the image with color or text.

Files changed (2) hide show
  1. app.py +1 -1
  2. bg.png +0 -0
app.py CHANGED
@@ -26,7 +26,7 @@ audioldm = build_model()
26
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
27
  # print(text, length, guidance_scale)
28
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
29
- waveform = [gr.make_waveform((16000, wave[0])) for wave in waveform]
30
  # waveform = [(16000, np.random.randn(16000)), (16000, np.random.randn(16000))]
31
  if(len(waveform) == 1):
32
  waveform = waveform[0]
 
26
  def text2audio(text, duration, guidance_scale, random_seed, n_candidates):
27
  # print(text, length, guidance_scale)
28
  waveform = text_to_audio(audioldm, text, random_seed, duration=duration, guidance_scale=guidance_scale, n_candidate_gen_per_text=int(n_candidates)) # [bs, 1, samples]
29
+ waveform = [gr.make_waveform((16000, wave[0]), bg_image="bg.png") for wave in waveform]
30
  # waveform = [(16000, np.random.randn(16000)), (16000, np.random.randn(16000))]
31
  if(len(waveform) == 1):
32
  waveform = waveform[0]
bg.png ADDED