* feat: Remember last used folder for file dialogs
This commit introduces a feature to remember the last used folder for various file and folder dialogs within the GUI.
Key changes:
- Modified `KohyaSSGUIConfig` (`kohya_gui/class_gui_config.py`) to store and retrieve a `last_used_folder` value in the `config.toml` file.
- Updated file/folder dialog utility functions in `kohya_gui/common_gui.py` (e.g., `get_folder_path`, `get_file_path`, `get_saveasfilename_path`) to:
- Accept the `KohyaSSGUIConfig` instance.
- Use the stored `last_used_folder` as the initial directory for dialogs.
- Update `last_used_folder` after a successful selection.
- Updated various GUI modules (`class_folders.py`, `wd14_caption_gui.py`, and other captioning utilities) to pass the `KohyaSSGUIConfig` instance to these dialog functions.
This enhancement improves your experience by defaulting file dialogs to the most recently accessed relevant directory, streamlining the workflow for you when you frequently work with specific folders.
* Fix typo
* Fix typos
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Modified the get_file_path function in kohya_gui/common_gui.py
to ensure that when you are opening a configuration file, the
file dialog defaults to the kohya_ss repository root if no
initial path or only a filename is provided.
If a full or relative path is already present in the input field,
the dialog will open in the specified directory as before.
This change improves your experience by starting the file search
in a more relevant location.
* Update common_gui.py
Little fix to the `validate_model_path` function to properly handle a folder path. Currently, it errors out when a folder path is selected for a training with diffusers. 😊
* Update lora_gui.py
Switching the validation type for the resume training state path from 'file' to 'folder'.
😊
* Update common_gui.py
format
* Update common_gui.py
My last fix was wrong and was returning errors when using a default model or when the VAE was not defined. This new fix works with all possibilities.
However, when a diffusers folder is used, `validate_file_path` will show a failed check, but the operation will still succeed because `validate_folder_path` will return successfully.
* Convert script back to no shell.
* Update rest of tools and update dreambooth to no shell
* Update rest of trainers to not use shell
* Allow the use of custom caption extension
* Improve security to limit finding and replacing contents of any files on the system, that the attacker knows the contents of by specifying the list of acceptable extensions for captions.
* Update caption extension fields to Dropdown with restricted choices for security reasons