From 28365d6b691e2304c383f6106cdaf0d5b0b17ffc Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 8 Nov 2023 12:09:09 -0500 Subject: [PATCH] fix forced filename --- modules/images.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/images.py b/modules/images.py index 2c4ecefe4..072604409 100644 --- a/modules/images.py +++ b/modules/images.py @@ -559,16 +559,17 @@ def save_image(image, path, basename = '', seed=None, prompt=None, extension=sha if shared.opts.save_to_dirs: dirname = namegen.apply(shared.opts.directories_filename_pattern or "[prompt_words]") path = os.path.join(path, dirname) + file_decoration = '' if forced_filename is None: - if short_filename or seed is None: - file_decoration = "" if shared.opts.samples_filename_pattern and len(shared.opts.samples_filename_pattern) > 0: file_decoration = shared.opts.samples_filename_pattern else: file_decoration = "[seq]-[prompt_words]" file_decoration = namegen.apply(file_decoration) file_decoration += suffix - filename = os.path.join(path, f"{file_decoration}.{extension}") if basename == '' else os.path.join(path, f"{basename}-{file_decoration}.{extension}") + filename = os.path.join(path, f"{file_decoration}.{extension}") if basename == '' else os.path.join(path, f"{basename}-{file_decoration}.{extension}") + else: + filename = forced_filename pnginfo = existing_info or {} if info is not None: pnginfo[pnginfo_section_name] = info