From 29d0d65504bca16e118a36ea355e7951ec12c11f Mon Sep 17 00:00:00 2001 From: hlky <106811348+hlky@users.noreply.github.com> Date: Wed, 24 Aug 2022 12:44:48 +0100 Subject: [PATCH] jpg grid, named grid Grid file named with seed and prompt, output as jpg --- webui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 9c589bba7..6ba764073 100644 --- a/webui.py +++ b/webui.py @@ -401,7 +401,8 @@ def process_images(outpath, func_init, func_sample, prompt, seed, sampler_name, output_images.insert(0, grid) - grid.save(os.path.join(outpath, f'grid-{grid_count:04}.png')) + grid_file = f"grid-{grid_count:05}-{seed}_{prompts[i].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) grid_count += 1 info = f"""