Commit
·
30e1658
1
Parent(s):
eeb734b
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,8 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
| 18 |
pipe.unet = register_cross_attention_hook(pipe.unet)
|
| 19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 20 |
pipe = pipe.to(device)
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
def inference(prompt):
|
|
|
|
| 18 |
pipe.unet = register_cross_attention_hook(pipe.unet)
|
| 19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 20 |
pipe = pipe.to(device)
|
| 21 |
+
if device == 'cpu':
|
| 22 |
+
pipe = pipe.to(dtype=torch.float32)
|
| 23 |
|
| 24 |
|
| 25 |
def inference(prompt):
|