fffiloni commited on
Commit
c819c3d
โ€ข
1 Parent(s): faf112e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -101,6 +101,7 @@ article = """
101
 
102
  with gr.Blocks(css="style.css") as demo:
103
  with gr.Column(elem_id="col-container"):
 
104
  gr.HTML("""<div style="text-align: center; max-width: 700px; margin: 0 auto;">
105
  <div
106
  style="
@@ -121,7 +122,6 @@ with gr.Blocks(css="style.css") as demo:
121
  </p>
122
  </div>""")
123
 
124
-
125
  input_img = gr.Image(type="filepath", elem_id="input-img")
126
  music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
127
 
@@ -131,13 +131,15 @@ with gr.Blocks(css="style.css") as demo:
131
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
132
 
133
  with gr.Accordion(label="Music Generation Options", open=False)
134
- track_duration = gr.Slider(minimum=20, maximum=120, value=30, step=5, label="Track duration", elem_id="duration-inp")
135
- with gr.Row():
136
- gen_intensity = gr.Dropdown(choices=["low", "medium", "high"], value="medium", label="Intensity")
137
- gen_mode = gr.Radio(label="mode", choices=["track", "loop"], value="track")
 
138
  generate = gr.Button("Generate Music from Image")
139
 
140
  gr.HTML(article)
 
141
  generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode], outputs=[music_output, share_button, community_icon, loading_icon], api_name="i2m")
142
  share_button.click(None, [], [], _js=share_js)
143
 
 
101
 
102
  with gr.Blocks(css="style.css") as demo:
103
  with gr.Column(elem_id="col-container"):
104
+
105
  gr.HTML("""<div style="text-align: center; max-width: 700px; margin: 0 auto;">
106
  <div
107
  style="
 
122
  </p>
123
  </div>""")
124
 
 
125
  input_img = gr.Image(type="filepath", elem_id="input-img")
126
  music_output = gr.Audio(label="Result", type="filepath", elem_id="music-output").style(height="5rem")
127
 
 
131
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
132
 
133
  with gr.Accordion(label="Music Generation Options", open=False)
134
+ track_duration = gr.Slider(minimum=20, maximum=120, value=30, step=5, label="Track duration", elem_id="duration-inp")
135
+ with gr.Row():
136
+ gen_intensity = gr.Dropdown(choices=["low", "medium", "high"], value="medium", label="Intensity")
137
+ gen_mode = gr.Radio(label="mode", choices=["track", "loop"], value="track")
138
+
139
  generate = gr.Button("Generate Music from Image")
140
 
141
  gr.HTML(article)
142
+
143
  generate.click(get_prompts, inputs=[input_img,track_duration,gen_intensity,gen_mode], outputs=[music_output, share_button, community_icon, loading_icon], api_name="i2m")
144
  share_button.click(None, [], [], _js=share_js)
145