diff --git a/.versions b/.versions index 6d1999e17..0892301b5 100644 --- a/.versions +++ b/.versions @@ -3,6 +3,6 @@ GOLANGCI_LINT_VERSION=v2.12.2 VLLM_VERSION=0.19.1 VLLM_UPSTREAM_VERSION=0.19.0 VLLM_METAL_RELEASE=v0.2.0-20260420-142150 -DIFFUSERS_RELEASE=v0.1.0-20260216-000000 +DIFFUSERS_RELEASE=v0.1.0-20260617-000000 SGLANG_VERSION=0.5.6 LLAMA_SERVER_VERSION=b9592 diff --git a/Makefile b/Makefile index b3f4df87f..5212041ad 100644 --- a/Makefile +++ b/Makefile @@ -342,8 +342,13 @@ diffusers-build: @if [ -f "$(DIFFUSERS_TARBALL)" ]; then \ echo "Tarball already exists: $(DIFFUSERS_TARBALL)"; \ else \ + set -e; \ echo "Building diffusers tarball..."; \ scripts/build-diffusers-tarball.sh $(DIFFUSERS_RELEASE) $(DIFFUSERS_TARBALL); \ + if [ ! -f "$(DIFFUSERS_TARBALL)" ]; then \ + echo "Error: $(DIFFUSERS_TARBALL) was not created"; \ + exit 1; \ + fi; \ echo "Tarball created: $(DIFFUSERS_TARBALL)"; \ fi @@ -369,7 +374,8 @@ diffusers-dev: echo "Usage: make diffusers-dev DIFFUSERS_PATH=../path-to-diffusers-server"; \ exit 1; \ fi - @PYTHON_BIN=""; \ + @set -e; \ + PYTHON_BIN=""; \ if command -v python3.12 >/dev/null 2>&1; then \ PYTHON_BIN="python3.12"; \ elif command -v python3 >/dev/null 2>&1; then \ @@ -386,11 +392,11 @@ diffusers-dev: echo "Installing diffusers from $(DIFFUSERS_PATH)..."; \ rm -rf "$(DIFFUSERS_INSTALL_DIR)"; \ $$PYTHON_BIN -m venv "$(DIFFUSERS_INSTALL_DIR)"; \ - . "$(DIFFUSERS_INSTALL_DIR)/bin/activate" && \ - pip install "diffusers==0.36.0" "torch==2.9.1" "transformers==4.57.5" "accelerate==1.3.0" "safetensors==0.5.2" "huggingface_hub==0.34.0" "bitsandbytes==0.49.1" "fastapi==0.115.12" "uvicorn[standard]==0.34.1" "pillow==11.2.1" && \ - SITE_PACKAGES="$(DIFFUSERS_INSTALL_DIR)/lib/python3.12/site-packages" && \ - cp -Rp "$(DIFFUSERS_PATH)/python/diffusers_server" "$$SITE_PACKAGES/diffusers_server" && \ - echo "dev" > "$(DIFFUSERS_INSTALL_DIR)/.diffusers-version"; \ + . "$(DIFFUSERS_INSTALL_DIR)/bin/activate"; \ + pip install "diffusers==0.38.0" "torch==2.9.1" "transformers==4.57.5" "accelerate==1.3.0" "safetensors==0.8.0" "huggingface_hub==0.34.0" "bitsandbytes==0.49.1" "fastapi==0.115.12" "uvicorn[standard]==0.34.1" "pillow==11.2.1"; \ + SITE_PACKAGES="$(DIFFUSERS_INSTALL_DIR)/lib/python3.12/site-packages"; \ + cp -Rp "$(DIFFUSERS_PATH)/python/diffusers_server" "$$SITE_PACKAGES/diffusers_server"; \ + echo "dev" > "$(DIFFUSERS_INSTALL_DIR)/.diffusers-version"; \ echo "diffusers dev installed from $(DIFFUSERS_PATH)" diffusers-clean: diff --git a/pkg/inference/backends/diffusers/diffusers.go b/pkg/inference/backends/diffusers/diffusers.go index 914ae32b9..1cda1967c 100644 --- a/pkg/inference/backends/diffusers/diffusers.go +++ b/pkg/inference/backends/diffusers/diffusers.go @@ -26,7 +26,8 @@ const ( Name = "diffusers" defaultInstallDir = ".docker/model-runner/diffusers" // diffusersVersion is the diffusers release tag to download from Docker Hub. - diffusersVersion = "v0.1.0-20260216-000000" + // Keep in sync with DIFFUSERS_RELEASE in .versions. + diffusersVersion = "v0.1.0-20260617-000000" ) var ( @@ -258,7 +259,7 @@ func (d *diffusers) Run(ctx context.Context, socket, model string, modelRef stri BackendName: "Diffusers", Socket: socket, BinaryPath: d.pythonPath, - SandboxPath: "", + SandboxPath: d.installDir, SandboxConfig: sandbox.ConfigurationPython, Args: args, Logger: d.log, diff --git a/scripts/build-diffusers-tarball.sh b/scripts/build-diffusers-tarball.sh index ec85f3613..566e4884d 100755 --- a/scripts/build-diffusers-tarball.sh +++ b/scripts/build-diffusers-tarball.sh @@ -40,15 +40,19 @@ fi echo "Installing standalone Python 3.12 via uv..." uv python install 3.12 -PYTHON_BIN=$(uv python find 3.12) +PYTHON_BIN=$(uv python find 3.12 | awk '/^\// { path=$0 } END { print path }') +if [ -z "$PYTHON_BIN" ]; then + echo "Error: could not resolve uv Python 3.12 path" >&2 + exit 1 +fi PYTHON_PREFIX=$(cd "$(dirname "$PYTHON_BIN")/.." && pwd) echo "Using standalone Python from: $PYTHON_PREFIX" -DIFFUSERS_VERSION="0.36.0" +DIFFUSERS_VERSION="0.38.0" TORCH_VERSION="2.9.1" TRANSFORMERS_VERSION="4.57.5" ACCELERATE_VERSION="1.3.0" -SAFETENSORS_VERSION="0.5.2" +SAFETENSORS_VERSION="0.8.0" HUGGINGFACE_HUB_VERSION="0.34.0" BITSANDBYTES_VERSION="0.49.1" FASTAPI_VERSION="0.115.12"