theSure commited on
Commit
64287ca
·
verified ·
1 Parent(s): bfa305e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -49,10 +49,12 @@ image_examples = [
49
  ]
50
 
51
  ]
52
-
 
53
  @spaces.GPU(duration=120)
54
  def load_model(base_model_path, lora_path):
55
  global pipe
 
56
  transformer = FluxTransformer2DModel.from_pretrained(base_model_path, subfolder='transformer', torch_dtype=torch.bfloat16)
57
  gr.Info(str(f"Model loading: {int((40 / 100) * 100)}%"))
58
  # enable image inputs
@@ -103,6 +105,7 @@ def predict(
103
  mask_paths
104
 
105
  ):
 
106
  global image_path, mask_path
107
  gr.Info(str(f"Set seed = {seed}"))
108
  if image_paths is not None:
 
49
  ]
50
 
51
  ]
52
+ class PipelineContainer:
53
+ pipe = None
54
  @spaces.GPU(duration=120)
55
  def load_model(base_model_path, lora_path):
56
  global pipe
57
+ PipelineContainer.pipe = pipe
58
  transformer = FluxTransformer2DModel.from_pretrained(base_model_path, subfolder='transformer', torch_dtype=torch.bfloat16)
59
  gr.Info(str(f"Model loading: {int((40 / 100) * 100)}%"))
60
  # enable image inputs
 
105
  mask_paths
106
 
107
  ):
108
+ pipe = PipelineContainer.pipe
109
  global image_path, mask_path
110
  gr.Info(str(f"Set seed = {seed}"))
111
  if image_paths is not None: