Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,6 +111,12 @@ def outpaintGen(
|
|
| 111 |
# Paste white rectangle at the appropriate position
|
| 112 |
mask_image.paste(white_area, (overlap_left, overlap_top))
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
# Convert to grayscale
|
| 115 |
mask_image = mask_image.convert('L')
|
| 116 |
mask_image = Image.eval(mask_image, lambda x: 255 - x)
|
|
@@ -128,7 +134,7 @@ def outpaintGen(
|
|
| 128 |
|
| 129 |
result = pipe(
|
| 130 |
prompt=outpaint_prompt,
|
| 131 |
-
image=
|
| 132 |
mask_image=mask_image,
|
| 133 |
width=fix_width,
|
| 134 |
height=fix_height,
|
|
|
|
| 111 |
# Paste white rectangle at the appropriate position
|
| 112 |
mask_image.paste(white_area, (overlap_left, overlap_top))
|
| 113 |
|
| 114 |
+
# Create a new image with the same size as the original image
|
| 115 |
+
new_image = Image.new('RGB', (new_width, new_height), color='black')
|
| 116 |
+
|
| 117 |
+
# Paste the original image onto the new image
|
| 118 |
+
new_image.paste(image, (overlap_left, overlap_top))
|
| 119 |
+
|
| 120 |
# Convert to grayscale
|
| 121 |
mask_image = mask_image.convert('L')
|
| 122 |
mask_image = Image.eval(mask_image, lambda x: 255 - x)
|
|
|
|
| 134 |
|
| 135 |
result = pipe(
|
| 136 |
prompt=outpaint_prompt,
|
| 137 |
+
image=new_image,
|
| 138 |
mask_image=mask_image,
|
| 139 |
width=fix_width,
|
| 140 |
height=fix_height,
|