Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -91,11 +91,11 @@ def handle_image_upload(image):
|
|
91 |
def get_duration(image, prompt, size, duration_seconds, sampling_steps, guide_scale, shift, seed):
|
92 |
"""Calculate dynamic GPU duration based on parameters."""
|
93 |
if sampling_steps > 35 and duration_seconds > 2:
|
94 |
-
return
|
95 |
elif sampling_steps > 35 or duration_seconds > 2:
|
96 |
-
return
|
97 |
else:
|
98 |
-
return
|
99 |
|
100 |
# --- 2. Gradio Inference Function ---
|
101 |
@spaces.GPU(duration=get_duration)
|
|
|
91 |
def get_duration(image, prompt, size, duration_seconds, sampling_steps, guide_scale, shift, seed):
|
92 |
"""Calculate dynamic GPU duration based on parameters."""
|
93 |
if sampling_steps > 35 and duration_seconds > 2:
|
94 |
+
return 95
|
95 |
elif sampling_steps > 35 or duration_seconds > 2:
|
96 |
+
return 85
|
97 |
else:
|
98 |
+
return 70
|
99 |
|
100 |
# --- 2. Gradio Inference Function ---
|
101 |
@spaces.GPU(duration=get_duration)
|