Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def handle_gallery_upload_for_dims_wan(gallery_images, current_h_val, current_w_
|
|
| 77 |
return gr.update(value=DEFAULT_H_SLIDER_VALUE), gr.update(value=DEFAULT_W_SLIDER_VALUE)
|
| 78 |
try:
|
| 79 |
# Use the first image to calculate dimensions
|
| 80 |
-
first_image = gallery_images[0]
|
| 81 |
new_h, new_w = _calculate_new_dimensions_wan(
|
| 82 |
first_image, MOD_VALUE, NEW_FORMULA_MAX_AREA,
|
| 83 |
SLIDER_MIN_H, SLIDER_MAX_H, SLIDER_MIN_W, SLIDER_MAX_W,
|
|
@@ -176,6 +176,8 @@ def generate_video(gallery_images, mode, prompt, height, width,
|
|
| 176 |
"""
|
| 177 |
if gallery_images is None or len(gallery_images) == 0:
|
| 178 |
raise gr.Error("Please upload at least one image to the gallery.")
|
|
|
|
|
|
|
| 179 |
|
| 180 |
if mode == "FLF2V" and len(gallery_images) >= 2:
|
| 181 |
gallery_images = gallery_images[:2]
|
|
|
|
| 77 |
return gr.update(value=DEFAULT_H_SLIDER_VALUE), gr.update(value=DEFAULT_W_SLIDER_VALUE)
|
| 78 |
try:
|
| 79 |
# Use the first image to calculate dimensions
|
| 80 |
+
first_image = gallery_images[0][0]
|
| 81 |
new_h, new_w = _calculate_new_dimensions_wan(
|
| 82 |
first_image, MOD_VALUE, NEW_FORMULA_MAX_AREA,
|
| 83 |
SLIDER_MIN_H, SLIDER_MAX_H, SLIDER_MIN_W, SLIDER_MAX_W,
|
|
|
|
| 176 |
"""
|
| 177 |
if gallery_images is None or len(gallery_images) == 0:
|
| 178 |
raise gr.Error("Please upload at least one image to the gallery.")
|
| 179 |
+
else:
|
| 180 |
+
gallery_images = [img[0] for img in gallery_images]
|
| 181 |
|
| 182 |
if mode == "FLF2V" and len(gallery_images) >= 2:
|
| 183 |
gallery_images = gallery_images[:2]
|