Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ audio_gen = gr.Blocks.load(name="spaces/haoheliu/audioldm-text-to-audio-generati
|
|
6 |
def infer(image_input):
|
7 |
cap = caption(image_input, fn_index=0)
|
8 |
sound = audio_gen(cap, 5, 2.5, 45, 3, fn_index=0)
|
9 |
-
return sound
|
10 |
|
11 |
title = """
|
12 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
@@ -48,8 +48,13 @@ with gr.Blocks(css="style.css") as demo:
|
|
48 |
|
49 |
generate = gr.Button("Generate FX from Image")
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
gr.HTML(article)
|
52 |
|
53 |
-
generate.click(infer, inputs=[input_img], outputs=[sound_output], api_name="i2fx")
|
54 |
|
55 |
demo.queue(max_size=32, concurrency_count=20).launch()
|
|
|
6 |
def infer(image_input):
|
7 |
cap = caption(image_input, fn_index=0)
|
8 |
sound = audio_gen(cap, 5, 2.5, 45, 3, fn_index=0)
|
9 |
+
return sound, gr.Group.update(visible=True)
|
10 |
|
11 |
title = """
|
12 |
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
|
48 |
|
49 |
generate = gr.Button("Generate FX from Image")
|
50 |
|
51 |
+
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
52 |
+
community_icon = gr.HTML(community_icon_html)
|
53 |
+
loading_icon = gr.HTML(loading_icon_html)
|
54 |
+
share_button = gr.Button("Share to community", elem_id="share-btn")
|
55 |
+
|
56 |
gr.HTML(article)
|
57 |
|
58 |
+
generate.click(infer, inputs=[input_img], outputs=[sound_output, share_group], api_name="i2fx")
|
59 |
|
60 |
demo.queue(max_size=32, concurrency_count=20).launch()
|