From f1ffb5b51b2d2adb48799d367e285d573b108792 Mon Sep 17 00:00:00 2001 From: Sean McLellan Date: Fri, 26 Aug 2022 00:45:19 -0400 Subject: [PATCH] Fix blend if the target image has been upscaled --- ldm/simplet2i.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldm/simplet2i.py b/ldm/simplet2i.py index 66fdbb48b4..1b7e34a7dc 100644 --- a/ldm/simplet2i.py +++ b/ldm/simplet2i.py @@ -529,6 +529,9 @@ The vast majority of these arguments default to reasonable values. res = Image.fromarray(restored_img) if strength < 1.0: + # Resize the image to the new image if the sizes have changed + if restored_img.size != image.size: + res = res.resize(image.size) res = Image.blend(image, res, strength) return res