DongfuJiang commited on
Commit
2af380b
1 Parent(s): ad17295
Files changed (1) hide show
  1. model/model_manager.py +3 -11
model/model_manager.py CHANGED
@@ -21,14 +21,10 @@ class ModelManager:
21
  pipe = self.loaded_models[model_name]
22
  return pipe
23
 
24
- @spaces.GPU(duration=60)
25
- def _generate_image_ig(self, pipe, prompt, model_name):
26
- result = pipe(prompt=prompt)
27
- return result
28
-
29
  def generate_image_ig(self, prompt, model_name):
30
  pipe = self.load_model_pipe(model_name)
31
- result = self._generate_image_ig(pipe, prompt, model_name)
32
  return result
33
 
34
  def generate_image_ig_parallel_anony(self, prompt, model_A, model_B):
@@ -56,13 +52,9 @@ class ModelManager:
56
  return results[0], results[1]
57
 
58
  @spaces.GPU(duration=150)
59
- def _generate_image_ie(self, pipe, source_image, textbox_source, textbox_target, textbox_instruct):
60
- result = pipe(src_image = source_image, src_prompt = textbox_source, target_prompt = textbox_target, instruct_prompt = textbox_instruct)
61
- return result
62
-
63
  def generate_image_ie(self, textbox_source, textbox_target, textbox_instruct, source_image, model_name):
64
  pipe = self.load_model_pipe(model_name)
65
- result = self._generate_image_ie(pipe, source_image, textbox_source, textbox_target, textbox_instruct)
66
  return result
67
 
68
  def generate_image_ie_parallel(self, textbox_source, textbox_target, textbox_instruct, source_image, model_A, model_B):
 
21
  pipe = self.loaded_models[model_name]
22
  return pipe
23
 
24
+ @spaces.GPU(duration=120)
 
 
 
 
25
  def generate_image_ig(self, prompt, model_name):
26
  pipe = self.load_model_pipe(model_name)
27
+ result = pipe(prompt=prompt)
28
  return result
29
 
30
  def generate_image_ig_parallel_anony(self, prompt, model_A, model_B):
 
52
  return results[0], results[1]
53
 
54
  @spaces.GPU(duration=150)
 
 
 
 
55
  def generate_image_ie(self, textbox_source, textbox_target, textbox_instruct, source_image, model_name):
56
  pipe = self.load_model_pipe(model_name)
57
+ result = pipe(src_image = source_image, src_prompt = textbox_source, target_prompt = textbox_target, instruct_prompt = textbox_instruct)
58
  return result
59
 
60
  def generate_image_ie_parallel(self, textbox_source, textbox_target, textbox_instruct, source_image, model_A, model_B):