Spaces:
Runtime error
Runtime error
Commit
·
ea10931
1
Parent(s):
045ff49
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ from torch import autocast
|
|
4 |
from diffusers import StableDiffusionPipeline
|
5 |
|
6 |
model_id = "CompVis/stable-diffusion-v1-4"
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
pipe = pipe.to(device)
|
11 |
|
12 |
def inference(diffusion_prompt):
|
|
|
4 |
from diffusers import StableDiffusionPipeline
|
5 |
|
6 |
model_id = "CompVis/stable-diffusion-v1-4"
|
7 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token='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', torch_dtype=torch.float32, low_cpu_mem_usage=True)
|
8 |
+
has_cuda = torch.cuda.is_available()
|
9 |
+
device = torch.device('cpu' if not has_cuda else 'cuda')
|
10 |
pipe = pipe.to(device)
|
11 |
|
12 |
def inference(diffusion_prompt):
|