Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -102,7 +102,7 @@ def calculate_dimensions(width, height):
|
|
102 |
return (new_width // 16) * 16, (new_height // 16) * 16
|
103 |
|
104 |
@spaces.GPU(duration=120)
|
105 |
-
def generate_video(prompt, first_image_path, last_image_path, duration_seconds):
|
106 |
# Create a temporary directory for resized images
|
107 |
temp_dir = "input"
|
108 |
os.makedirs(temp_dir, exist_ok=True)
|
@@ -156,7 +156,7 @@ def generate_video(prompt, first_image_path, last_image_path, duration_seconds):
|
|
156 |
|
157 |
vaedecode_8 = vaedecode.decode(samples=get_value_at_index(ksampleradvanced_102, 0), vae=get_value_at_index(vaeloader_39, 0))
|
158 |
createvideo_104 = createvideo.create_video(fps=16, images=get_value_at_index(vaedecode_8, 0))
|
159 |
-
savevideo_103 = savevideo.save_video(filename_prefix="ComfyUI_Video", format="mp4", codec="
|
160 |
|
161 |
return f"output/{savevideo_103['ui']['videos'][0]['filename']}"
|
162 |
|
|
|
102 |
return (new_width // 16) * 16, (new_height // 16) * 16
|
103 |
|
104 |
@spaces.GPU(duration=120)
|
105 |
+
def generate_video(prompt, first_image_path, last_image_path, duration_seconds, progress=gr.Progress(track_tqdm=True)):
|
106 |
# Create a temporary directory for resized images
|
107 |
temp_dir = "input"
|
108 |
os.makedirs(temp_dir, exist_ok=True)
|
|
|
156 |
|
157 |
vaedecode_8 = vaedecode.decode(samples=get_value_at_index(ksampleradvanced_102, 0), vae=get_value_at_index(vaeloader_39, 0))
|
158 |
createvideo_104 = createvideo.create_video(fps=16, images=get_value_at_index(vaedecode_8, 0))
|
159 |
+
savevideo_103 = savevideo.save_video(filename_prefix="ComfyUI_Video", format="mp4", codec="h264", video=get_value_at_index(createvideo_104, 0))
|
160 |
|
161 |
return f"output/{savevideo_103['ui']['videos'][0]['filename']}"
|
162 |
|