r3gm commited on
Commit
b3187b0
·
verified ·
1 Parent(s): 5c4ab14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -122,6 +122,7 @@ flux_pipe = FluxPipeline.from_pretrained(
122
  ).to("cuda")
123
  components = flux_pipe.components
124
  components.pop("transformer", None)
 
125
  delete_model(flux_repo)
126
  # components = None
127
 
@@ -201,10 +202,7 @@ class GuiSD:
201
  yield f"Loading model: {model_name}"
202
 
203
  if vae_model == "BakedVAE":
204
- if not os.path.exists(model_name):
205
- vae_model = model_name
206
- else:
207
- vae_model = None
208
  elif vae_model:
209
  vae_type = "SDXL" if "sdxl" in vae_model.lower() else "SD 1.5"
210
  if model_type != vae_type:
@@ -419,10 +417,10 @@ class GuiSD:
419
  self.model.stream_config(concurrency=concurrency, latent_resize_by=1, vae_decoding=False)
420
 
421
  if task != "txt2img" and not image_control:
422
- raise ValueError("No control image found: To use this function, you have to upload an image in 'Image ControlNet/Inpaint/Img2img'")
423
 
424
- if task == "inpaint" and not image_mask:
425
- raise ValueError("No mask image found: Specify one in 'Image Mask'")
426
 
427
  if "https://" not in str(UPSCALER_DICT_GUI[upscaler_model_path]):
428
  upscaler_model = upscaler_model_path
 
122
  ).to("cuda")
123
  components = flux_pipe.components
124
  components.pop("transformer", None)
125
+ components.pop("scheduler", None)
126
  delete_model(flux_repo)
127
  # components = None
128
 
 
202
  yield f"Loading model: {model_name}"
203
 
204
  if vae_model == "BakedVAE":
205
+ vae_model = model_name
 
 
 
206
  elif vae_model:
207
  vae_type = "SDXL" if "sdxl" in vae_model.lower() else "SD 1.5"
208
  if model_type != vae_type:
 
417
  self.model.stream_config(concurrency=concurrency, latent_resize_by=1, vae_decoding=False)
418
 
419
  if task != "txt2img" and not image_control:
420
+ raise ValueError("Reference image is required. Please upload one in 'Image ControlNet/Inpaint/Img2img'.")
421
 
422
+ if task in ["inpaint", "repaint"] and not image_mask:
423
+ raise ValueError("Mask image not found. Upload one in 'Image Mask' to proceed.")
424
 
425
  if "https://" not in str(UPSCALER_DICT_GUI[upscaler_model_path]):
426
  upscaler_model = upscaler_model_path