Skip to content

Commit a2206fe

Browse files
authored
Merge pull request #2079 from bmaltais/dev
v23.0.8
2 parents 16336e8 + 890e521 commit a2206fe

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v23.0.7
1+
v23.0.8

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The GUI allows you to set the training parameters and generate and run the requi
3737
- [No module called tkinter](#no-module-called-tkinter)
3838
- [SDXL training](#sdxl-training)
3939
- [Change History](#change-history)
40+
- [2024/03/11 (v23.0.8)](#20240311-v2308)
4041
- [2024/03/11 (v23.0.7)](#20240311-v2307)
4142
- [2024/03/11 (v23.0.6)](#20240311-v2306)
4243
- [2024/03/11 (v23.0.5)](#20240311-v2305)
@@ -366,6 +367,10 @@ The documentation in this section will be moved to a separate document later.
366367

367368
## Change History
368369

370+
### 2024/03/11 (v23.0.8)
371+
372+
- Add the ability to create outout and logs folder if it does not exist
373+
369374
### 2024/03/11 (v23.0.7)
370375

371376
- Fix minor issues related to functions and file path

kohya_gui/common_gui.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,18 +1321,29 @@ def validate_paths(headless:bool = False, **kwargs):
13211321

13221322
if output_dir != None:
13231323
log.info(f"Validating output folder path {output_dir} existence...")
1324-
if output_dir == "" or not os.path.exists(output_dir):
1325-
log.error("...output folder path is missing or invalid")
1324+
if output_dir == "":
1325+
log.error("...output folder path is missing")
13261326
return False
1327+
elif not os.path.exists(output_dir):
1328+
try:
1329+
os.makedirs(output_dir, exist_ok=True) # Create the directory, no error if it already exists
1330+
log.info(f"...created folder at {output_dir}")
1331+
except Exception as e:
1332+
log.error(f"...failed to create output folder: {e}")
1333+
return False
13271334
else:
13281335
log.info("...valid")
13291336

13301337
if logging_dir != None:
13311338
if logging_dir != "":
13321339
log.info(f"Validating logging folder path {logging_dir} existence...")
13331340
if not os.path.exists(logging_dir):
1334-
log.error("...logging folder path is missing or invalid")
1335-
return False
1341+
try:
1342+
os.makedirs(logging_dir, exist_ok=True) # Create the directory, no error if it already exists
1343+
log.info(f"...created folder at {logging_dir}")
1344+
except Exception as e:
1345+
log.error(f"...failed to create logging folder: {e}")
1346+
return False
13361347
else:
13371348
log.info("...valid")
13381349
else:

0 commit comments

Comments
 (0)