Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -93,11 +93,13 @@ if torch.cuda.is_available():
|
|
93 |
smoother = RIFESmoother.from_model_manager(model_manager2)
|
94 |
|
95 |
|
96 |
-
def change_media(image_in, video_in, selected):
|
97 |
if selected == "ExVideo":
|
98 |
-
|
|
|
99 |
elif selected == "Diffutoon":
|
100 |
-
|
|
|
101 |
|
102 |
|
103 |
|
@@ -261,7 +263,7 @@ with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
|
|
261 |
inputs=[video_in, image_in, selected, prompt],
|
262 |
examples_per_page=4,
|
263 |
)
|
264 |
-
selected.change(change_media, inputs=[image_in, video_in, selected], outputs=[image_in, video_in, media, prompt])
|
265 |
submit_event = submit_btn.click(fn=generate, inputs=[media, selected, prompt, seed, num_inference_steps, animatediff_batch_size, animatediff_stride, motion_bucket_id, fps_id, num_frames], outputs=[video, seed], api_name="video")
|
266 |
#stop_btn.click(fn=None, inputs=None, outputs=None, cancels=[submit_event])
|
267 |
|
|
|
93 |
smoother = RIFESmoother.from_model_manager(model_manager2)
|
94 |
|
95 |
|
96 |
+
def change_media(image_in, video_in, media, selected):
|
97 |
if selected == "ExVideo":
|
98 |
+
media = image_in
|
99 |
+
return gr.update(visible=True), gr.update(visible=False), media, gr.update(visible=False)
|
100 |
elif selected == "Diffutoon":
|
101 |
+
media = video_in
|
102 |
+
return gr.update(visible=False), gr.update(visible=True), media, gr.update(visible=True)
|
103 |
|
104 |
|
105 |
|
|
|
263 |
inputs=[video_in, image_in, selected, prompt],
|
264 |
examples_per_page=4,
|
265 |
)
|
266 |
+
selected.change(change_media, inputs=[image_in, video_in, media, selected], outputs=[image_in, video_in, media, prompt])
|
267 |
submit_event = submit_btn.click(fn=generate, inputs=[media, selected, prompt, seed, num_inference_steps, animatediff_batch_size, animatediff_stride, motion_bucket_id, fps_id, num_frames], outputs=[video, seed], api_name="video")
|
268 |
#stop_btn.click(fn=None, inputs=None, outputs=None, cancels=[submit_event])
|
269 |
|