Spaces:
Runtime error
Runtime error
Commit
•
fa5ab2f
1
Parent(s):
3a8556a
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ import torch
|
|
7 |
import spaces
|
8 |
|
9 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse")
|
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 = StableDiffusionPipeline.from_pretrained(pretrain_model, scheduler = scheduler,
|
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()
|
|
|
7 |
import spaces
|
8 |
|
9 |
vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse")
|
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 = StableDiffusionPipeline.from_pretrained(pretrain_model, scheduler = scheduler, vae=vae, torch_dtype=torch.float16).to("cuda")
|
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()
|