Spaces:
Runtime error
Runtime error
Commit
·
dbf5e52
1
Parent(s):
608c6da
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def generate(movie, celebrity, scale):
|
|
15 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
16 |
|
17 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=HF_TOKEN)
|
18 |
-
device = torch.device('
|
19 |
generator = torch.Generator(device=device)
|
20 |
pipe = pipe.to(device)
|
21 |
|
|
|
15 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
16 |
|
17 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=HF_TOKEN)
|
18 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
19 |
generator = torch.Generator(device=device)
|
20 |
pipe = pipe.to(device)
|
21 |
|