Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,18 +49,18 @@ with gr.Blocks(title="🎹 MIDI-AudioLDM", theme=gr.themes.Base(text_size=gr.the
|
|
49 |
""")
|
50 |
with gr.Row():
|
51 |
with gr.Column(variant='panel'):
|
52 |
-
midi = gr.File(label="
|
53 |
-
prompt = gr.Textbox(label="
|
54 |
with gr.Column(variant='panel'):
|
55 |
-
audio = gr.Audio(label="
|
56 |
with gr.Accordion("Advanced Settings", open=False):
|
57 |
-
duration = gr.Slider(0, 30, value=5, step=5, label="
|
58 |
-
inf = gr.Slider(0, 50, value=20, step=0.1, label="
|
59 |
-
guidance_scale = gr.Slider(0, 4, value=2.5, step=0.5, label="
|
60 |
-
neg_prompt = gr.Textbox(label="
|
61 |
-
seed = gr.Number(value=25, label="
|
62 |
-
cond = gr.Slider(0.0, 1.0, value=1.0, step=0.1, label="
|
63 |
-
guess = gr.Checkbox(label="
|
64 |
btn = gr.Button("Generate")
|
65 |
btn.click(predict, inputs=[midi, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess], outputs=[audio])
|
66 |
# gr.Examples(examples=[["S00.mid", "piano", "", 10, 25, 1.0, 20, 2.5, False], ["S00.mid", "violin", "", 10, 25, 1.0, 20, 2.5, False], ["S00.mid", "woman singing", "", 10, 25, 0.8, 20, 2.5, False]], inputs=[midi, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess], fn=predict, outputs=audio, cache_examples=True)
|
|
|
49 |
""")
|
50 |
with gr.Row():
|
51 |
with gr.Column(variant='panel'):
|
52 |
+
midi = gr.File(label="Midi file", file_types=[".mid"])
|
53 |
+
prompt = gr.Textbox(label="Prompt", info="Enter a descriptive text prompt to guide the audio generation.")
|
54 |
with gr.Column(variant='panel'):
|
55 |
+
audio = gr.Audio(label="Audio")
|
56 |
with gr.Accordion("Advanced Settings", open=False):
|
57 |
+
duration = gr.Slider(0, 30, value=5, step=5, label="Duration (seconds)", info="Modify the duration of the output audio file.")
|
58 |
+
inf = gr.Slider(0, 50, value=20, step=0.1, label="Inference steps", info="Edit the number of denoising steps. A larger number usually leads to higher quality but slower results.")
|
59 |
+
guidance_scale = gr.Slider(0, 4, value=2.5, step=0.5, label="Guidance scale", info="Modify the guidance scale. The higher the value the more linked the generated audio to the text prompt, sometimes at the expense of lower quality.")
|
60 |
+
neg_prompt = gr.Textbox(label="Negative prompt", info="Optionally enter a negative text prompt not to guide the audio generation.")
|
61 |
+
seed = gr.Number(value=25, label="Random seed", info="Change the random seed for a different generation result.")
|
62 |
+
cond = gr.Slider(0.0, 1.0, value=1.0, step=0.1, label="Conditioning scale", info="Enter a value between 0 and 1. The larger the more it will take the conditioning into account. Lower values are recommended for more creative prompts.")
|
63 |
+
guess = gr.Checkbox(label="Guess mode", info="If selected, the model will try to recognize the content of the MIDI without the need of a text prompt.")
|
64 |
btn = gr.Button("Generate")
|
65 |
btn.click(predict, inputs=[midi, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess], outputs=[audio])
|
66 |
# gr.Examples(examples=[["S00.mid", "piano", "", 10, 25, 1.0, 20, 2.5, False], ["S00.mid", "violin", "", 10, 25, 1.0, 20, 2.5, False], ["S00.mid", "woman singing", "", 10, 25, 0.8, 20, 2.5, False]], inputs=[midi, prompt, neg_prompt, duration, seed, cond, inf, guidance_scale, guess], fn=predict, outputs=audio, cache_examples=True)
|