Spaces:
Sleeping
Sleeping
Increase zero GPU timeout by 10% to prevent user timeouts
Browse filesUpdated all dynamic duration calculations with additional 10% buffer:
- Standard pipeline: 32% safety margin (was 20%)
- Artistic pipeline: 37.5% safety margin (was 25%)
This ensures users have sufficient time to complete generations across all configurations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -579,7 +579,7 @@ def compile_models_with_aoti():
|
|
| 579 |
|
| 580 |
def get_dynamic_duration(*args, **kwargs):
|
| 581 |
"""
|
| 582 |
-
Calculate GPU duration based on benchmarks with
|
| 583 |
Max duration capped at 120s (unauthenticated user limit).
|
| 584 |
|
| 585 |
Benchmarks (actual measured times):
|
|
@@ -600,32 +600,32 @@ def get_dynamic_duration(*args, **kwargs):
|
|
| 600 |
print(f"[GPU DURATION DEBUG] Extracted: pipeline={pipeline}, image_size={image_size}, enable_animation={enable_animation}, enable_upscale={enable_upscale}")
|
| 601 |
|
| 602 |
if pipeline == "standard":
|
| 603 |
-
# Standard pipeline benchmarks (with
|
| 604 |
if image_size <= 512:
|
| 605 |
-
duration =
|
| 606 |
elif image_size <= 640:
|
| 607 |
-
duration =
|
| 608 |
elif image_size <= 768:
|
| 609 |
-
duration =
|
| 610 |
elif image_size <= 832:
|
| 611 |
-
duration =
|
| 612 |
else: # 1024
|
| 613 |
-
duration =
|
| 614 |
else: # artistic
|
| 615 |
-
# Artistic pipeline benchmarks (with
|
| 616 |
if image_size <= 512:
|
| 617 |
# Extrapolated from 640 benchmark (~18s base)
|
| 618 |
-
duration =
|
| 619 |
elif image_size <= 640:
|
| 620 |
-
duration =
|
| 621 |
elif image_size <= 768:
|
| 622 |
# Interpolated between 640 and 832 (~35s base)
|
| 623 |
-
duration =
|
| 624 |
elif image_size <= 832:
|
| 625 |
-
duration =
|
| 626 |
else: # 1024
|
| 627 |
# Extrapolated from 832 (~75s base)
|
| 628 |
-
duration =
|
| 629 |
|
| 630 |
# Cap at 120 seconds (unauthenticated user limit)
|
| 631 |
final_duration = min(duration, 120)
|
|
|
|
| 579 |
|
| 580 |
def get_dynamic_duration(*args, **kwargs):
|
| 581 |
"""
|
| 582 |
+
Calculate GPU duration based on benchmarks with 32-37.5% safety margin (+10% buffer).
|
| 583 |
Max duration capped at 120s (unauthenticated user limit).
|
| 584 |
|
| 585 |
Benchmarks (actual measured times):
|
|
|
|
| 600 |
print(f"[GPU DURATION DEBUG] Extracted: pipeline={pipeline}, image_size={image_size}, enable_animation={enable_animation}, enable_upscale={enable_upscale}")
|
| 601 |
|
| 602 |
if pipeline == "standard":
|
| 603 |
+
# Standard pipeline benchmarks (with 32% safety margin = 20% + 10% buffer)
|
| 604 |
if image_size <= 512:
|
| 605 |
+
duration = 13 if enable_animation else 10
|
| 606 |
elif image_size <= 640:
|
| 607 |
+
duration = 20 if enable_animation else 14
|
| 608 |
elif image_size <= 768:
|
| 609 |
+
duration = 24 if enable_animation else 18
|
| 610 |
elif image_size <= 832:
|
| 611 |
+
duration = 26 if enable_animation else 19
|
| 612 |
else: # 1024
|
| 613 |
+
duration = 53 if enable_animation else 37
|
| 614 |
else: # artistic
|
| 615 |
+
# Artistic pipeline benchmarks (with 37.5% safety margin = 25% + 10% buffer)
|
| 616 |
if image_size <= 512:
|
| 617 |
# Extrapolated from 640 benchmark (~18s base)
|
| 618 |
+
duration = 24 if not enable_upscale else 42
|
| 619 |
elif image_size <= 640:
|
| 620 |
+
duration = 31 if not enable_upscale else 55
|
| 621 |
elif image_size <= 768:
|
| 622 |
# Interpolated between 640 and 832 (~35s base)
|
| 623 |
+
duration = 48 if not enable_upscale else 72
|
| 624 |
elif image_size <= 832:
|
| 625 |
+
duration = 62 if not enable_upscale else 79
|
| 626 |
else: # 1024
|
| 627 |
# Extrapolated from 832 (~75s base)
|
| 628 |
+
duration = 103 if not enable_upscale else 132 # Worst case measured at 124s
|
| 629 |
|
| 630 |
# Cap at 120 seconds (unauthenticated user limit)
|
| 631 |
final_duration = min(duration, 120)
|