Update app.py
Browse files
app.py
CHANGED
@@ -95,4 +95,19 @@ with gr.Blocks() as demo:
|
|
95 |
motion_bucket_id = gr.Slider(label="Motion bucket id", value=127, minimum=1, maximum=255)
|
96 |
fps_id = gr.Slider(label="Frames per second", value=6, minimum=5, maximum=30)
|
97 |
|
98 |
-
image.upload(fn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
motion_bucket_id = gr.Slider(label="Motion bucket id", value=127, minimum=1, maximum=255)
|
96 |
fps_id = gr.Slider(label="Frames per second", value=6, minimum=5, maximum=30)
|
97 |
|
98 |
+
image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
|
99 |
+
generate_btn.click(fn=sample, inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id], outputs=[video, seed], api_name="video")
|
100 |
+
|
101 |
+
# Dynamically load examples from the filesystem
|
102 |
+
example_images = get_example_images()
|
103 |
+
gr.Examples(
|
104 |
+
examples=example_images,
|
105 |
+
inputs=image,
|
106 |
+
outputs=[video, seed],
|
107 |
+
fn=sample,
|
108 |
+
cache_examples=True,
|
109 |
+
)
|
110 |
+
|
111 |
+
if __name__ == "__main__":
|
112 |
+
demo.queue(max_size=20)
|
113 |
+
demo.launch(share=True)
|