From b2685b0a1b99657f4851acde278980150d517aad Mon Sep 17 00:00:00 2001 From: hlky <106811348+hlky@users.noreply.github.com> Date: Wed, 24 Aug 2022 15:44:34 +0100 Subject: [PATCH] jpg grid f u --- webui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 18deec1..a8aa995 100644 --- a/webui.py +++ b/webui.py @@ -709,7 +709,8 @@ def img2img(prompt: str, init_img, ddim_steps: int, use_GFPGAN: bool, prompt_mat grid_count = len(os.listdir(outpath)) - 1 grid = image_grid(history, batch_size, force_n_rows=1) - grid.save(os.path.join(outpath, f'grid-{grid_count:04}.{opt.grid_format}')) + grid_file = f"grid-{grid_count:05}-{seed}_{prompt.replace(' ', '_').translate({ord(x): '' for x in invalid_filename_chars})[:128]}.jpg" + grid.save(os.path.join(outpath, grid_file), 'jpeg', quality=80, optimize=True) output_images = history seed = initial_seed