aboutsummaryrefslogtreecommitdiff
path: root/modules/ui.py
diff options
context:
space:
mode:
authorbrkirch <brkirch@users.noreply.github.com>2022-10-12 00:54:24 -0400
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-12 09:55:56 +0300
commit57e03cdd244eee4e33ccab7554b3594563a3d0cd (patch)
treed261a1db75c7e86c610d5f83a391baf13a6370a4 /modules/ui.py
parent8aead63f1ac9fec0e5198bd626ec2c5bcbeff4d8 (diff)
Ensure the directory exists before saving to it
The directory for the images saved with the Save button may still not exist, so it needs to be created prior to opening the log.csv file.
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 00bf09ae..cd67b84b 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -131,6 +131,8 @@ def save_files(js_data, images, do_make_zip, index):
images = [images[index]]
start_index = index
+ os.makedirs(opts.outdir_save, exist_ok=True)
+
with open(os.path.join(opts.outdir_save, "log.csv"), "a", encoding="utf8", newline='') as file:
at_start = file.tell() == 0
writer = csv.writer(file)