Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ random_seed = 42
|
|
56 |
video_length = 201
|
57 |
W = 1024
|
58 |
H = W
|
59 |
-
device = "
|
60 |
|
61 |
def get_pipe_image_and_video_predictor():
|
62 |
vae = AutoencoderKLWan.from_pretrained("./model/vae", torch_dtype=torch.float16)
|
@@ -206,7 +206,7 @@ def inference_and_return_video(dilation_iterations, num_inference_steps, video_s
|
|
206 |
height=height,
|
207 |
width=width,
|
208 |
num_inference_steps=int(num_inference_steps),
|
209 |
-
generator=torch.Generator(device=
|
210 |
iterations=int(dilation_iterations)
|
211 |
).frames[0]
|
212 |
|
@@ -218,7 +218,7 @@ def inference_and_return_video(dilation_iterations, num_inference_steps, video_s
|
|
218 |
clip.write_videofile(video_file, codec='libx264', audio=False, verbose=False, logger=None)
|
219 |
return video_file
|
220 |
|
221 |
-
|
222 |
def track_video(n_frames, video_state):
|
223 |
|
224 |
input_points = video_state["input_points"]
|
|
|
56 |
video_length = 201
|
57 |
W = 1024
|
58 |
H = W
|
59 |
+
device = "cuda"
|
60 |
|
61 |
def get_pipe_image_and_video_predictor():
|
62 |
vae = AutoencoderKLWan.from_pretrained("./model/vae", torch_dtype=torch.float16)
|
|
|
206 |
height=height,
|
207 |
width=width,
|
208 |
num_inference_steps=int(num_inference_steps),
|
209 |
+
generator=torch.Generator(device=device).manual_seed(random_seed),
|
210 |
iterations=int(dilation_iterations)
|
211 |
).frames[0]
|
212 |
|
|
|
218 |
clip.write_videofile(video_file, codec='libx264', audio=False, verbose=False, logger=None)
|
219 |
return video_file
|
220 |
|
221 |
+
@spaces.GPU(duration=200)
|
222 |
def track_video(n_frames, video_state):
|
223 |
|
224 |
input_points = video_state["input_points"]
|