Spaces:
Runtime error
Runtime error
update
Browse files
model.py
CHANGED
@@ -32,10 +32,15 @@ def segment_image(image):
|
|
32 |
|
33 |
# Image inpainting
|
34 |
# get Stable Diffusion model for image inpainting
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
|
41 |
def inpaint(image, mask, W, H, prompt="", seed=0, guidance_scale=17.5, num_samples=3):
|
|
|
32 |
|
33 |
# Image inpainting
|
34 |
# get Stable Diffusion model for image inpainting
|
35 |
+
if device == 'cuda':
|
36 |
+
pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
37 |
+
"runwayml/stable-diffusion-inpainting",
|
38 |
+
torch_dtype=torch.float16,
|
39 |
+
).to(device)
|
40 |
+
else:
|
41 |
+
pipe = StableDiffusionInpaintPipeline.from_pretrained(
|
42 |
+
"runwayml/stable-diffusion-inpainting"
|
43 |
+
).to(device)
|
44 |
|
45 |
|
46 |
def inpaint(image, mask, W, H, prompt="", seed=0, guidance_scale=17.5, num_samples=3):
|