hungchiayu commited on
Commit
9477214
·
1 Parent(s): 0a63f68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -35
app.py CHANGED
@@ -49,44 +49,35 @@ input_text = gr.Textbox(lines=2, label="Prompt")
49
  #output_format = gr.Radio(label = "Output format", info = "The file you can dowload", choices = "wav"], value = "wav")
50
  output_audio = gr.Audio(label="Generated Audio", type="filepath")
51
  denoising_steps = gr.Slider(minimum=10, maximum=100, value=25, step=5, label="Steps", interactive=True)
52
- guidance_scale = gr.Slider(minimum=1, maximum=10, value=3, step=0.1, label="Guidance Scale", interactive=True)
53
  duration_scale = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Duration", interactive=True)
54
 
55
- # Gradio interface
56
- gr_interface = gr.Interface(
57
  fn=gradio_generate,
58
- inputs=[input_text, denoising_steps, guidance_scale,duration_scale],
59
- outputs=output_audio,
60
- title="TangoFlux: ",
61
- description=description_text,
62
- allow_flagging=False,
 
 
 
 
63
  examples=[
64
- ["Quiet speech and then and airplane flying away"],
65
- ["A bicycle peddling on dirt and gravel followed by a man speaking then laughing"],
66
- ["Ducks quack and water splashes with some animal screeching in the background"],
67
- ["Describe the sound of the ocean"],
68
- ["A woman and a baby are having a conversation"],
69
- ["A man speaks followed by a popping noise and laughter"],
70
- ["A cup is filled from a faucet"],
71
- ["An audience cheering and clapping"],
72
- ["Rolling thunder with lightning strikes"],
73
- ["A dog barking and a cat mewing and a racing car passes by"],
74
- ["Gentle water stream, birds chirping and sudden gun shot"],
75
- ["A man talking followed by a goat baaing then a metal gate sliding shut as ducks quack and wind blows into a microphone."],
76
- ["A dog barking"],
77
- ["A cat meowing"],
78
- ["Wooden table tapping sound while water pouring"],
79
- ["Applause from a crowd with distant clicking and a man speaking over a loudspeaker"],
80
- ["two gunshots followed by birds flying away while chirping"],
81
- ["Whistling with birds chirping"],
82
- ["A person snoring"],
83
- ["Motor vehicles are driving with loud engines and a person whistles"],
84
- ["People cheering in a stadium while thunder and lightning strikes"],
85
- ["A helicopter is in flight"],
86
- ["A dog barking and a man talking and a racing car passes by"],
87
  ],
88
- cache_examples="lazy", # Turn on to cache.
89
- )
 
 
 
 
 
 
90
 
91
- # Launch Gradio app
92
- gr_interface.queue(15).launch()
 
49
  #output_format = gr.Radio(label = "Output format", info = "The file you can dowload", choices = "wav"], value = "wav")
50
  output_audio = gr.Audio(label="Generated Audio", type="filepath")
51
  denoising_steps = gr.Slider(minimum=10, maximum=100, value=25, step=5, label="Steps", interactive=True)
52
+ guidance_scale = gr.Slider(minimum=1, maximum=10, value=4.5, step=0.5, label="Guidance Scale", interactive=True)
53
  duration_scale = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Duration", interactive=True)
54
 
55
+ interface = gr.Interface(
 
56
  fn=gradio_generate,
57
+ inputs=[
58
+ gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
59
+ gr.Slider(0, 30, value=10, label="Duration in Seconds"),
60
+ gr.Slider(10, 150, value=50, step=5, label="Number of Diffusion Steps"),
61
+ gr.Slider(1, 10, value=4.5, step=0.5, label="CFG Scale")
62
+ ],
63
+ outputs=gr.Audio(type="filepath", label="Generated Audio"),
64
+ title="TangoFlux Generator",
65
+ description="Generate variable-length stereo audio at 44.1kHz from text prompts using TangoFlux.",
66
  examples=[
67
+ [
68
+ "Create a serene soundscape of a quiet beach at sunset.", # Text prompt
69
+
70
+ 15, # Duration in Seconds
71
+ 100, # Number of Diffusion Steps
72
+ 4.5, # CFG Scale
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  ],
74
+
75
+ ["Rock beat played in a treated studio, session drumming on an acoustic kit.",
76
+ 30, # Duration in Seconds
77
+ 100, # Number of Diffusion Steps
78
+ 7, # CFG Scale
79
+
80
+ ]
81
+ ])
82
 
83
+ interface.launch()