linoyts HF staff commited on
Commit
9ed65fe
Β·
verified Β·
1 Parent(s): 62a0cc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
2
  import spaces
3
  import torch
4
  from clip_slider_pipeline import CLIPSliderXL
5
- from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler
6
 
7
-
8
- flash_pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash").to("cuda", torch.float16)
9
  flash_pipe.scheduler = EulerDiscreteScheduler.from_config(flash_pipe.scheduler.config)
10
  clip_slider = CLIPSliderXL(flash_pipe, device=torch.device("cuda"), iterations=50)
11
 
 
2
  import spaces
3
  import torch
4
  from clip_slider_pipeline import CLIPSliderXL
5
+ from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler, AutoencoderKL
6
 
7
+ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
8
+ flash_pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash", vae=vae).to("cuda", torch.float16)
9
  flash_pipe.scheduler = EulerDiscreteScheduler.from_config(flash_pipe.scheduler.config)
10
  clip_slider = CLIPSliderXL(flash_pipe, device=torch.device("cuda"), iterations=50)
11