orronai commited on
Commit
343dd8b
·
1 Parent(s): 8ab3e1a

fix: duration

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -74,13 +74,14 @@ def get_examples():
74
  ]
75
  return case
76
 
77
- def get_duration(*args, **kwargs) -> float:
78
- model_type_val = kwargs.get("model_type_val", 'FLUX')
79
- n_max_val = kwargs.get("n_max_val", 15)
80
- flowopt_iterations_val = kwargs.get("flowopt_iterations_val", 8)
81
-
82
- step_duration = 1 if model_type_val == 'FLUX' else 0.4
83
- return (n_max_val * (flowopt_iterations_val + 2) * step_duration) + 40
 
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(