Spaces:
Running
on
Zero
Running
on
Zero
Zero GPU readiness
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import glob
|
|
7 |
from moviepy.editor import VideoFileClip
|
8 |
from datetime import datetime
|
9 |
import time
|
10 |
-
|
11 |
is_shared_ui = True if "fffiloni/X-Portrait" in os.environ['SPACE_ID'] else False
|
12 |
|
13 |
# Ensure 'checkpoint' directory exists
|
@@ -92,6 +92,7 @@ def extract_frames_with_labels(video_path, base_output_dir="frames"):
|
|
92 |
return frame_data
|
93 |
|
94 |
# Define a function to run your script with selected inputs
|
|
|
95 |
def run_xportrait(source_image, driving_video, seed, uc_scale, best_frame, out_frames, num_mix, ddim_steps, progress=gr.Progress(track_tqdm=True)):
|
96 |
|
97 |
start_time = time.perf_counter()
|
|
|
7 |
from moviepy.editor import VideoFileClip
|
8 |
from datetime import datetime
|
9 |
import time
|
10 |
+
import spaces
|
11 |
is_shared_ui = True if "fffiloni/X-Portrait" in os.environ['SPACE_ID'] else False
|
12 |
|
13 |
# Ensure 'checkpoint' directory exists
|
|
|
92 |
return frame_data
|
93 |
|
94 |
# Define a function to run your script with selected inputs
|
95 |
+
@spaces.GPU(duration=250)
|
96 |
def run_xportrait(source_image, driving_video, seed, uc_scale, best_frame, out_frames, num_mix, ddim_steps, progress=gr.Progress(track_tqdm=True)):
|
97 |
|
98 |
start_time = time.perf_counter()
|