aboutsummaryrefslogtreecommitdiff
path: root/modules/processing.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-08 10:03:21 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-08 10:03:21 +0300
commit0fedd50886fb2f745cc6faab001090b77fbd0382 (patch)
treea6bfe10d02e5406dcc66959afad69a9e612541ac /modules/processing.py
parentee29bb77bfe3d2095bc08861bcdebeea20b890f1 (diff)
another change for inpainting at full resolution
Diffstat (limited to 'modules/processing.py')
-rw-r--r--modules/processing.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 73b060f4..d4c4cfad 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -362,9 +362,6 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
image = images.resize_image(self.resize_mode, image, self.width, self.height)
if self.image_mask is not None:
- if self.inpainting_fill != 1:
- image = fill(image, latent_mask)
-
image_masked = Image.new('RGBa', (image.width, image.height))
image_masked.paste(image.convert("RGBA").convert("RGBa"), mask=ImageOps.invert(self.mask_for_overlay.convert('L')))
@@ -374,6 +371,10 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
image = image.crop(crop_region)
image = images.resize_image(2, image, self.width, self.height)
+ if self.image_mask is not None:
+ if self.inpainting_fill != 1:
+ image = fill(image, latent_mask)
+
image = np.array(image).astype(np.float32) / 255.0
image = np.moveaxis(image, 2, 0)