Spaces:
Paused
Paused
Add examples
Browse files- gradio_app.py +20 -0
gradio_app.py
CHANGED
@@ -244,6 +244,26 @@ with gr.Blocks(css=css) as demo:
|
|
244 |
|
245 |
video_output=gr.Video(label="Generated Video")
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
submit_btn.click(
|
248 |
fn=run_inference,
|
249 |
inputs=[user_prompt, guidance_scale, num_sampling_steps, seed, enable_cpu_offload],
|
|
|
244 |
|
245 |
video_output=gr.Video(label="Generated Video")
|
246 |
|
247 |
+
def load_allegro_examples(prompt):
|
248 |
+
if prompt == "A Monkey is playing bass guitar.":
|
249 |
+
return "https://rhymes.ai/allegroVideos/30_demo_w_watermark_prompt_1018/11.mp4"
|
250 |
+
elif prompt == "An astronaut riding a horde.":
|
251 |
+
return "https://rhymes.ai/allegroVideos/30_demo_w_watermark_prompt_1018/15.mp4"
|
252 |
+
elif prompt == "A tiny finch on a branch with spring flowers on background.":
|
253 |
+
return "https://rhymes.ai/allegroVideos/30_demo_w_watermark_prompt_1018/22.mp4"
|
254 |
+
|
255 |
+
gr.Examples(
|
256 |
+
examples=[
|
257 |
+
["A Monkey is playing bass guitar."],
|
258 |
+
["An astronaut riding a horse."],
|
259 |
+
["A tiny finch on a branch with spring flowers on background."]
|
260 |
+
],
|
261 |
+
fn=load_allegro_examples,
|
262 |
+
inputs=[user_prompt],
|
263 |
+
outputs=video_output,
|
264 |
+
run_on_click=True
|
265 |
+
)
|
266 |
+
|
267 |
submit_btn.click(
|
268 |
fn=run_inference,
|
269 |
inputs=[user_prompt, guidance_scale, num_sampling_steps, seed, enable_cpu_offload],
|