Skip to content

Commit

Permalink
fix: images do not match
Browse files Browse the repository at this point in the history
Signed-off-by: storyicon <storyicon@foxmail.com>
  • Loading branch information
storyicon committed Apr 16, 2024
1 parent 4068429 commit 0980fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,9 @@ def init(self, all_prompts, all_seeds, all_subseeds):
if self.mask_blur_x > 0 or self.mask_blur_y > 0:
self.extra_generation_params["Mask blur"] = self.mask_blur

if image_mask.size != (self.width, self.height):
image_mask = images.resize_image(self.resize_mode, image_mask, self.width, self.height)

if self.inpaint_full_res:
self.mask_for_overlay = image_mask
mask = image_mask.convert('L')
Expand All @@ -1551,7 +1554,6 @@ def init(self, all_prompts, all_seeds, all_subseeds):
self.extra_generation_params["Inpaint area"] = "Only masked"
self.extra_generation_params["Masked area padding"] = self.inpaint_full_res_padding
else:
image_mask = images.resize_image(self.resize_mode, image_mask, self.width, self.height)
np_mask = np.array(image_mask)
np_mask = np.clip((np_mask.astype(np.float32)) * 2, 0, 255).astype(np.uint8)
self.mask_for_overlay = Image.fromarray(np_mask)
Expand Down

0 comments on commit 0980fdf

Please sign in to comment.