Spaces:
Sleeping
Sleeping
Fix xlarge ZeroGPU duration limit
Browse files
app.py
CHANGED
|
@@ -183,7 +183,9 @@ def _parse_size(size: str) -> tuple[int, int]:
|
|
| 183 |
|
| 184 |
|
| 185 |
def _gpu_duration(_files, _prompt, _size, steps, *_args):
|
| 186 |
-
|
|
|
|
|
|
|
| 187 |
|
| 188 |
|
| 189 |
def _ensure_image_lora():
|
|
|
|
| 183 |
|
| 184 |
|
| 185 |
def _gpu_duration(_files, _prompt, _size, steps, *_args):
|
| 186 |
+
# ZeroGPU charges xlarge requests at 2x duration, so the raw request must
|
| 187 |
+
# stay at or below 150 seconds to remain within the 300-second limit.
|
| 188 |
+
return min(150, max(120, int(steps) * 3))
|
| 189 |
|
| 190 |
|
| 191 |
def _ensure_image_lora():
|