tonyassi commited on
Commit
36f5062
1 Parent(s): fcae3d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
- from diffusers import AutoPipelineForText2Image
3
  from diffusers.utils import load_image
4
  import torch
5
 
6
-
7
- text_pipeline = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16).to("cuda")
8
  text_pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin")
9
  text_pipeline.set_ip_adapter_scale(0.6)
10
 
 
1
  import gradio as gr
2
+ from diffusers import AutoPipelineForText2Image, AutoencoderKL
3
  from diffusers.utils import load_image
4
  import torch
5
 
6
+ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
7
+ text_pipeline = AutoPipelineForText2Image.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", vae=vae, torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to("cuda")
8
  text_pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="sdxl_models", weight_name="ip-adapter_sdxl.bin")
9
  text_pipeline.set_ip_adapter_scale(0.6)
10