Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,32 @@ releases.

## [Unreleased]

## [v0.4.0] - 2026-08-20 UTC

### Changed

- Update the PyTorch stack from PyTorch 2.8.0, torchvision 0.23.0, and
xformers 0.0.32.post2 on CUDA 12.9 to PyTorch 2.13.0, torchvision 0.28.0,
and xformers 0.0.35 on CUDA 13.0.
- Update ONNX from 1.21.0 to 1.22.0.
- Update the runtime CA certificate bundle to the current Ubuntu 24.04
security-update version.
- Update the locked `charset-normalizer` dependency from 3.4.9 to 3.5.0.
- Document the NVIDIA CUDA container license included in the published image.

### Security

- Update ONNX and PyTorch to versions containing the available fixes for the
repository's current Dependabot advisories.

### Notes

- Continue to bundle sd-scripts v0.11.1 with Python 3.10. Retain the CUDA
12.9.1 base image for ONNX Runtime GPU compatibility while PyTorch and
xformers use their CUDA 13.0 wheel builds.
- GitHub Actions, uv, Python, CUDA, hadolint, and APM remain at their latest
reviewed versions that completed the seven-day cooldown.

## [v0.3.1] - 2026-07-26 UTC

### Fixed
Expand Down Expand Up @@ -238,7 +264,9 @@ releases.
- Add the first GitHub Actions build workflow and disk cleanup step.
- Add initial ignore rules for local work directories.

[Unreleased]: https://github.com/aoirint/sd_scripts_docker/compare/v0.3.0...HEAD
[Unreleased]: https://github.com/aoirint/sd_scripts_docker/compare/v0.4.0...HEAD
[v0.4.0]: https://github.com/aoirint/sd_scripts_docker/compare/v0.3.1...v0.4.0
[v0.3.1]: https://github.com/aoirint/sd_scripts_docker/compare/v0.3.0...v0.3.1
[v0.3.0]: https://github.com/aoirint/sd_scripts_docker/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/aoirint/sd_scripts_docker/compare/v0.1.0...v0.2.0
[v0.1.0]: https://github.com/aoirint/sd_scripts_docker/releases/tag/v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update

apt-get install -y --no-install-recommends \
ca-certificates=20240203 \
ca-certificates=20260601~24.04.1 \
git=1:2.43.0-1ubuntu7.3
SH

Expand Down Expand Up @@ -74,7 +74,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update

apt-get install -y --no-install-recommends \
ca-certificates=20240203 \
ca-certificates=20260601~24.04.1 \
libgl1=1.7.0-1build1 \
libglib2.0-0t64=2.80.0-6ubuntu3.8 \
tk=8.6.14build1
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,11 @@ specified by `SD_SCRIPTS_VERSION` in the Dockerfile. sd-scripts is primarily
licensed under the Apache License 2.0, with some portions under separate license
terms. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and the upstream
license information for details.

The image also uses the
[NVIDIA CUDA container image](https://hub.docker.com/r/nvidia/cuda) specified by
`CUDA_RUNTIME_IMAGE` in the Dockerfile. Its container license is included at
`/NGC-DL-CONTAINER-LICENSE` in the published image. See
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and the
NVIDIA Deep Learning Container License:
<https://developer.download.nvidia.com/licenses/NVIDIA_Deep_Learning_Container_License.pdf>.
9 changes: 9 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

This project builds Docker images that include third-party software.

## NVIDIA CUDA container image

- Source: <https://hub.docker.com/r/nvidia/cuda>
- Base image: see `CUDA_RUNTIME_IMAGE` in `Dockerfile`
- Bundled location in image: `/usr/local/cuda-12.9`
- License: NVIDIA Deep Learning Container License
<https://developer.download.nvidia.com/licenses/NVIDIA_Deep_Learning_Container_License.pdf>
- License file in image: `/NGC-DL-CONTAINER-LICENSE`

## kohya-ss/sd-scripts

- Source: <https://github.com/kohya-ss/sd-scripts>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.4.0
62 changes: 45 additions & 17 deletions docs/update-sd-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,44 +131,52 @@ wheel depends on the CUDA target. Read the selected upstream README and choose
the PyTorch stack that matches this image's supported GPU generation.

For RTX 50 series support, use the upstream-recommended PyTorch and CUDA line
when available. For example, PyTorch 2.8.0 with CUDA 12.9 uses:
when available. For example, PyTorch 2.13.0 with CUDA 13.0 uses:

```toml
"torch==2.8.0+cu129",
"torchvision==0.23.0+cu129",
"xformers==0.0.32.post2",
"torch==2.13.0+cu130",
"torchvision==0.28.0+cu130",
"xformers==0.0.35",
```

and:

```toml
[[tool.uv.index]]
name = "pytorch-cu129"
url = "https://download.pytorch.org/whl/cu129"
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

[tool.uv.sources]
torch = { index = "pytorch-cu129" }
torchvision = { index = "pytorch-cu129" }
xformers = { index = "pytorch-cu129" }
torch = { index = "pytorch-cu130" }
torchvision = { index = "pytorch-cu130" }
xformers = { index = "pytorch-cu130" }
```

Before locking, confirm that the selected wheels exist for Python 3.10 and
Linux x86_64:

```shell
curl -fsSL https://download.pytorch.org/whl/cu129/torch/ | \
rg 'torch-2\.8\.0\+cu129-cp310-cp310-.*x86_64'
curl -fsSL https://download.pytorch.org/whl/cu130/torch/ | \
rg 'torch-2\.13\.0\+cu130-cp310-cp310-.*x86_64'

curl -fsSL https://download.pytorch.org/whl/cu129/torchvision/ | \
rg 'torchvision-0\.23\.0\+cu129-cp310-cp310-.*x86_64'
curl -fsSL https://download.pytorch.org/whl/cu130/torchvision/ | \
rg 'torchvision-0\.28\.0\+cu130-cp310-cp310-.*x86_64'

curl -fsSL https://download.pytorch.org/whl/cu129/xformers/ | \
rg 'xformers-0\.0\.32\.post2-.*x86_64'
curl -fsSL https://download.pytorch.org/whl/cu130/xformers/ | \
rg 'xformers-0\.0\.35-.*x86_64'
```

If the upstream README recommends a different CUDA line, replace `cu129`,
package versions, and the `pytorch-cu129` index name consistently.
If the upstream README recommends a different CUDA line, replace `cu130`,
package versions, and the `pytorch-cu130` index name consistently.

Do not assume that the CUDA runtime base image must use the same CUDA release
as the PyTorch wheel index. PyTorch wheels bundle their CUDA user-space
libraries, while the PyPI ONNX Runtime GPU wheel can require an older CUDA
major version from the base image. Verify both stacks on a GPU before changing
the runtime base. A mixed setup is acceptable when PyTorch, xformers, and ONNX
Runtime all execute successfully and the reason is recorded in the changelog
and pull request.

## 5. Update The Dockerfile

Expand Down Expand Up @@ -317,6 +325,24 @@ docker run --rm --gpus all --entrypoint python sd-scripts:update-test -c \
'import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0) if torch.cuda.is_available() else "no cuda")'
```

For PyTorch-stack updates, exercise CUDA kernels instead of relying on imports
or `torch.cuda.is_available()` alone. At minimum, run a PyTorch tensor
operation, xformers memory-efficient attention, and a bitsandbytes operation.
For ONNX Runtime updates, create an inference session with
`CUDAExecutionProvider`, run a small model, and confirm that the session did
not fall back to `CPUExecutionProvider`.

Also run the WD14 ONNX captioning path with an actual image and model. This
loads the full accelerate, timm, ONNX, and ONNX Runtime path that previously
passed import-only checks but failed at startup:

```shell
docker run --rm --gpus all -v /path/to/smoke-data:/work \
sd-scripts:update-test \
finetune/tag_images_by_wd14_tagger.py --onnx --batch_size 1 \
--model_dir /work/model /work/images
```

For a release that changes PyTorch, CUDA, xformers, or sd-scripts training
behavior, run at least one small project-specific training or captioning
workflow before merging when practical.
Expand Down Expand Up @@ -383,6 +409,8 @@ Confirm:
- `uv.lock` resolves the selected PyTorch CUDA index.
- Local extras are intentionally kept, updated, or removed.
- Upstream sd-scripts pytest release tests passed in the built image.
- PyTorch, xformers, bitsandbytes, and ONNX Runtime executed GPU operations,
and the WD14 ONNX captioning path completed without provider fallback.
- Every explicit pytest path in `scripts/run-sd-scripts-release-tests.sh`
exists in the selected upstream checkout.
- Upstream inpainting shell tests were run, or GPU/checkpoint coverage was
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"timm==0.6.12",
"fairscale==0.4.13",
# for WD14 captioning (onnx)
"onnx==1.21.0",
"onnx==1.22.0",
"onnxruntime-gpu==1.23.2",
# open clip for SDXL
"open-clip-torch==2.26.1",
Expand All @@ -40,9 +40,9 @@ dependencies = [
# for T5XXL tokenizer (SD3/FLUX)
"sentencepiece==0.2.1",
# PyTorch
"torch==2.8.0+cu129",
"torchvision==0.23.0+cu129",
"xformers==0.0.32.post2",
"torch==2.13.0+cu130",
"torchvision==0.28.0+cu130",
"xformers==0.0.35",
# Additional bundle
# https://github.com/KohakuBlueleaf/LyCORIS
"lycoris-lora==3.1.1.post1",
Expand All @@ -53,14 +53,14 @@ package = false
exclude-newer = "P7D"

[[tool.uv.index]]
name = "pytorch-cu129"
url = "https://download.pytorch.org/whl/cu129"
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

[tool.uv.sources]
torch = { index = "pytorch-cu129" }
torchvision = { index = "pytorch-cu129" }
xformers = { index = "pytorch-cu129" }
torch = { index = "pytorch-cu130" }
torchvision = { index = "pytorch-cu130" }
xformers = { index = "pytorch-cu130" }

[dependency-groups]
dev = [
Expand Down
Loading