diff --git a/README.md b/README.md index c3167e9ed..f8216c188 100644 --- a/README.md +++ b/README.md @@ -447,3 +447,4 @@ ControlNet dataset is used to specify the mask. The mask images should be the RG - Add support for custom LyCORIS toml config files. Simply type the path to the config file in the LyCORIS preset dropdown. - Improve files and folders validation - Added a new setup-3.10.bat file to set the venv to specifically use python 3.10.x instead of the default python the system might use. +- Relocate toml training config file to same folder as the model output directory. diff --git a/kohya_gui/dreambooth_gui.py b/kohya_gui/dreambooth_gui.py index 2dcaece8f..113a7228e 100644 --- a/kohya_gui/dreambooth_gui.py +++ b/kohya_gui/dreambooth_gui.py @@ -859,7 +859,7 @@ def train_model( current_datetime = datetime.now() formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") - tmpfilename = f"./outputs/config_dreambooth-{formatted_datetime}.toml" + tmpfilename = fr"{output_dir}/config_dreambooth-{formatted_datetime}.toml" # Save the updated TOML data back to the file with open(tmpfilename, "w", encoding="utf-8") as toml_file: diff --git a/kohya_gui/finetune_gui.py b/kohya_gui/finetune_gui.py index 68c7ef055..204b74f9f 100644 --- a/kohya_gui/finetune_gui.py +++ b/kohya_gui/finetune_gui.py @@ -927,7 +927,7 @@ def train_model( current_datetime = datetime.now() formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") - tmpfilename = f"./outputs/config_finetune-{formatted_datetime}.toml" + tmpfilename = fr"{output_dir}/config_finetune-{formatted_datetime}.toml" # Save the updated TOML data back to the file with open(tmpfilename, "w", encoding="utf-8") as toml_file: toml.dump(config_toml_data, toml_file) diff --git a/kohya_gui/lora_gui.py b/kohya_gui/lora_gui.py index a7b2816c2..58411ddb2 100644 --- a/kohya_gui/lora_gui.py +++ b/kohya_gui/lora_gui.py @@ -1244,7 +1244,7 @@ def train_model( current_datetime = datetime.now() formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") - tmpfilename = f"./outputs/config_lora-{formatted_datetime}.toml" + tmpfilename = fr"{output_dir}/config_lora-{formatted_datetime}.toml" # Save the updated TOML data back to the file with open(tmpfilename, "w", encoding="utf-8") as toml_file: diff --git a/kohya_gui/textual_inversion_gui.py b/kohya_gui/textual_inversion_gui.py index 720ce35ba..b6fc72a7c 100644 --- a/kohya_gui/textual_inversion_gui.py +++ b/kohya_gui/textual_inversion_gui.py @@ -879,7 +879,7 @@ def train_model( current_datetime = datetime.now() formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") - tmpfilename = f"./outputs/config_textual_inversion-{formatted_datetime}.toml" + tmpfilename = fr"{output_dir}/config_textual_inversion-{formatted_datetime}.toml" # Save the updated TOML data back to the file with open(tmpfilename, "w", encoding="utf-8") as toml_file: