Skip to content

Commit

Permalink
Ensure the directory exists before saving to it
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brkirch authored and AUTOMATIC1111 committed Oct 12, 2022
1 parent 8aead63 commit 57e03cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def __init__(self, d=None):
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)
Expand Down

0 comments on commit 57e03cd

Please sign in to comment.