From 6869b4e2e0e96c1830815b34226366735ce12e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20L=C3=B3pez=20Luna?= Date: Tue, 20 Jan 2026 09:54:02 +0100 Subject: [PATCH 1/3] feat(diffusers): add support for diffusers backend in installation and image building --- .github/workflows/release.yml | 19 +++++++++++++++++++ cmd/cli/commands/install-runner.go | 17 ++++++++++++++--- cmd/cli/pkg/standalone/controller_image.go | 5 +++++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9466c94aa..28b2261fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,6 +87,12 @@ jobs: echo "docker/model-runner:latest-sglang-cuda" >> "$GITHUB_OUTPUT" fi echo 'EOF' >> "$GITHUB_OUTPUT" + echo "diffusers<> "$GITHUB_OUTPUT" + echo "docker/model-runner:${{ inputs.releaseTag }}-diffusers" >> "$GITHUB_OUTPUT" + if [ "${{ inputs.pushLatest }}" == "true" ]; then + echo "docker/model-runner:latest-diffusers" >> "$GITHUB_OUTPUT" + fi + echo 'EOF' >> "$GITHUB_OUTPUT" echo "rocm<> "$GITHUB_OUTPUT" echo "docker/model-runner:${{ inputs.releaseTag }}-rocm" >> "$GITHUB_OUTPUT" if [ "${{ inputs.pushLatest }}" == "true" ]; then @@ -182,6 +188,19 @@ jobs: provenance: mode=max tags: ${{ steps.tags.outputs.sglang-cuda }} + - name: Build Diffusers image + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 + with: + file: Dockerfile + target: final-diffusers + platforms: linux/amd64, linux/arm64 + build-args: | + "LLAMA_SERVER_VERSION=${{ inputs.llamaServerVersion }}" + push: true + sbom: true + provenance: mode=max + tags: ${{ steps.tags.outputs.diffusers }} + - name: Build ROCm image uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 with: diff --git a/cmd/cli/commands/install-runner.go b/cmd/cli/commands/install-runner.go index c830333c7..dfd9ed4be 100644 --- a/cmd/cli/commands/install-runner.go +++ b/cmd/cli/commands/install-runner.go @@ -13,6 +13,7 @@ import ( gpupkg "github.com/docker/model-runner/cmd/cli/pkg/gpu" "github.com/docker/model-runner/cmd/cli/pkg/standalone" "github.com/docker/model-runner/cmd/cli/pkg/types" + "github.com/docker/model-runner/pkg/inference/backends/diffusers" "github.com/docker/model-runner/pkg/inference/backends/llamacpp" "github.com/docker/model-runner/pkg/inference/backends/vllm" "github.com/spf13/cobra" @@ -26,7 +27,7 @@ const ( // installation will try to reach the model runner while waiting for it to // be ready. installWaitRetryInterval = 500 * time.Millisecond - backendUsage = "Specify backend (" + llamacpp.Name + "|" + vllm.Name + "). Default: " + llamacpp.Name + backendUsage = "Specify backend (" + llamacpp.Name + "|" + vllm.Name + "|" + diffusers.Name + "). Default: " + llamacpp.Name ) // waitForStandaloneRunnerAfterInstall waits for a standalone model runner @@ -316,8 +317,18 @@ func runInstallOrStart(cmd *cobra.Command, opts runnerOptions, debug bool) error } // Validate backend selection - if opts.backend != "" && opts.backend != llamacpp.Name && opts.backend != vllm.Name { - return fmt.Errorf("unknown backend: %q (supported: %s, %s)", opts.backend, llamacpp.Name, vllm.Name) + validBackends := []string{llamacpp.Name, vllm.Name, diffusers.Name} + if opts.backend != "" { + isValid := false + for _, valid := range validBackends { + if opts.backend == valid { + isValid = true + break + } + } + if !isValid { + return fmt.Errorf("unknown backend: %q (supported: %s, %s, %s)", opts.backend, llamacpp.Name, vllm.Name, diffusers.Name) + } } // Validate backend-GPU compatibility diff --git a/cmd/cli/pkg/standalone/controller_image.go b/cmd/cli/pkg/standalone/controller_image.go index d948bdd61..34237519e 100644 --- a/cmd/cli/pkg/standalone/controller_image.go +++ b/cmd/cli/pkg/standalone/controller_image.go @@ -4,6 +4,7 @@ import ( "os" gpupkg "github.com/docker/model-runner/cmd/cli/pkg/gpu" + "github.com/docker/model-runner/pkg/inference/backends/diffusers" "github.com/docker/model-runner/pkg/inference/backends/vllm" ) @@ -32,6 +33,10 @@ func controllerImageVariant(detectedGPU gpupkg.GPUSupport, backend string) strin if backend == vllm.Name { return "vllm-cuda" } + // If diffusers backend is requested, return diffusers variant + if backend == diffusers.Name { + return "diffusers" + } // Default to llama.cpp backend behavior switch detectedGPU { case gpupkg.GPUSupportCUDA: From d66faaca1637d55de0774b159c73de848c9c98fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20L=C3=B3pez=20Luna?= Date: Tue, 20 Jan 2026 13:39:01 +0100 Subject: [PATCH 2/3] feat(docker): update backend options to include diffusers --- cmd/cli/docs/reference/docker_model_install-runner.yaml | 2 +- cmd/cli/docs/reference/docker_model_reinstall-runner.yaml | 2 +- cmd/cli/docs/reference/docker_model_start-runner.yaml | 2 +- cmd/cli/docs/reference/model_install-runner.md | 2 +- cmd/cli/docs/reference/model_reinstall-runner.md | 2 +- cmd/cli/docs/reference/model_start-runner.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/cli/docs/reference/docker_model_install-runner.yaml b/cmd/cli/docs/reference/docker_model_install-runner.yaml index 0da2321c4..71c9e9747 100644 --- a/cmd/cli/docs/reference/docker_model_install-runner.yaml +++ b/cmd/cli/docs/reference/docker_model_install-runner.yaml @@ -8,7 +8,7 @@ plink: docker_model.yaml options: - option: backend value_type: string - description: 'Specify backend (llama.cpp|vllm). Default: llama.cpp' + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' deprecated: false hidden: false experimental: false diff --git a/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml b/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml index 213bf27a9..7a5b819fa 100644 --- a/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml +++ b/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml @@ -8,7 +8,7 @@ plink: docker_model.yaml options: - option: backend value_type: string - description: 'Specify backend (llama.cpp|vllm). Default: llama.cpp' + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' deprecated: false hidden: false experimental: false diff --git a/cmd/cli/docs/reference/docker_model_start-runner.yaml b/cmd/cli/docs/reference/docker_model_start-runner.yaml index 646e055fe..b5018ad92 100644 --- a/cmd/cli/docs/reference/docker_model_start-runner.yaml +++ b/cmd/cli/docs/reference/docker_model_start-runner.yaml @@ -10,7 +10,7 @@ plink: docker_model.yaml options: - option: backend value_type: string - description: 'Specify backend (llama.cpp|vllm). Default: llama.cpp' + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' deprecated: false hidden: false experimental: false diff --git a/cmd/cli/docs/reference/model_install-runner.md b/cmd/cli/docs/reference/model_install-runner.md index eb4ee1b63..ab7c81165 100644 --- a/cmd/cli/docs/reference/model_install-runner.md +++ b/cmd/cli/docs/reference/model_install-runner.md @@ -7,7 +7,7 @@ Install Docker Model Runner (Docker Engine only) | Name | Type | Default | Description | |:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| -| `--backend` | `string` | | Specify backend (llama.cpp\|vllm). Default: llama.cpp | +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | | `--debug` | `bool` | | Enable debug logging | | `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | | `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | diff --git a/cmd/cli/docs/reference/model_reinstall-runner.md b/cmd/cli/docs/reference/model_reinstall-runner.md index e711f7107..74d3b0059 100644 --- a/cmd/cli/docs/reference/model_reinstall-runner.md +++ b/cmd/cli/docs/reference/model_reinstall-runner.md @@ -7,7 +7,7 @@ Reinstall Docker Model Runner (Docker Engine only) | Name | Type | Default | Description | |:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| -| `--backend` | `string` | | Specify backend (llama.cpp\|vllm). Default: llama.cpp | +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | | `--debug` | `bool` | | Enable debug logging | | `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | | `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | diff --git a/cmd/cli/docs/reference/model_start-runner.md b/cmd/cli/docs/reference/model_start-runner.md index 2e43a92c2..d2100fd0d 100644 --- a/cmd/cli/docs/reference/model_start-runner.md +++ b/cmd/cli/docs/reference/model_start-runner.md @@ -7,7 +7,7 @@ Start Docker Model Runner (Docker Engine only) | Name | Type | Default | Description | |:-----------------|:---------|:--------|:-------------------------------------------------------------------------------------------------------| -| `--backend` | `string` | | Specify backend (llama.cpp\|vllm). Default: llama.cpp | +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | | `--debug` | `bool` | | Enable debug logging | | `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | | `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | From 8ba471db0ac4eb28b30be07d4d9ff0660da4ce1a Mon Sep 17 00:00:00 2001 From: Ignasi Date: Tue, 20 Jan 2026 13:44:48 +0100 Subject: [PATCH 3/3] Update cmd/cli/commands/install-runner.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- cmd/cli/commands/install-runner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cli/commands/install-runner.go b/cmd/cli/commands/install-runner.go index dfd9ed4be..1611a8ef8 100644 --- a/cmd/cli/commands/install-runner.go +++ b/cmd/cli/commands/install-runner.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "os" + "strings" "time" "github.com/docker/docker/api/types/container" @@ -327,7 +328,7 @@ func runInstallOrStart(cmd *cobra.Command, opts runnerOptions, debug bool) error } } if !isValid { - return fmt.Errorf("unknown backend: %q (supported: %s, %s, %s)", opts.backend, llamacpp.Name, vllm.Name, diffusers.Name) + return fmt.Errorf("unknown backend: %q (supported: %s)", opts.backend, strings.Join(validBackends, ", ")) } }