From 2b2adb9462167f99d7aedd94f1712b5ae6dfccb0 Mon Sep 17 00:00:00 2001 From: andrewtvuong Date: Sun, 5 May 2024 11:39:47 -0700 Subject: [PATCH] Retain user specified subfolder, default to current date subfolder otherwise --- folder_paths.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/folder_paths.py b/folder_paths.py index 8267598b0..d13019c7c 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -245,7 +245,10 @@ def get_save_image_path(filename_prefix, output_dir, image_width=0, image_height current_date = time.strftime("%Y-%m-%d") filename_prefix = compute_vars(filename_prefix, image_width, image_height) - subfolder = current_date + if filename_prefix: + subfolder = os.path.dirname(os.path.normpath(filename_prefix)) + else: + subfolder = current_date filename = os.path.basename(os.path.normpath(filename_prefix)) full_output_folder = os.path.join(output_dir, subfolder)