From cbf428d2957def704c25cf63ea48d903dcd83763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20L=C3=B3pez=20Luna?= Date: Wed, 17 Jun 2026 21:52:27 +0200 Subject: [PATCH 1/3] chore: bump diffusers to 0.38.0 (trust_remote_code security fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump the diffusers backend from 0.36.0 to 0.38.0 to pick up the trust_remote_code hardening from huggingface/diffusers#13448, which fixes trust_remote_code=False being bypassed when loading pipelines/components from local directories — the path the diffusers_server uses for DDUF and local model bundles. - build-diffusers-tarball.sh: diffusers 0.36.0 -> 0.38.0, safetensors 0.5.2 -> 0.8.0 (required by diffusers 0.38.0, which needs safetensors>=0.8.0) - Makefile (diffusers-dev): sync the same pins, which had drifted - .versions / diffusers.go: new release tag v0.1.0-20260617-000000 The matching image is published from docker/inference-engine-llama.cpp (build-diffusers workflow). Co-Authored-By: Claude Opus 4.8 (1M context) --- .versions | 2 +- Makefile | 2 +- pkg/inference/backends/diffusers/diffusers.go | 3 ++- scripts/build-diffusers-tarball.sh | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) 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..557a4948a 100644 --- a/Makefile +++ b/Makefile @@ -387,7 +387,7 @@ diffusers-dev: 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" && \ + 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"; \ diff --git a/pkg/inference/backends/diffusers/diffusers.go b/pkg/inference/backends/diffusers/diffusers.go index 914ae32b9..b805719be 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 ( diff --git a/scripts/build-diffusers-tarball.sh b/scripts/build-diffusers-tarball.sh index ec85f3613..2cc37c897 100755 --- a/scripts/build-diffusers-tarball.sh +++ b/scripts/build-diffusers-tarball.sh @@ -44,11 +44,11 @@ PYTHON_BIN=$(uv python find 3.12) 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" From 9ad15f20991634abe42d372a2ac2c0def8a28394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20L=C3=B3pez=20Luna?= Date: Thu, 18 Jun 2026 10:42:59 +0200 Subject: [PATCH 2/3] fix SandboxPath for diffusers --- pkg/inference/backends/diffusers/diffusers.go | 2 +- scripts/build-diffusers-tarball.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/inference/backends/diffusers/diffusers.go b/pkg/inference/backends/diffusers/diffusers.go index b805719be..1cda1967c 100644 --- a/pkg/inference/backends/diffusers/diffusers.go +++ b/pkg/inference/backends/diffusers/diffusers.go @@ -259,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 2cc37c897..566e4884d 100755 --- a/scripts/build-diffusers-tarball.sh +++ b/scripts/build-diffusers-tarball.sh @@ -40,7 +40,11 @@ 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" From c9769a4af774b615d6ecca8c547bb66ff84d08cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20L=C3=B3pez=20Luna?= Date: Thu, 18 Jun 2026 11:01:00 +0200 Subject: [PATCH 3/3] fix: make diffusers targets fail on errors --- Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 557a4948a..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.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"; \ + . "$(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: