ameerazam08 commited on
Commit
ccf495a
1 Parent(s): 4a2ddeb

added extra params

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -19,7 +19,7 @@ def load_model():
19
 
20
  # Function to set up, generate, and process the audio
21
  @spaces.GPU(duration=120) # Allocate GPU only when this function is called
22
- def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
23
  print(f"Prompt received: {prompt}")
24
  print(f"Settings: Duration={seconds_total}s, Steps={steps}, CFG Scale={cfg_scale}")
25
 
@@ -56,9 +56,9 @@ def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
56
  cfg_scale=cfg_scale,
57
  conditioning=conditioning,
58
  sample_size=sample_size,
59
- sigma_min=0.3,
60
- sigma_max=500,
61
- sampler_type="dpmpp-3m-sde",
62
  device=device
63
  )
64
  print("Audio generated.")
@@ -85,11 +85,16 @@ def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
85
  # Setting up the Gradio Interface
86
  interface = gr.Interface(
87
  fn=generate_audio,
 
88
  inputs=[
89
  gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
 
90
  gr.Slider(0, 47, value=30, label="Duration in Seconds"),
91
  gr.Slider(10, 150, value=100, step=10, label="Number of Diffusion Steps"),
92
- gr.Slider(1, 15, value=7, step=0.1, label="CFG Scale")
 
 
 
93
  ],
94
  outputs=gr.Audio(type="filepath", label="Generated Audio"),
95
  title="Stable Audio Generator",
 
19
 
20
  # Function to set up, generate, and process the audio
21
  @spaces.GPU(duration=120) # Allocate GPU only when this function is called
22
+ def generate_audio(prompt, sampler_type_dropdown, seconds_total=30, steps=100, cfg_scale=7,sigma_min_slider=0.3,sigma_max_slider=500):
23
  print(f"Prompt received: {prompt}")
24
  print(f"Settings: Duration={seconds_total}s, Steps={steps}, CFG Scale={cfg_scale}")
25
 
 
56
  cfg_scale=cfg_scale,
57
  conditioning=conditioning,
58
  sample_size=sample_size,
59
+ sigma_min=sigma_min_slider,
60
+ sigma_max=sigma_max_slider,
61
+ sampler_type=sampler_type_dropdown,#"dpmpp-3m-sde",
62
  device=device
63
  )
64
  print("Audio generated.")
 
85
  # Setting up the Gradio Interface
86
  interface = gr.Interface(
87
  fn=generate_audio,
88
+
89
  inputs=[
90
  gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
91
+ gr.Dropdown(["dpmpp-2m-sde", "dpmpp-3m-sde", "k-heun", "k-lms", "k-dpmpp-2s-ancestral", "k-dpm-2", "k-dpm-fast"], label="Sampler type", value="dpmpp-3m-sde"),
92
  gr.Slider(0, 47, value=30, label="Duration in Seconds"),
93
  gr.Slider(10, 150, value=100, step=10, label="Number of Diffusion Steps"),
94
+ gr.Slider(1, 15, value=7, step=0.1, label="CFG Scale"),
95
+ gr.Slider(minimum=0.0, maximum=5.0, step=0.01, value=0.3, label="Sigma min"),
96
+ gr.Slider(minimum=0.0, maximum=1000.0, step=0.1, value=500, label="Sigma max"),
97
+
98
  ],
99
  outputs=gr.Audio(type="filepath", label="Generated Audio"),
100
  title="Stable Audio Generator",