Skip to content

Commit

Permalink
Relocate toml training config file to same folder as the model output…
Browse files Browse the repository at this point in the history
… directory (#2448)
  • Loading branch information
bmaltais committed May 5, 2024
1 parent a6e7e10 commit d26dad2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion kohya_gui/dreambooth_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/finetune_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/textual_inversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d26dad2

Please sign in to comment.