Skip to content

Commit

Permalink
Merge pull request #2406 from bmaltais/2405-feature-request-print-com…
Browse files Browse the repository at this point in the history
…mand-save-toml-file-as-named-file-instead-of-temp-file

Change tmp file config name to have date and time info
  • Loading branch information
bmaltais committed Apr 28, 2024
2 parents 074de82 + ee725a9 commit 31d284d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24.0.8
v24.0.9
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion kohya_gui/dreambooth_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion kohya_gui/finetune_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion kohya_gui/lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion kohya_gui/textual_inversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 31d284d

Please sign in to comment.