Commit Graph

80 Commits (51d87f5309e84523560307ba3d501e7eedea50b2)

Author SHA1 Message Date
bmaltais 51d87f5309
feat: Remember last used folder for file dialogs (#3290)
* 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>
2025-06-16 07:39:29 -04:00
google-labs-jules[bot] 4ef34d9f5f Fix: Default config file dialog to repo root
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.
2025-06-01 17:54:27 +00:00
bmaltais 2ce5658302 Add Flux.1 Model checkbox and detection 2024-08-10 14:55:39 -04:00
bmaltais 6c8bd3c4c3 Merge branch 'dev' into sd3 2024-08-08 20:49:39 -04:00
bmaltais 630cec8587
Merge pull request #2690 from b-fission/autodetect-modeltype
Auto-detect model type for safetensors files
2024-08-08 20:26:22 -04:00
b-fission 5ccf90e7fa Auto-detect model type for safetensors files
Automatically tick the checkboxes for v2 and SDXL on the common training UI
and LoRA extract/merge utilities.
2024-08-05 19:27:24 -05:00
bmaltais 9a818cf603 Merge branch 'dev' into 173-error-on-train-typeerror-int-argument-must-be-a-string-a-bytes-like-object-or-a-real-number-not-nonetype 2024-08-02 10:54:24 -04:00
bmaltais 3121d5ec35 Fix issue with missing key. Upgrade Gradio release for security issue. 2024-08-02 10:41:13 -04:00
bmaltais 65ac2f163a Adding SD3 GUI elements 2024-07-07 15:14:53 -04:00
bmaltais 441721ab87 Use output model name as wandb run name if not provided 2024-06-24 10:26:54 -04:00
bmaltais ff61f3a4be Improve "print command" output format 2024-06-23 13:52:21 -04:00
bmaltais 018ce04852 Fix adaptive_noise_scale value not properly loading from json config 2024-06-22 08:51:12 -04:00
Lucas Freire Sangoi bfc2856c68
Minor fixes (#2480)
* 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.
2024-05-10 20:08:52 -04:00
bmaltais 27b58a79f2 Fix creation of output folders 2024-05-09 13:30:27 -04:00
bmaltais 92a01a3890 Fix issue with tensorboard 2024-05-09 13:20:20 -04:00
bmaltais 7fac1e89dd Move env var config to common_gui 2024-05-07 07:58:11 -04:00
bmaltais 5984c87d22 Update model validation code 2024-05-07 07:17:27 -04:00
bmaltais 36071cc244
Improve files and folders validation (#2429) 2024-05-01 08:29:31 -04:00
bmaltais 91350e5581 Update utility code 2024-04-30 20:09:19 -04:00
bmaltais 7bbc99d91b
2382 some incorrect usage related to the recent shell=false issue (#2417)
* 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
2024-04-29 07:44:55 -04:00
bmaltais a97d3a94ee Fix issue with pre and post fix caption in subfolders 2024-04-29 07:13:34 -04:00
bmaltais d8a51f34fd Set `max_train_steps` to 0 if not specified in older `.json` config files 2024-04-26 07:11:07 -04:00
bmaltais 1f5f3cf027 Prevent tkinter import crash 2024-04-25 11:20:27 -04:00
bmaltais 8234e52ded
Add validation of lr scheduler and optimizer arguments (#2358) 2024-04-20 15:53:11 -04:00
bmaltais 58e57a3365
Fix issue with lora_network_weights not being loaded (#2357) 2024-04-20 15:05:35 -04:00
bmaltais 5a801649c2 Convert config with use_wandb to log_with = wandb 2024-04-19 13:16:23 -04:00
bmaltais 542af98980 Fix wrong default for max_train_steps and max_train_epoch 2024-04-19 13:04:02 -04:00
bmaltais 4c5f4dfd27 update file read and write to utf-8 2024-04-19 10:50:43 -04:00
bmaltais 84fb7ce8c9 Update utility paths and print toml file when clicking the Print training command button 2024-04-17 19:54:56 -04:00
Bernard Maltais be5d30130f Fix clip_skip issue 2024-04-17 13:25:55 -04:00
bmaltais e6a8dec98d
Implement use_shell as parameter (#2297) 2024-04-15 20:26:09 -04:00
bmaltais a8320e3f2c Add support for accelerate dynamo parameters 2024-04-15 10:31:05 -04:00
bmaltais c4e0655a7a Fix accelerate path for linux systems 2024-04-15 08:50:48 -04:00
bmaltais eec6f9baf4 Convert str numbers to proper int or float 2024-04-15 08:02:39 -04:00
bmaltais a08c7c6ef1 Update parameters handling 2024-04-14 19:10:26 -04:00
bmaltais e98fc40a63
- Implement HuggingFace inputs in all training tabs (#2287)
- Switch to sd-scripts configuration files to pass most of the parameters in a secure way.
2024-04-14 18:43:45 -04:00
bmaltais fa5c65eade Update readme 2024-04-13 21:22:52 -04:00
bmaltais fddac3362e Make Stop training diseapear when training is done 2024-04-13 21:10:31 -04:00
bmaltais 4bfa486ed7 Improving args style 2024-04-13 16:46:40 -04:00
bmaltais 80afccc0e4 More fixes 2024-04-13 14:36:07 -04:00
bmaltais 1e7a263f79 Fix checkpoint name and sample prompt path 2024-04-13 14:23:46 -04:00
Bernard Maltais 835b6505c0 Fix running on linux 2024-04-13 14:03:55 -04:00
bmaltais 763eda2748 Update requirements for gradio
More shlex.quote fix
2024-04-13 12:21:26 -04:00
bmaltais 7581c4949f More fixes 2024-04-13 11:47:52 -04:00
bmaltais 62aa7ba8b6 Fix paths 2024-04-13 11:09:03 -04:00
bmaltais 79a78246a2 Rewrite run_cmd to list 2024-04-13 10:42:14 -04:00
bmaltais fef3dd2d12 Quick fix for other trainers 2024-04-13 08:43:57 -04:00
bmaltais f34eea41ca Fix issue for Dreambooth training... quick fix 2024-04-13 08:29:00 -04:00
bmaltais 25bb1303ff
Restrict extensions pre_postfix can use to improve security (#2259) 2024-04-11 08:55:03 -04:00
bmaltais 8bc67a7467
Find replace (#2258)
* 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
2024-04-11 08:32:17 -04:00