fix sd1.5: pass height/width to pipeline

This commit is contained in:
Qing 2022-10-21 10:26:11 +08:00
parent adddb80bbc
commit e2e2f5f853

View File

@ -134,6 +134,8 @@ class SD(InpaintModel):
self.image_key: PIL.Image.fromarray(image), self.image_key: PIL.Image.fromarray(image),
} }
img_h, img_w = image.shape[:2]
output = self.model( output = self.model(
prompt=config.prompt, prompt=config.prompt,
mask_image=PIL.Image.fromarray(mask[:, :, -1], mode="L"), mask_image=PIL.Image.fromarray(mask[:, :, -1], mode="L"),
@ -142,6 +144,8 @@ class SD(InpaintModel):
guidance_scale=config.sd_guidance_scale, guidance_scale=config.sd_guidance_scale,
output_type="np.array", output_type="np.array",
callback=self.callback, callback=self.callback,
height=img_h,
width=img_w,
**_kwargs **_kwargs
).images[0] ).images[0]