Files changed (2) hide show
  1. app.py +8 -1
  2. requirements.txt +1 -2
app.py CHANGED
@@ -125,7 +125,14 @@ def get_duration(image,
125
  seed,
126
  progress):
127
  """Calculate dynamic GPU duration based on parameters."""
128
- return sampling_steps * 15
 
 
 
 
 
 
 
129
 
130
  # --- 2. Gradio Inference Function ---
131
  @spaces.GPU(duration=get_duration)
 
125
  seed,
126
  progress):
127
  """Calculate dynamic GPU duration based on parameters."""
128
+ if duration_seconds >= 3:
129
+ return 220
130
+ elif sampling_steps > 35 and duration_seconds >= 2:
131
+ return 180
132
+ elif sampling_steps < 35 or duration_seconds < 2:
133
+ return 105
134
+ else:
135
+ return 90
136
 
137
  # --- 2. Gradio Inference Function ---
138
  @spaces.GPU(duration=get_duration)
requirements.txt CHANGED
@@ -11,6 +11,5 @@ easydict
11
  ftfy
12
  dashscope
13
  imageio-ffmpeg
14
- https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.3.18/flash_attn-2.7.4+cu128torch2.8-cp310-cp310-linux_x86_64.whl
15
  numpy>=1.23.5,<2
16
-
 
11
  ftfy
12
  dashscope
13
  imageio-ffmpeg
14
+ https://github.com/mjun0812/flash-attention-prebuild-wheels/releases/download/v0.0.8/flash_attn-2.7.4.post1+cu126torch2.7-cp310-cp310-linux_x86_64.whl
15
  numpy>=1.23.5,<2