Lifeinhockey commited on
Commit
8edb646
·
verified ·
1 Parent(s): d1d85b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -11
app.py CHANGED
@@ -566,9 +566,13 @@ def infer(
566
 
567
  print('use_Tiny_VAE = ', use_Tiny_VAE)
568
 
 
 
 
569
  generator = torch.Generator(device).manual_seed(seed)
570
 
571
- vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch_dtype)
 
572
 
573
  pipe_Tiny_VAE = StableDiffusionPipeline.from_pretrained(model_default, vae=vae, torch_dtype=torch_dtype).to(device)
574
 
@@ -880,16 +884,6 @@ with gr.Blocks(css=css) as demo:
880
 
881
  # Tiny_VAE -----------------------------------------------------------------------------------------------------
882
  # Checkbox для Tiny_VAE
883
-
884
- # with gr.Blocks():
885
- # use_Tiny_VAE = gr.Checkbox(
886
- # label="Use Tiny_VAE",
887
- # value=False,
888
- # interactive=True
889
- # )
890
-
891
-
892
-
893
  with gr.Blocks():
894
  with gr.Row():
895
  use_Tiny_VAE = gr.Checkbox(
 
566
 
567
  print('use_Tiny_VAE = ', use_Tiny_VAE)
568
 
569
+ f Tiny_VAE == "sd-vae-ft-mse":
570
+ VAE_id = "stabilityai/sd-vae-ft-mse"
571
+
572
  generator = torch.Generator(device).manual_seed(seed)
573
 
574
+ #vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch_dtype)
575
+ vae = AutoencoderKL.from_pretrained(VAE_id, torch_dtype=torch_dtype)
576
 
577
  pipe_Tiny_VAE = StableDiffusionPipeline.from_pretrained(model_default, vae=vae, torch_dtype=torch_dtype).to(device)
578
 
 
884
 
885
  # Tiny_VAE -----------------------------------------------------------------------------------------------------
886
  # Checkbox для Tiny_VAE
 
 
 
 
 
 
 
 
 
 
887
  with gr.Blocks():
888
  with gr.Row():
889
  use_Tiny_VAE = gr.Checkbox(