Spaces:
Running on Zero
Running on Zero
Tighten ZeroGPU duration estimate to measured timings
Browse files
app.py
CHANGED
|
@@ -88,7 +88,7 @@ def estimate_duration(image=None, scale="2x", *args, **kwargs) -> int:
|
|
| 88 |
pixels = min(image.width * image.height, MAX_INPUT_PIXELS)
|
| 89 |
passes = FACTORS.get(scale, 1)
|
| 90 |
output_megapixels = pixels * 4**passes / 1e6
|
| 91 |
-
return int(min(
|
| 92 |
|
| 93 |
|
| 94 |
@spaces.GPU(duration=estimate_duration)
|
|
|
|
| 88 |
pixels = min(image.width * image.height, MAX_INPUT_PIXELS)
|
| 89 |
passes = FACTORS.get(scale, 1)
|
| 90 |
output_megapixels = pixels * 4**passes / 1e6
|
| 91 |
+
return int(min(60, 10 + output_megapixels))
|
| 92 |
|
| 93 |
|
| 94 |
@spaces.GPU(duration=estimate_duration)
|