mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user