hidream commited on
Commit ·
c8e598e
1
Parent(s): 308bae8
cold reservation 75s (~112 requested, under Free per-task cap)
Browse files
app.py
CHANGED
|
@@ -247,9 +247,9 @@ def estimate_gen_duration(prompt, negative_prompt, width, height, steps, guidanc
|
|
| 247 |
# from disk cache into RAM takes minutes -> reserve big once.
|
| 248 |
# Same process runs estimator + GPU fn, so global state is visible.
|
| 249 |
# NOTE: Spaces inflates requested duration x1.5, Free caps per-task
|
| 250 |
-
# duration -> keep cold at
|
| 251 |
if pipe_gen is None:
|
| 252 |
-
return max(est,
|
| 253 |
return est
|
| 254 |
return est
|
| 255 |
|
|
@@ -268,9 +268,9 @@ def estimate_edit_duration(image, edit_instruction, target_description, steps, g
|
|
| 268 |
pass
|
| 269 |
est = int(est + 10)
|
| 270 |
est = max(35, min(180, est))
|
| 271 |
-
# Cold worker: same big-reservation logic as generation (
|
| 272 |
if pipe_edit is None:
|
| 273 |
-
return max(est,
|
| 274 |
return est
|
| 275 |
except Exception:
|
| 276 |
return 80
|
|
|
|
| 247 |
# from disk cache into RAM takes minutes -> reserve big once.
|
| 248 |
# Same process runs estimator + GPU fn, so global state is visible.
|
| 249 |
# NOTE: Spaces inflates requested duration x1.5, Free caps per-task
|
| 250 |
+
# duration (below 240s requested) -> keep cold at 75 (~112 requested).
|
| 251 |
if pipe_gen is None:
|
| 252 |
+
return max(est, 75)
|
| 253 |
return est
|
| 254 |
return est
|
| 255 |
|
|
|
|
| 268 |
pass
|
| 269 |
est = int(est + 10)
|
| 270 |
est = max(35, min(180, est))
|
| 271 |
+
# Cold worker: same big-reservation logic as generation (75 -> ~112 requested)
|
| 272 |
if pipe_edit is None:
|
| 273 |
+
return max(est, 75)
|
| 274 |
return est
|
| 275 |
except Exception:
|
| 276 |
return 80
|