mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-05 03:32:37 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user