mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-05 07:12:18 -08:00
Merge c21be9601e into fd68e0c384
This commit is contained in:
commit
5fce6af6e8
2 changed files with 13 additions and 1 deletions
|
|
@ -65,8 +65,19 @@ def apply_color_correction(correction, original_image):
|
|||
def uncrop(image, dest_size, paste_loc):
|
||||
x, y, w, h = paste_loc
|
||||
base_image = Image.new('RGBA', dest_size)
|
||||
|
||||
if image.width > shared.opts.img2img_inpaint_correct_paste_xy_side_length_threshold:
|
||||
paste_x = max(x - w // image.width, 0)
|
||||
else:
|
||||
paste_x = x
|
||||
|
||||
if image.height > shared.opts.img2img_inpaint_correct_paste_xy_side_length_threshold:
|
||||
paste_y = max(y - h // image.height, 0)
|
||||
else:
|
||||
paste_y = y
|
||||
|
||||
image = images.resize_image(1, image, w, h)
|
||||
base_image.paste(image, (x, y))
|
||||
base_image.paste(image, (paste_x, paste_y))
|
||||
image = base_image
|
||||
|
||||
return image
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue