Spaces:
Runtime error
Runtime error
Fix time
Browse files
app.py
CHANGED
|
@@ -197,7 +197,8 @@ def generate_video(
|
|
| 197 |
start_image_pil = input_image_debug_value[0]
|
| 198 |
end_image_pil = end_image_debug_value[0]
|
| 199 |
prompt = prompt_debug_value[0]
|
| 200 |
-
duration_seconds =
|
|
|
|
| 201 |
|
| 202 |
return generate_video_on_gpu(
|
| 203 |
start_image_pil,
|
|
@@ -210,7 +211,8 @@ def generate_video(
|
|
| 210 |
guidance_scale_2,
|
| 211 |
seed,
|
| 212 |
randomize_seed,
|
| 213 |
-
progress
|
|
|
|
| 214 |
)
|
| 215 |
|
| 216 |
def get_duration(
|
|
@@ -224,9 +226,10 @@ def get_duration(
|
|
| 224 |
guidance_scale_2,
|
| 225 |
seed,
|
| 226 |
randomize_seed,
|
| 227 |
-
progress
|
|
|
|
| 228 |
):
|
| 229 |
-
return
|
| 230 |
|
| 231 |
@spaces.GPU(duration=get_duration)
|
| 232 |
def generate_video_on_gpu(
|
|
@@ -240,7 +243,8 @@ def generate_video_on_gpu(
|
|
| 240 |
guidance_scale_2,
|
| 241 |
seed,
|
| 242 |
randomize_seed,
|
| 243 |
-
progress
|
|
|
|
| 244 |
):
|
| 245 |
"""
|
| 246 |
Generates a video by interpolating between a start and end image, guided by a text prompt,
|
|
|
|
| 197 |
start_image_pil = input_image_debug_value[0]
|
| 198 |
end_image_pil = end_image_debug_value[0]
|
| 199 |
prompt = prompt_debug_value[0]
|
| 200 |
+
duration_seconds = total_second_length_debug_value[0]
|
| 201 |
+
allocation_time = min(duration_seconds * 60 * 100, 600)
|
| 202 |
|
| 203 |
return generate_video_on_gpu(
|
| 204 |
start_image_pil,
|
|
|
|
| 211 |
guidance_scale_2,
|
| 212 |
seed,
|
| 213 |
randomize_seed,
|
| 214 |
+
progress,
|
| 215 |
+
allocation_time
|
| 216 |
)
|
| 217 |
|
| 218 |
def get_duration(
|
|
|
|
| 226 |
guidance_scale_2,
|
| 227 |
seed,
|
| 228 |
randomize_seed,
|
| 229 |
+
progress,
|
| 230 |
+
allocation_time
|
| 231 |
):
|
| 232 |
+
return allocation_time
|
| 233 |
|
| 234 |
@spaces.GPU(duration=get_duration)
|
| 235 |
def generate_video_on_gpu(
|
|
|
|
| 243 |
guidance_scale_2,
|
| 244 |
seed,
|
| 245 |
randomize_seed,
|
| 246 |
+
progress,
|
| 247 |
+
allocation_time
|
| 248 |
):
|
| 249 |
"""
|
| 250 |
Generates a video by interpolating between a start and end image, guided by a text prompt,
|