Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,6 +148,11 @@ def get_duration(
|
|
| 148 |
duration_seconds, guidance_scale, guidance_scale_2,
|
| 149 |
seed, randomize_seed, progress,
|
| 150 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
BASE_FRAMES_HEIGHT_WIDTH = 81 * 832 * 624
|
| 152 |
BASE_STEP_DURATION = 15
|
| 153 |
width, height = resize_image(input_image).size
|
|
@@ -265,7 +270,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 265 |
inputs=[input_image_component, prompt_input, steps_slider],
|
| 266 |
outputs=[video_output, seed_input],
|
| 267 |
fn=generate_video,
|
| 268 |
-
cache_examples=
|
| 269 |
)
|
| 270 |
|
| 271 |
if __name__ == "__main__":
|
|
|
|
| 148 |
duration_seconds, guidance_scale, guidance_scale_2,
|
| 149 |
seed, randomize_seed, progress,
|
| 150 |
):
|
| 151 |
+
# --- CRITICAL FIX: Handle NoneType for input_image ---
|
| 152 |
+
if input_image is None:
|
| 153 |
+
return 120 # Return default duration if image is missing to prevent crash
|
| 154 |
+
# -----------------------------------------------------
|
| 155 |
+
|
| 156 |
BASE_FRAMES_HEIGHT_WIDTH = 81 * 832 * 624
|
| 157 |
BASE_STEP_DURATION = 15
|
| 158 |
width, height = resize_image(input_image).size
|
|
|
|
| 270 |
inputs=[input_image_component, prompt_input, steps_slider],
|
| 271 |
outputs=[video_output, seed_input],
|
| 272 |
fn=generate_video,
|
| 273 |
+
cache_examples=False # Disabled caching to prevent startup errors
|
| 274 |
)
|
| 275 |
|
| 276 |
if __name__ == "__main__":
|