1
0
Fork 0

fix thumbnail call

This commit is contained in:
Sean Sube 2024-01-02 21:19:34 -06:00
parent 5de28d0361
commit 5ad7b4c1b4
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 5 additions and 3 deletions

View File

@ -123,9 +123,11 @@ def run_txt2img_pipeline(
# add a thumbnail, if requested
cover = images[0]
if params.thumbnail and (cover.width > 512 or cover.height > 512):
thumbnail = cover.thumbnail((512, 512))
images.insert(thumbnail)
outputs.insert(f"{worker.name}-thumb.{server.image_format}")
thumbnail = cover.copy()
thumbnail.thumbnail((512, 512))
images.insert(0, thumbnail)
outputs.insert(0, f"{worker.name}-thumb.{server.image_format}")
for image, output in zip(images, outputs):
logger.trace("saving output image %s: %s", output, image.size)