Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,11 @@ import numpy as np
|
|
| 5 |
from diffusers import StableDiffusionDepth2ImgPipeline
|
| 6 |
from pathlib import Path
|
| 7 |
|
|
|
|
| 8 |
dept2img = StableDiffusionDepth2ImgPipeline.from_pretrained(
|
| 9 |
"stabilityai/stable-diffusion-2-depth",
|
| 10 |
torch_dtype=torch.float16,
|
| 11 |
-
).to(
|
| 12 |
|
| 13 |
|
| 14 |
def pad_image(input_image):
|
|
|
|
| 5 |
from diffusers import StableDiffusionDepth2ImgPipeline
|
| 6 |
from pathlib import Path
|
| 7 |
|
| 8 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 9 |
dept2img = StableDiffusionDepth2ImgPipeline.from_pretrained(
|
| 10 |
"stabilityai/stable-diffusion-2-depth",
|
| 11 |
torch_dtype=torch.float16,
|
| 12 |
+
).to(device)
|
| 13 |
|
| 14 |
|
| 15 |
def pad_image(input_image):
|