From c6f87f1c0193200694793250787203e8f3131c12 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Thu, 26 Jan 2023 21:05:36 -0500 Subject: [PATCH] Create save dir if not exist --- textual_inversion_gui.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/textual_inversion_gui.py b/textual_inversion_gui.py index 86d026c..3380d60 100644 --- a/textual_inversion_gui.py +++ b/textual_inversion_gui.py @@ -104,6 +104,10 @@ def save_configuration( if file_path == None or file_path == '': return original_file_path # In case a file_path was provided and the user decide to cancel the open action + directory = os.path.dirname(file_path) + if not os.path.exists(directory): + os.makedirs(directory) + # Return the values of the variables as a dictionary variables = { name: value