Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,17 +62,19 @@ def predict(dict, prompt="", negative_prompt="", guidance_scale=7.5, steps=30, s
|
|
| 62 |
|
| 63 |
mask_image.putdata(new_data)
|
| 64 |
mask_image = mask_image.resize(init_image.size, resample=Image.LANCZOS)
|
|
|
|
| 65 |
#mask_image = pipe.mask_processor.blur(mask_image, blur_factor=15)
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
| 76 |
inpainted_image = output.images[0]
|
| 77 |
inpainted_image = inpainted_image.resize(init_image.size, resample=Image.LANCZOS)
|
| 78 |
# Combine the original and inpainted images using the mask
|
|
|
|
| 62 |
|
| 63 |
mask_image.putdata(new_data)
|
| 64 |
mask_image = mask_image.resize(init_image.size, resample=Image.LANCZOS)
|
| 65 |
+
mask_image = mask_image.filter(ImageFilter.GaussianBlur(5))
|
| 66 |
#mask_image = pipe.mask_processor.blur(mask_image, blur_factor=15)
|
| 67 |
+
with torch.cuda.amp.autocast():
|
| 68 |
+
output = pipe(
|
| 69 |
+
prompt=prompt,
|
| 70 |
+
negative_prompt=negative_prompt,
|
| 71 |
+
image=init_image,
|
| 72 |
+
mask_image=mask_image,
|
| 73 |
+
guidance_scale=guidance_scale,
|
| 74 |
+
num_inference_steps=int(steps),
|
| 75 |
+
strength=strength,
|
| 76 |
+
clip_skip=1
|
| 77 |
+
)
|
| 78 |
inpainted_image = output.images[0]
|
| 79 |
inpainted_image = inpainted_image.resize(init_image.size, resample=Image.LANCZOS)
|
| 80 |
# Combine the original and inpainted images using the mask
|