From ee725a9c01b39696cd67e53e2972eb0d79114b87 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Sat, 27 Apr 2024 21:01:56 -0400 Subject: [PATCH] Change tmp file config name to have date and time info --- .release | 2 +- README.md | 5 +++++ kohya_gui/dreambooth_gui.py | 5 ++++- kohya_gui/finetune_gui.py | 4 +++- kohya_gui/lora_gui.py | 5 ++++- kohya_gui/textual_inversion_gui.py | 5 ++++- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.release b/.release index e7088bda7..ddcd4c6f5 100644 --- a/.release +++ b/.release @@ -1 +1 @@ -v24.0.8 \ No newline at end of file +v24.0.9 \ No newline at end of file diff --git a/README.md b/README.md index 00f977eb2..bd434b3bc 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ The GUI allows you to set the training parameters and generate and run the requi - [SDXL training](#sdxl-training) - [Masked loss](#masked-loss) - [Change History](#change-history) + - [2024/04/28 (v24.0.9)](#20240428-v2409) - [2024/04/26 (v24.0.8)](#20240426-v2408) - [2024/04/25 (v24.0.7)](#20240425-v2407) - [2024/04/22 (v24.0.6)](#20240422-v2406) @@ -454,6 +455,10 @@ ControlNet dataset is used to specify the mask. The mask images should be the RG ## Change History +### 2024/04/28 (v24.0.9) + +- Update tmp config file to carry date and time info as part of the name. This will allow for easy batching of multiple training commands for users that desire to do so. + ### 2024/04/26 (v24.0.8) - Set `max_train_steps` to 0 if not specified in older `.json` config files. diff --git a/kohya_gui/dreambooth_gui.py b/kohya_gui/dreambooth_gui.py index 591fe310c..8b8d8ded7 100644 --- a/kohya_gui/dreambooth_gui.py +++ b/kohya_gui/dreambooth_gui.py @@ -823,7 +823,10 @@ def train_model( # Sort the dictionary by keys config_toml_data = dict(sorted(config_toml_data.items())) - tmpfilename = "./outputs/tmpfiledbooth.toml" + current_datetime = datetime.now() + formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") + tmpfilename = f"./outputs/config_dreambooth-{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/finetune_gui.py b/kohya_gui/finetune_gui.py index 7f0a317c9..ef384f23e 100644 --- a/kohya_gui/finetune_gui.py +++ b/kohya_gui/finetune_gui.py @@ -894,7 +894,9 @@ def train_model( # Sort the dictionary by keys config_toml_data = dict(sorted(config_toml_data.items())) - tmpfilename = "./outputs/tmpfilefinetune.toml" + current_datetime = datetime.now() + formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") + tmpfilename = f"./outputs/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 1b823396a..02e98cd9d 100644 --- a/kohya_gui/lora_gui.py +++ b/kohya_gui/lora_gui.py @@ -1187,7 +1187,10 @@ def train_model( # Sort the dictionary by keys config_toml_data = dict(sorted(config_toml_data.items())) - tmpfilename = "./outputs/tmpfilelora.toml" + current_datetime = datetime.now() + formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") + tmpfilename = f"./outputs/config_lora-{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/textual_inversion_gui.py b/kohya_gui/textual_inversion_gui.py index bc4f0b3c2..b897a855a 100644 --- a/kohya_gui/textual_inversion_gui.py +++ b/kohya_gui/textual_inversion_gui.py @@ -842,7 +842,10 @@ def train_model( # Sort the dictionary by keys config_toml_data = dict(sorted(config_toml_data.items())) - tmpfilename = "./outputs/tmpfileti.toml" + current_datetime = datetime.now() + formatted_datetime = current_datetime.strftime("%Y%m%d-%H%M%S") + tmpfilename = f"./outputs/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: toml.dump(config_toml_data, toml_file)