Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,7 @@ torch.manual_seed(1)
|
|
23 |
logging.set_verbosity_error()
|
24 |
|
25 |
# Set device
|
26 |
-
torch_device = "cuda
|
27 |
-
|
28 |
-
|
29 |
|
30 |
# Load the autoencoder model which will be used to decode the latents into image space.
|
31 |
vae = AutoencoderKL.from_pretrained("CompVis/stable-diffusion-v1-4", subfolder="vae")
|
|
|
23 |
logging.set_verbosity_error()
|
24 |
|
25 |
# Set device
|
26 |
+
torch_device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
|
|
|
|
|
27 |
|
28 |
# Load the autoencoder model which will be used to decode the latents into image space.
|
29 |
vae = AutoencoderKL.from_pretrained("CompVis/stable-diffusion-v1-4", subfolder="vae")
|