Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ import torch
|
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
|
11 |
|
12 |
-
|
13 |
-
torch_dtype = torch.float16
|
14 |
-
|
15 |
-
|
16 |
|
17 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
18 |
pipe = pipe.to(device)
|
|
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
|
11 |
|
12 |
+
if torch.cuda.is_available():
|
13 |
+
torch_dtype = torch.float16
|
14 |
+
else:
|
15 |
+
torch_dtype = torch.float32
|
16 |
|
17 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
18 |
pipe = pipe.to(device)
|