Skip to content

v25.1.0 #3252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 322 commits into from
May 25, 2025
Merged

v25.1.0 #3252

merged 322 commits into from
May 25, 2025

Conversation

bmaltais
Copy link
Owner

Merge dev branch into master

bmaltais and others added 25 commits April 5, 2025 08:47
* Adding some changes to support current apple silicone

Adding a note that MPS is detected in validation, and a current set of packages that offer MPS torch acceleration

* Adding MPS support for blip2
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.31.1 to 1.31.2.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.31.1...v1.31.2)

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

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add deepspeed support under linux
This commit significantly revamps the README.md to improve clarity,
organization, and completeness for you.

Key changes include:
- Enhanced project introduction: Clearly defines project purpose and key features.
- Improved structure:
    - Moved detailed installation guides (Docker, Runpod, Novita) and specific
      troubleshooting (Tesla V100) to separate files in `docs/`.
    - Standardized formatting for notes, warnings, and important messages.
- Content updates and additions:
    - Added a "Prerequisites" section.
    - Expanded the "LoRA" section with links to detailed documentation.
    - Updated "SDXL training" and "Masked loss" sections, removing obsolete notes.
    - Added "Contributing" guidelines and a "License" section.
    - Incorporated badges for GitHub stars, forks, license, and issues.
    - Removed the outdated "ToDo" section.
- Link verification: Ensured internal links are correct and external links
  are properly formatted.
- Change History: Condensed the verbose v25.0.0 entry for better readability.

These changes aim to provide a more user-friendly and informative entry
point for the Kohya's GUI project.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Upgrade base image from Python 3.10 to Python 3.11 slim on Debian Bullseye.
- Replace manual PyTorch and dependencies installation with uv environment management and installation.
- Add installation of large dependencies (torch, triton, tensorflow, onnxruntime-gpu) explicitly to optimize image layer caching.
- Switch from pip to uv for package management and dependency synchronization.
- Replace pillow with pillow-simd on amd64 architecture using uv-managed pip for performance improvements.
- Adjust environment variables to use the virtual environment under /venv instead of local user installs.
- Create /venv directory with appropriate permissions and copy the virtual environment from build stage.
- Modify CMD to add --noverify flag when launching kohya_gui.py.
- Remove requirements_linux_docker.txt file, consolidating dependency management into uv and pyproject.toml.

Signed-off-by: CHEN, CHUN <[email protected]>
This commit significantly restructures the README.md to provide clearer documentation for using `uv` and `pip` for installation, upgrades, and launching the GUI.

A new 'Installation Methods' section has been added to centralize the explanation of `uv` and `pip`, outlining their differences and recommended use cases.

Existing sections ('Installation', 'Upgrading', 'Starting GUI Service') have been refactored to:
- Remove redundant instructions.
- Clearly refer to the 'Installation Methods' section.
- Distinguish between `uv`-specific scripts (e.g., `gui-uv.bat`) and `pip`-specific scripts (e.g., `gui.bat`).

The goal of these changes is to reduce confusion and make it easier for you to choose and follow the installation path that best suits your needs.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Update the uv installation instructions removing Docker from the list of exceptions and affected notes.

We have now switched to using uv for building docker image.
Both uv and pip are effective options for the docker environment, and I believe there is no need to highlight either method when making a selection.
I have left the Runpod as is because I do not have experience with Runpod.

Signed-off-by: CHEN, CHUN <[email protected]>
* I've added a `max_grad_norm` parameter to the Dreambooth GUI.

This change adds support for the `max_grad_norm` parameter to the Dreambooth training GUI.

- The `max_grad_norm` option is now available in the 'Basic' training parameters section.
- The value you set in the GUI for `max_grad_norm` is passed to the training script via the generated TOML configuration file, similar to its existing implementation in the LoRA GUI.

* Fix mising entry for max_grad_norm

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@bmaltais bmaltais requested a review from Copilot May 25, 2025 21:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A version bump to v25.1.0 that merges dev into master, introducing UI fixes, new installation prompts, extended docs, and a Dockerfile refactor.

  • Fix checkbox toggle logic in source model UI
  • Add MPS support and clean up debug in BLIP2 GUI
  • Overhaul uv-based install scripts; reorganize installation docs
  • Major multi-stage Dockerfile rewrite with uv integration

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
kohya_gui/class_source_model.py Adjust checkbox toggling behavior
kohya_gui/class_basic_training.py Swap slider for number input on max_grad_norm
kohya_gui/blip2_caption_gui.py Add MPS device support; temporary debug print
gui-uv.sh Prompt for uv install with Y/n logic
gui-uv.bat Add Windows uv install prompt
README.md Rework installation section with uv vs pip methods
Dockerfile Rewrite multi-stage build to use uv and Python 3.11
Untitled-1.sh Stray extraction commands script
Comments suppressed due to low confidence (3)

gui-uv.sh:42

  • An empty response is treated as No despite the '[Y/n]' prompt. Update the logic to treat empty input as Yes or adjust the prompt to reflect the actual default.
read -p "uv is not installed. ... [Y/n]: " install_uv

gui-uv.bat:11

  • Installing uv via pip pulls an unrelated Python package. The Windows script should invoke the official installer (e.g., the astral.sh script) to install the uv CLI tool.
pip install --upgrade uv -q

Untitled-1.sh:1

  • [nitpick] This appears to be a stray, hardcoded Windows script. Consider removing or relocating it to avoid confusion.
D:\kohya_ss\.venv\Scripts\python.exe D:/kohya_ss/...

@@ -278,11 +278,11 @@ def list_dataset_config_dirs(path: str) -> list:

def toggle_checkboxes(v2, v_parameterization, sdxl_checkbox, sd3_checkbox, flux1_checkbox):
# Check if all checkboxes are unchecked
if not v2 and not v_parameterization and not sdxl_checkbox and not sd3_checkbox and not flux1_checkbox:
if not v2 and not sdxl_checkbox and not sd3_checkbox and not flux1_checkbox:
Copy link
Preview

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition no longer checks v_parameterization, so a checked v_parameterization will be reset when others are false. Include not v_parameterization in the if statement.

Suggested change
if not v2 and not sdxl_checkbox and not sd3_checkbox and not flux1_checkbox:
if not v2 and not v_parameterization and not sdxl_checkbox and not sd3_checkbox and not flux1_checkbox:

Copilot uses AI. Check for mistakes.

@@ -291,7 +291,7 @@ def toggle_checkboxes(v2, v_parameterization, sdxl_checkbox, sd3_checkbox, flux1
# If any checkbox is checked, return checkboxes with current interactive state
return (
gr.Checkbox(interactive=v2), # v2 checkbox
gr.Checkbox(interactive=v_parameterization), # v_parameterization checkbox
gr.Checkbox(interactive=sdxl_checkbox), # v_parameterization checkbox
Copy link
Preview

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The v_parameterization checkbox is using sdxl_checkbox for its interactive state. It should use v_parameterization instead.

Suggested change
gr.Checkbox(interactive=sdxl_checkbox), # v_parameterization checkbox
gr.Checkbox(interactive=v_parameterization), # v_parameterization checkbox

Copilot uses AI. Check for mistakes.

maximum=1.0,
interactive=True,
)
self.max_grad_norm = gr.Number(label='Max grad norm', value=1.0, interactive=True)
Copy link
Preview

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Replacing a Slider with a Number input removes built-in range enforcement. Consider using gr.Slider to constrain values between the intended min and max.

Suggested change
self.max_grad_norm = gr.Number(label='Max grad norm', value=1.0, interactive=True)
self.max_grad_norm = gr.Slider(
label='Max grad norm',
value=1.0,
minimum=0.0,
maximum=10.0,
step=0.1,
interactive=True,
)

Copilot uses AI. Check for mistakes.

@@ -13,10 +23,13 @@ The GUI allows you to set the training parameters and generate and run the requi
- [Windows](#windows)
- [Windows Pre-requirements](#windows-pre-requirements)
- [Setup Windows](#setup-windows)
- [Optional: CUDNN 8.9.6.50](#optional-cudnn-89650)
- [Using uv based package manager](#using-uv-based-package-manager)
- [Using the pip package manager](#using-the-pip-package-manager)
Copy link
Preview

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table of contents defines duplicate or inconsistent anchors for uv vs pip sections, which can break navigation. Unify the anchor IDs and link targets.

Copilot uses AI. Check for mistakes.

Comment on lines +76 to +83
# torch (866.2MiB)
torch==2.5.1+cu124 \
# triton (199.8MiB)
triton==3.1.0 \
# tensorflow (615.0MiB)
tensorflow>=2.16.1 \
# onnxruntime-gpu (215.7MiB)
onnxruntime-gpu==1.19.2
Copy link
Preview

Copilot AI May 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inline comments and trailing whitespace on continuation lines may cause Docker parsing issues. Move comments above or split into separate RUN steps.

Suggested change
# torch (866.2MiB)
torch==2.5.1+cu124 \
# triton (199.8MiB)
triton==3.1.0 \
# tensorflow (615.0MiB)
tensorflow>=2.16.1 \
# onnxruntime-gpu (215.7MiB)
onnxruntime-gpu==1.19.2
# torch (866.2MiB)
torch==2.5.1+cu124 \
# triton (199.8MiB)
triton==3.1.0 \
# tensorflow (615.0MiB)
tensorflow>=2.16.1 \
# onnxruntime-gpu (215.7MiB)
onnxruntime-gpu==1.19.2

Copilot uses AI. Check for mistakes.

@bmaltais bmaltais merged commit 17075c4 into master May 25, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.