Spaces:
Running on Zero
Running on Zero
Ask before leaving
Browse files
app.py
CHANGED
|
@@ -360,7 +360,25 @@ def generate_video_on_gpu(
|
|
| 360 |
|
| 361 |
# --- 3. Gradio User Interface ---
|
| 362 |
|
| 363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
gr.Markdown("# Wan 2.2 First/Last Frame Video Fast")
|
| 365 |
gr.Markdown("Based on the [Wan 2.2 First/Last Frame workflow](https://www.reddit.com/r/StableDiffusion/comments/1me4306/psa_wan_22_does_first_frame_last_frame_out_of_the/), applied to 🧨 Diffusers + [lightx2v/Wan2.2-Lightning](https://huggingface.co/lightx2v/Wan2.2-Lightning) 8-step LoRA")
|
| 366 |
|
|
|
|
| 360 |
|
| 361 |
# --- 3. Gradio User Interface ---
|
| 362 |
|
| 363 |
+
|
| 364 |
+
|
| 365 |
+
js = """
|
| 366 |
+
function createGradioAnimation() {
|
| 367 |
+
window.addEventListener("beforeunload", function(e) {
|
| 368 |
+
if (document.getElementById('dummy_button_id') && !document.getElementById('dummy_button_id').disabled) {
|
| 369 |
+
var confirmationMessage = 'A process is still running. '
|
| 370 |
+
+ 'If you leave before saving, your changes will be lost.';
|
| 371 |
+
|
| 372 |
+
(e || window.event).returnValue = confirmationMessage;
|
| 373 |
+
}
|
| 374 |
+
return confirmationMessage;
|
| 375 |
+
});
|
| 376 |
+
return 'Animation created';
|
| 377 |
+
}
|
| 378 |
+
"""
|
| 379 |
+
|
| 380 |
+
# Gradio interface
|
| 381 |
+
with gr.Blocks(js=js) as app:
|
| 382 |
gr.Markdown("# Wan 2.2 First/Last Frame Video Fast")
|
| 383 |
gr.Markdown("Based on the [Wan 2.2 First/Last Frame workflow](https://www.reddit.com/r/StableDiffusion/comments/1me4306/psa_wan_22_does_first_frame_last_frame_out_of_the/), applied to 🧨 Diffusers + [lightx2v/Wan2.2-Lightning](https://huggingface.co/lightx2v/Wan2.2-Lightning) 8-step LoRA")
|
| 384 |
|