fix image sizing

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-01-05 15:10:53 +01:00
parent cfc620a08a
commit e7e2063f67
2 changed files with 19 additions and 13 deletions
+2 -1
View File
@@ -313,7 +313,8 @@ def resize_init_images(p):
if getattr(p, 'init_images', None) is not None and len(p.init_images) > 0:
p.init_images = decode_images(p.init_images)
vae_scale_factor = sd_vae.get_vae_scale_factor()
tgt_width, tgt_height = vae_scale_factor * math.ceil(p.init_images[0].width / vae_scale_factor), vae_scale_factor * math.ceil(p.init_images[0].height / vae_scale_factor)
tgt_width = vae_scale_factor * math.ceil(p.init_images[0].width / vae_scale_factor)
tgt_height = vae_scale_factor * math.ceil(p.init_images[0].height / vae_scale_factor)
if p.init_images[0].size != (tgt_width, tgt_height):
shared.log.debug(f'Resizing init images: original={p.init_images[0].width}x{p.init_images[0].height} target={tgt_width}x{tgt_height}')
p.init_images = [images.resize_image(1, image, tgt_width, tgt_height, upscaler_name=None) for image in p.init_images]