Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,10 @@ import gradio as gr
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
|
9 |
-
vae = AutoencoderKL.from_pretrained("
|
10 |
-
#safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
|
11 |
-
#feature_extractor=CLIPFeatureExtractor.from_pretrained("openai/clip-vit-base-patch32")
|
12 |
-
pretrain_model = "SG161222/Realistic_Vision_V5.1_noVAE"
|
13 |
scheduler = DDIMScheduler.from_pretrained(pretrain_model, subfolder="scheduler")
|
14 |
-
pipe =
|
15 |
|
16 |
-
# # Optional. enable_xformers_memory_efficient_attention can save memory usage and increase inference speed. enable_model_cpu_offload and enable_vae_tiling can save memory usage.
|
17 |
#pipe.enable_model_cpu_offload()
|
18 |
#pipe.enable_vae_tiling()
|
19 |
|
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
|
9 |
+
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
|
|
|
|
|
|
10 |
scheduler = DDIMScheduler.from_pretrained(pretrain_model, subfolder="scheduler")
|
11 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", vae=vae, scheduler=scheduler, torch_dtype=torch.float16, use_safetensors=True, variant="fp16").to("cuda")
|
12 |
|
|
|
13 |
#pipe.enable_model_cpu_offload()
|
14 |
#pipe.enable_vae_tiling()
|
15 |
|