Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ import cv2
|
|
| 11 |
import json
|
| 12 |
import gradio as gr
|
| 13 |
import sys
|
|
|
|
| 14 |
|
| 15 |
BASE = os.path.dirname(os.path.abspath(__file__))
|
| 16 |
PREPROCESS_DIR = os.path.join(BASE, "wan", "modules", "animate", "preprocess")
|
|
@@ -289,6 +290,9 @@ def _animate(input_video, max_duration_s, edited_frame, rc_bool, session_id = No
|
|
| 289 |
total_time = preprocess_time + generate_time
|
| 290 |
print(f"Total time: {total_time:.2f} seconds")
|
| 291 |
|
|
|
|
|
|
|
|
|
|
| 292 |
return output_video_path
|
| 293 |
|
| 294 |
def animate_scene(input_video, max_duration_s, edited_frame, rc_str, session_id = None, progress=gr.Progress(track_tqdm=True),):
|
|
|
|
| 11 |
import json
|
| 12 |
import gradio as gr
|
| 13 |
import sys
|
| 14 |
+
import gc
|
| 15 |
|
| 16 |
BASE = os.path.dirname(os.path.abspath(__file__))
|
| 17 |
PREPROCESS_DIR = os.path.join(BASE, "wan", "modules", "animate", "preprocess")
|
|
|
|
| 290 |
total_time = preprocess_time + generate_time
|
| 291 |
print(f"Total time: {total_time:.2f} seconds")
|
| 292 |
|
| 293 |
+
gc.collect()
|
| 294 |
+
torch.cuda.empty_cache()
|
| 295 |
+
|
| 296 |
return output_video_path
|
| 297 |
|
| 298 |
def animate_scene(input_video, max_duration_s, edited_frame, rc_str, session_id = None, progress=gr.Progress(track_tqdm=True),):
|