Spaces:
Sleeping
Sleeping
saranbalan
commited on
Commit
•
df7ac0a
1
Parent(s):
5c7b9f9
Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,9 @@ model_id2 = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
23 |
|
24 |
# Initialize Stable Diffusion pipeline based on device
|
25 |
if torch.cuda.is_available():
|
26 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
27 |
else:
|
28 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
29 |
|
30 |
# Move model to the selected device (either GPU or CPU)
|
31 |
pipe = pipe.to(device)
|
|
|
23 |
|
24 |
# Initialize Stable Diffusion pipeline based on device
|
25 |
if torch.cuda.is_available():
|
26 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id1, torch_dtype=torch.float16)
|
27 |
else:
|
28 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id1) # Omit torch_dtype for CPU
|
29 |
|
30 |
# Move model to the selected device (either GPU or CPU)
|
31 |
pipe = pipe.to(device)
|