Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,6 @@ audio_gen = gr.Blocks.load(name="spaces/fffiloni/audioldm-text-to-audio-generati
|
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
12 |
|
13 |
def input_changes(input_img):
|
14 |
-
sound_output.update(visible=False)
|
15 |
|
16 |
if input_img == None:
|
17 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
@@ -23,7 +22,7 @@ def input_changes(input_img):
|
|
23 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
24 |
|
25 |
def infer(image_input, manual_caption, duration_in, seed, caption_output):
|
26 |
-
|
27 |
print(duration_in)
|
28 |
if manual_caption == "":
|
29 |
cap = caption_output
|
@@ -104,7 +103,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
104 |
seed_in = gr.Slider(label="Seed", value=440, minimum=45, maximum=10000, step=1)
|
105 |
|
106 |
caption_output = gr.Textbox(label="Caption", visible=False, elem_id="text-caption")
|
107 |
-
sound_output = gr.Audio(label="Result",
|
108 |
|
109 |
generate = gr.Button("Generate SFX from Image")
|
110 |
|
|
|
11 |
ph_message="If you're not happy with sound result, you can manually describe the scene depicted in your image :)"
|
12 |
|
13 |
def input_changes(input_img):
|
|
|
14 |
|
15 |
if input_img == None:
|
16 |
return manual_cap.update(value="",placeholder=ph_message), caption_output.update(value=None), sound_output.update(value=None)
|
|
|
22 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
23 |
|
24 |
def infer(image_input, manual_caption, duration_in, seed, caption_output):
|
25 |
+
|
26 |
print(duration_in)
|
27 |
if manual_caption == "":
|
28 |
cap = caption_output
|
|
|
103 |
seed_in = gr.Slider(label="Seed", value=440, minimum=45, maximum=10000, step=1)
|
104 |
|
105 |
caption_output = gr.Textbox(label="Caption", visible=False, elem_id="text-caption")
|
106 |
+
sound_output = gr.Audio(label="Result", elem_id="sound-output")
|
107 |
|
108 |
generate = gr.Button("Generate SFX from Image")
|
109 |
|