Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -48,9 +48,11 @@ def infer(prompt,video_in, seed_in, trim_value):
|
|
48 |
frames_list= break_vid[0]
|
49 |
fps = break_vid[1]
|
50 |
n_frame = int(trim_value*fps)
|
|
|
|
|
51 |
result_frames = []
|
52 |
print("set stop frames to: " + n_frame)
|
53 |
-
for i in frames_list[0:n_frame]:
|
54 |
pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,seed_in,fn_index=0)
|
55 |
images = [os.path.join(pix2pix_img[0], img) for img in os.listdir(pix2pix_img[0])]
|
56 |
result_frames.append(images[0])
|
|
|
48 |
frames_list= break_vid[0]
|
49 |
fps = break_vid[1]
|
50 |
n_frame = int(trim_value*fps)
|
51 |
+
if n_frame >= len(frames_list):
|
52 |
+
n_frame = len(frames_list)
|
53 |
result_frames = []
|
54 |
print("set stop frames to: " + n_frame)
|
55 |
+
for i in frames_list[0:int(n_frame)]:
|
56 |
pix2pix_img = pix2pix(prompt,5.5,1.5,i,15,"",512,512,seed_in,fn_index=0)
|
57 |
images = [os.path.join(pix2pix_img[0], img) for img in os.listdir(pix2pix_img[0])]
|
58 |
result_frames.append(images[0])
|