Spaces:
Running
on
Zero
Running
on
Zero
fix: duration
Browse files
app.py
CHANGED
|
@@ -74,13 +74,14 @@ def get_examples():
|
|
| 74 |
]
|
| 75 |
return case
|
| 76 |
|
| 77 |
-
def get_duration(
|
| 78 |
-
|
| 79 |
-
n_max_val
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 84 |
|
| 85 |
@spaces.GPU(duration=get_duration)
|
| 86 |
def FlowOpt_run(
|
|
|
|
| 74 |
]
|
| 75 |
return case
|
| 76 |
|
| 77 |
+
def get_duration(
|
| 78 |
+
image_src_val: str, model_type_val: str, T_steps_val: int,
|
| 79 |
+
n_max_val: int, eta_val: float, flowopt_iterations_val: int,
|
| 80 |
+
src_prompt_val: str, tar_prompt_val: str,
|
| 81 |
+
src_guidance_scale_val: float, tar_guidance_scale_val: float,
|
| 82 |
+
) -> float:
|
| 83 |
+
step_duration = 0.6 if model_type_val == 'FLUX' else 0.2
|
| 84 |
+
return (n_max_val * (flowopt_iterations_val + 2) * step_duration) + 20
|
| 85 |
|
| 86 |
@spaces.GPU(duration=get_duration)
|
| 87 |
def FlowOpt_run(
|