Commit Graph

3401 Commits (dev)

Author SHA1 Message Date
dependabot[bot] 5536d3b6d3
Bump crate-ci/typos from 1.32.0 to 1.34.0 (#3373)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.32.0 to 1.34.0.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.32.0...v1.34.0)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bmaltais <bernard@ducourier.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-11 15:48:18 -04:00
Davi Henrique Linhares 80d3b021a9
Upgrade Pytorch for XPU (#3366)
* upgraded the versions of some dependencies

* added onnxruntime to requirements_linux_ipex.txt

* upgraded the versions of torch and torchvision

* downgraded the torch version to match the official image
2025-07-26 04:01:06 -04:00
bmaltais e794bb8a5d
feat: Add delete button to kontext manual captioning UI (#3354)
This commit adds the ability to delete a pair of images and their corresponding caption file from the kontext manual captioning tool.

A "Delete" button has been added to the UI for each image pair. When clicked, this button triggers the deletion of the control image, the target image, and the caption file. The UI is then refreshed to reflect the changes.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-18 07:10:23 -04:00
cotulars efc3c73905
Fix installation error on MacBook M Series (issue #3281) (#3353)
Co-authored-by: bmaltais <bernard@ducourier.com>
2025-07-18 07:09:54 -04:00
bmaltais f0d3e3f5b3
Feature/update gui uv for colab parity (#3350)
* feat: Update gui-uv.sh for Colab parity and add local scripts

This commit introduces changes to align the local setup via `gui-uv.sh`
more closely with the procedures in the reference Colab notebook,
particularly concerning `bitsandbytes` compilation.

Changes:
- Added `kohya_ss_colab.ipynb` to the repository for reference.
- Created `local_train.py`, a Python script adapted from the Colab
  notebook, providing an alternative setup and launch method.
- Modified `gui-uv.sh` to include a documented, optional section
  for users to build `bitsandbytes` from source if the `uv`-installed
  version is insufficient. This enhances flexibility and aids in
  troubleshooting CUDA/GPU-specific issues.

The primary goal is to make the local experience with `gui-uv.sh`
more robust and provide users with options similar to the Colab
environment's setup for critical dependencies like `bitsandbytes`.

* Update collab

* Update colab script

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-14 20:25:28 -04:00
rekgp 307e197a28
Fix pagitation (#3349)
* fix pagitation

* fix pagitation, fix page numbering
2025-07-13 20:16:51 -04:00
bmaltais 4c2e562915
Feature/suggest target folder (#3348)
* feat: Suggest target folder in kontext manual caption GUI

* feat: Suggest target folder in kontext manual caption GUI

- The suggested path for the target folder is now the full path.
- The target folder is only updated if it's empty.

* feat: Suggest target folder in kontext manual caption GUI

- The suggested path for the target folder is now the full path.
- The target folder is only updated if it's empty.

* feat: Suggest target folder in kontext manual caption GUI

- The suggested path for the target folder is now the full path.
- The target folder is only updated if it's empty.
- The logic for deriving the target folder has been updated.

* feat: Suggest target folder in kontext manual caption GUI

- The suggested path for the target folder is now the full path.
- The target folder is only updated if it's empty.
- The logic for deriving the target folder has been updated.
- Tags are now automatically imported from captions when images are loaded.

* Sort tags

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 13:42:02 -04:00
bmaltais d534cb92c2
Feat/apply gui improvements to manual captioning (#3347)
* feat: Apply Gradio GUI improvements to manual_caption_gui.py

This commit applies the same Gradio GUI improvements that were done in `kintext_manual_caption_gui.py` to `manual_caption_gui.py`.

The changes include:
- Better user feedback for status updates.
- Safer return values from functions to avoid clearing user input on errors.
- A more organized layout with better-labeled components.
- Clearer pagination controls.

* refactor: Align manual_caption_gui.py with new standards

This commit refactors the `manual_caption_gui.py` file to align with the new standards set by the `kontext_manual_caption_gui.py` file.

The changes include:
- Performance and Efficiency: Use of `os.path.basename`, `os.scandir`, and `gr.State` to improve performance.
- Code Quality and Readability: Case-insensitive tag matching, sorted tags, and improved variable names.
- UI and User Experience: Refined UI layout, consolidated pagination logic, and improved error handling.

* fix: Correct pagination display issue

This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.

* fix: Correct pagination and resolve ValueError

This commit fixes a bug in the pagination logic that was causing the incorrect page count to be displayed. The `page.change` event handler has been updated to correctly update the `page_count` component when the page number or the total number of pages changes.

This commit also resolves a `ValueError` that was occurring in the `render_pagination_with_logic` function. The `page.change` event handler has been updated to return a tuple of two `gr.Text` components, which resolves the error.

* fix: Correct pagination on initial load

This commit fixes a bug where the pagination would not display the correct number of pages on the initial load. A `max_page.change` event handler has been added to both `manual_caption_gui.py` and `kontext_manual_caption_gui.py` to ensure the page count is updated correctly.

* Update gui layout

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 13:13:09 -04:00
bmaltais 12640ff1da
Flux Kontext manual caption tool (#3346)
* feat: Add Flux manual captioning GUI

* This looks good. I have corrected the output values for `update_images` in the Flux captioning GUI.

* feat: Add Kontext manual captioning GUI

* Swap control and target position

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 11:44:13 -04:00
bmaltais 2a8c05952d Update to the latest sd-scripts sd3 branch commit 2025-07-13 14:08:34 -04:00
google-labs-jules[bot] 80a6d1ed07
Pull request for issue #3336 (#3345)
* Fix(tensorboard): Add cross-platform AVX check

I replaced the Linux-specific AVX check with a cross-platform solution using the `py-cpuinfo` library. This ensures that the TensorBoard feature is only enabled on systems with AVX support, regardless of the operating system.

The new implementation provides a more robust solution that prevents crashes on incompatible hardware while maintaining a consistent user experience across different platforms.

* Update pyproject

---------

Co-authored-by: bmaltais <bernard@ducourier.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 10:05:30 -04:00
MrZoraman d03218678c
Update installation links in README.md. (#3330)
Co-authored-by: bmaltais <bernard@ducourier.com>
2025-07-13 09:56:11 -04:00
google-labs-jules[bot] 60d99eceff
Pull request for issue #3209 (#3342)
* docs: Add documentation for allowed_paths

This change adds documentation for the `allowed_paths` config option to the `README.md` file.

* docs: Add server section to config example

This change adds the `[server]` section to the `config example.toml` file, including the `allowed_paths` option.

---------

Co-authored-by: bmaltais <bernard@ducourier.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 09:42:36 -04:00
google-labs-jules[bot] c8dc6d14fb
Fix: Update Intel packages for oneAPI compatibility (#3341)
The `libsycl.so.7` error was caused by an incompatibility with the installed oneAPI version. This commit updates the following packages to their latest versions to resolve the issue:
- intel-extension-for-tensorflow[xpu]
- mkl
- mkl-dpcpp
- oneccl-devel
- impi-devel

Co-authored-by: bmaltais <bernard@ducourier.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-13 08:29:44 -04:00
Ashley Kleynhans 278ef11078
Updated Runpod template links (#3325) 2025-07-13 08:21:09 -04:00
dependabot[bot] 01eb6abd54
Bump crate-ci/typos from 1.32.0 to 1.34.0 (#3319)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.32.0 to 1.34.0.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.32.0...v1.34.0)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bmaltais <bernard@ducourier.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 05:16:09 -04:00
Travis Geiselbrecht 15e27a2d53
wd14 tagger: add SmilingWolf/wd-eva02-large-tagger-v3 (#3315) 2025-06-28 09:57:22 -04:00
bmaltais 466e0a35cf Update expand_all_accordions to false 2025-06-24 22:27:47 -04:00
bmaltais ed5f0b7bee Fix missing keys 2025-06-24 22:24:53 -04:00
bmaltais 26a79fe7d4 Improve config.toml example 2025-06-24 22:08:35 -04:00
bmaltais cd510b812d
Improve clarity and formatting of config example.toml (#3314)
- Added and updated comments for better understanding of parameters.
- Improved formatting and alignment for readability.
- Corrected misleading comments regarding `cpu_offload_checkpointing` and the purpose of the final `[dataset_preparation]` section.
- Ensured all key names and TOML structure used by the GUI remain unchanged.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-24 22:00:56 -04:00
bmaltais 7d136b020c
Update config toml (#3312)
* Aligned config.toml with gradio elements

* Align Gradio UI elements with config.toml

Ensured that all relevant Gradio UI elements in Dreambooth, Finetune,
LoRA, and Textual Inversion GUIs, along with their supporting classes,
load their default values from `config.toml`.

- Added missing keys to `config example.toml` for newly configurable elements.
- Modified Python files to use `config.get()` for these elements,
  preserving original default behaviors if keys are not in `config.toml`.
- Corrected minor inconsistencies in existing `config.get()` usage.

* Update alignment

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-24 21:50:07 -04:00
bmaltais bce66dacaa
Merge pull request #3310 from bmaltais/feat/expand_all_accordions
Expand all accordions option
2025-06-24 20:39:00 -04:00
bmaltais 172a727726 Expand all accordions option 2025-06-24 20:37:32 -04:00
bmaltais 3bb052746f More readme fix 2025-06-24 17:34:38 -04:00
bmaltais 0e1c61c6b7 Update readme 2025-06-24 17:33:04 -04:00
bmaltais 547bf27131 Fix misplaced documentation 2025-06-24 17:29:58 -04:00
bmaltais c999f07816
Merge pull request #3306 from bmaltais/remove-easygui-alternative
Refactor: Remove easygui and replace dialogs with notifications
2025-06-23 09:16:29 -04:00
bmaltais d3e6ebab2e
Merge pull request #3305 from bmaltais/feature/version-from-pyproject
Refactor: Read version from pyproject.toml
2025-06-23 09:07:15 -04:00
google-labs-jules[bot] 3e1cfdac06 Refactor: Read version from pyproject.toml
Centralize version information by reading it from the `[project.version]`
field in `pyproject.toml` instead of the separate `.release` file.

Changes:
- Modified `kohya_gui.py` to use the `toml` library to parse `pyproject.toml`
  and retrieve the version string.
- Added a "v" prefix to the version for display consistency.
- Included a fallback to "vUNKNOWN" if `pyproject.toml` is missing or the
  version cannot be read.
- Deleted the now-unused `.release` file.

Note: Full runtime testing was prevented by an out-of-disk-space error
in the test environment when installing dependencies. The core code change
for version sourcing has been implemented as requested.
2025-06-23 12:54:32 +00:00
bmaltais aa6526d13a Update release 2025-06-23 08:35:07 -04:00
google-labs-jules[bot] 0e82250c52 Refactor: Remove easygui and replace dialogs with notifications
Removed all usage of the `easygui` library.

- Replaced `easygui.msgbox` calls with Gradio notifications (`gr.Info`, `gr.Warning`, `gr.Error`) to display messages and errors directly in the UI.
- Replaced `easygui.ynbox` and `easygui.boolbox` confirmation dialogs with a default action of proceeding with the operation, accompanied by a notification. This affects:
    - Model saving: Will now overwrite existing models by default, notifying the user.
    - Dataset balancing: Enabling 'insecure folder renaming' will proceed without a second confirmation, with a warning displayed.
    - Manual captioning: Importing tags will overwrite existing quick tags by default, with a notification.
- Removed `easygui` from all Python import statements.
- Removed `easygui` from `requirements.txt` and `pyproject.toml`.

Note: The `uv.lock` file has not been modified as part of this commit. It should be regenerated using the `uv` tool to reflect the dependency changes in `pyproject.toml` and `requirements.txt`.
2025-06-23 00:23:36 +00:00
bmaltais b48c86cbff
python3.11 support
The script will now detect and utilize Python 3.11 alongside Python 3.10.

Here are the key changes:
- I added a function to detect the available Python command, prioritizing python3.11, then python3.10, then python3.
- I modified virtual environment creation to use the detected Python version.
- I updated macOS Homebrew installation logic to check for python@3.11 and python-tk@3.11 first.
- I made Python-version-specific paths (e.g., for site-packages and symlinks, especially in Runpod environments) dynamic to adapt to the selected Python version.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-20 07:30:38 -04:00
bmaltais dcef66a001 Update lock file 2025-06-19 19:54:20 -04:00
bmaltais 6c05e32070 Fix bad commit 2025-06-19 19:53:15 -04:00
bmaltais e9be00a193 Update requirements 2025-06-19 19:52:10 -04:00
bmaltais 23b70c8f16
Core improvements batch1 (#3294)
* Refactor and Improve Core Components

This commit includes several improvements to the core components of the Kohya_ss GUI:

1.  **Refactored `check_torch()` in `setup/setup_common.py`**:
    *   Broke down the function into smaller, more focused functions for better readability and maintainability.
    *   Simplified the logic for detecting different hardware backends (CUDA, ROCm, Intel OneAPI).

2.  **Improved Error Handling in `setup/setup_common.py`**:
    *   Made error messages more user-friendly and informative by providing context and suggestions.
    *   Ensured consistent logging of errors.
    *   Enhanced error reporting for external processes like Git and pip/uv.

3.  **Enhanced Documentation for `config.toml`**:
    *   Updated the "Custom Path Defaults" section in `README.md` with more details on customizing `config.toml`.
    *   Provided clearer examples of common configurations.

4.  **Reviewed and Updated Dependencies**:
    *   Removed several unused dependencies from `pyproject.toml` (`altair`, `fairscale`, `imagesize`, `invisible-watermark`, `pytorch-lightning`, `voluptuous`).
    *   Updated various dependencies to their latest stable and compatible versions.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-19 08:07:05 -04:00
bmaltais d85ae6bdb5
It looks like the setup.sh and gui.sh scripts were incorrectly defaulting to ROCm package installation if `rocminfo` was present, even on systems with NVIDIA GPUs. (#3293)
I've modified both scripts to check for `nvidia-smi` first. If `nvidia-smi` is found, the scripts will now use the NVIDIA-specific (CUDA) requirements files, regardless of the presence of `rocminfo`. The ROCm check is now a fallback if `nvidia-smi` is not detected.

This should ensure that you get the correct PyTorch build and dependencies if you have an NVIDIA GPU, resolving the issue where ROCm packages were being erroneously selected.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-18 19:52:40 -04:00
bmaltais 8a81733794 Revert "feat: Remember last used folder for file dialogs (#3290)"
This reverts commit 51d87f5309.
2025-06-17 10:07:04 -04:00
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
bmaltais 060c58a319
Docs python version uv (#3289)
* Docs: Explain .python-version file for uv installs

I've updated the Linux and Windows uv installation guides to explain that you can specify the Python version for the uv environment by editing the .python-version file at the root of the repository.

* Update linux documentation

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-16 07:28:39 -04:00
bmaltais a06a69030a Ignore .python-version changes 2025-06-16 07:11:31 -04:00
bmaltais 6357ce868b Update python verstion to 3.11 2025-06-16 07:10:02 -04:00
bmaltais ef9c32371f
Merge pull request #3287 from niels-numbers/master
Refactor Installation Docs: Extract per-platform instructions to dedicated .md files (follow-up to #3278)
2025-06-15 18:54:51 -04:00
Dr. Adam Niels Nielsen fbc17f9c82
Merge branch 'bmaltais:master' into master 2025-06-15 23:19:21 +02:00
Adam Nielsen 57ec255a1f docs: extract pip/uv installation guides to OS-specific markdown files and update main README 2025-06-15 23:16:52 +02:00
bmaltais 850c1a9c49
Merge pull request #3285 from bmaltais/dev
v25.2.0
2025-06-15 10:24:56 -04:00
bmaltais 8dfa947c49 Merge branch 'dev' of https://github.com/bmaltais/kohya_ss into dev 2025-06-15 10:23:30 -04:00
bmaltais 451f84d4ae Update release number 2025-06-15 10:23:04 -04:00
bmaltais 6ca6ecd7bd
Merge pull request #3280 from Disty0/dev
Update IPEX and ROCm
2025-06-14 14:04:16 -04:00