From 14eec801ec4be484d588fd426e4617a802fa570c Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 24 Jul 2023 09:48:46 -0400 Subject: [PATCH] add basename if set --- modules/images.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/images.py b/modules/images.py index c99b227c8..37452e3da 100644 --- a/modules/images.py +++ b/modules/images.py @@ -562,7 +562,10 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='jpg', i if not os.path.exists(fullfn): break else: - fullfn = os.path.join(path, f"{file_decoration}.{extension}") + if basename == '': + fullfn = os.path.join(path, f"{file_decoration}.{extension}") + else: + fullfn = os.path.join(path, f"{basename}-{file_decoration}.{extension}") else: fullfn = os.path.join(path, f"{forced_filename}.{extension}") pnginfo = existing_info or {}