Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ from io import BytesIO
|
|
7 |
import torch
|
8 |
|
9 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
|
|
|
|
|
10 |
|
11 |
def encode_pil_to_base64(pil_image):
|
12 |
''' From: https://github.com/gradio-app/gradio/blob/main/gradio/processing_utils.py'''
|
|
|
7 |
import torch
|
8 |
|
9 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
|
10 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
11 |
+
pipe.to(device)
|
12 |
|
13 |
def encode_pil_to_base64(pil_image):
|
14 |
''' From: https://github.com/gradio-app/gradio/blob/main/gradio/processing_utils.py'''
|