fix: increase GPU duration estimate for 22B model with CPU offload overhead
Browse files
app.py
CHANGED
|
@@ -277,9 +277,11 @@ def _estimate_duration(*args, **kwargs):
|
|
| 277 |
num_frames = int(num_frames)
|
| 278 |
num_inference_steps = int(num_inference_steps)
|
| 279 |
except (TypeError, ValueError):
|
| 280 |
-
return
|
| 281 |
-
|
| 282 |
-
|
|
|
|
|
|
|
| 283 |
return min(240, int(base * frame_factor))
|
| 284 |
|
| 285 |
|
|
|
|
| 277 |
num_frames = int(num_frames)
|
| 278 |
num_inference_steps = int(num_inference_steps)
|
| 279 |
except (TypeError, ValueError):
|
| 280 |
+
return 240
|
| 281 |
+
# 22B model with enable_model_cpu_offload(): first step ~28s (cold),
|
| 282 |
+
# subsequent ~5s each, plus VAE decode + video encoding ~20s.
|
| 283 |
+
base = 60 + num_inference_steps * 8
|
| 284 |
+
frame_factor = max(1.0, num_frames / 41)
|
| 285 |
return min(240, int(base * frame_factor))
|
| 286 |
|
| 287 |
|