Matteoooo46 commited on
Commit
ce1be27
·
verified ·
1 Parent(s): 09f9bc4

Fix xlarge ZeroGPU duration limit

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- return min(300, max(120, int(steps) * 5 + 45))
 
 
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():