Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,12 +16,12 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
16 |
#model_repo_id = "stabilityai/stable-diffusion-xl-base-0.9"
|
17 |
|
18 |
|
19 |
-
|
20 |
if torch.cuda.is_available():
|
21 |
torch_dtype = torch.float16
|
22 |
else:
|
23 |
torch_dtype = torch.float32
|
24 |
-
|
25 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
26 |
pipe = pipe.to(device)
|
27 |
"""
|
@@ -34,9 +34,9 @@ MAX_IMAGE_SIZE = 1024
|
|
34 |
from diffusers import AutoencoderTiny, StableDiffusionPipeline
|
35 |
|
36 |
pipe = StableDiffusionPipeline.from_pretrained(
|
37 |
-
"nota-ai/bk-sdm-small", torch_dtype=
|
38 |
pipe.vae = AutoencoderTiny.from_pretrained(
|
39 |
-
"sayakpaul/taesd-diffusers", torch_dtype=
|
40 |
pipe = pipe.to(device)
|
41 |
|
42 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
|
|
16 |
#model_repo_id = "stabilityai/stable-diffusion-xl-base-0.9"
|
17 |
|
18 |
|
19 |
+
|
20 |
if torch.cuda.is_available():
|
21 |
torch_dtype = torch.float16
|
22 |
else:
|
23 |
torch_dtype = torch.float32
|
24 |
+
"""
|
25 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
26 |
pipe = pipe.to(device)
|
27 |
"""
|
|
|
34 |
from diffusers import AutoencoderTiny, StableDiffusionPipeline
|
35 |
|
36 |
pipe = StableDiffusionPipeline.from_pretrained(
|
37 |
+
"nota-ai/bk-sdm-small", torch_dtype=torch_dtype, use_safetensors=True)
|
38 |
pipe.vae = AutoencoderTiny.from_pretrained(
|
39 |
+
"sayakpaul/taesd-diffusers", torch_dtype=torch_dtype, use_safetensors=True)
|
40 |
pipe = pipe.to(device)
|
41 |
|
42 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|