From e2e2f5f853bb9bc28b4da2487f57b0105afa71dc Mon Sep 17 00:00:00 2001 From: Qing Date: Fri, 21 Oct 2022 10:26:11 +0800 Subject: [PATCH] fix sd1.5: pass height/width to pipeline --- lama_cleaner/model/sd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lama_cleaner/model/sd.py b/lama_cleaner/model/sd.py index ce24f71..afd4eb8 100644 --- a/lama_cleaner/model/sd.py +++ b/lama_cleaner/model/sd.py @@ -134,6 +134,8 @@ class SD(InpaintModel): self.image_key: PIL.Image.fromarray(image), } + img_h, img_w = image.shape[:2] + output = self.model( prompt=config.prompt, mask_image=PIL.Image.fromarray(mask[:, :, -1], mode="L"), @@ -142,6 +144,8 @@ class SD(InpaintModel): guidance_scale=config.sd_guidance_scale, output_type="np.array", callback=self.callback, + height=img_h, + width=img_w, **_kwargs ).images[0]