Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,16 +6,19 @@ from PIL import Image
|
|
6 |
from diffusers import DiffusionPipeline
|
7 |
from huggingface_hub import login
|
8 |
import os
|
|
|
9 |
|
10 |
login(token=os.environ.get('HF_KEY'))
|
11 |
|
12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
|
14 |
-
|
|
|
|
|
15 |
pipe = pipe.to(device)
|
16 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
17 |
|
18 |
-
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-0.9")
|
19 |
refiner = refiner.to(device)
|
20 |
refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
21 |
|
|
|
6 |
from diffusers import DiffusionPipeline
|
7 |
from huggingface_hub import login
|
8 |
import os
|
9 |
+
from diffusers.models import AutoencoderKL
|
10 |
|
11 |
login(token=os.environ.get('HF_KEY'))
|
12 |
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
|
15 |
+
vae = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae")
|
16 |
+
|
17 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-0.9", use_safetensors=True, vae=vae)
|
18 |
pipe = pipe.to(device)
|
19 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
20 |
|
21 |
+
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-0.9", use_safetensors=True, vae=vae)
|
22 |
refiner = refiner.to(device)
|
23 |
refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
24 |
|