Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Docker 7 min read How-to mediumAdept

Generate Images Locally with Docker Model Runner and Open WebUI

Docker Model Runner can now serve diffusion image models locally through an OpenAI-compatible /v1/images/generations endpoint. Paired with Open WebUI, that gives you private, offline image generation from a chat interface. Models are distributed as DDUF single-file artifacts via Docker Hub, `docker model launch openwebui` wires up the UI, and an admin setting points image generation at the diffusers endpoint. The walkthrough also covers calling the API directly with curl, including negative prompts, inference steps, guidance scale and seeds. Under the hood, the backend unpacks the DDUF into a Diffusers pipeline served by a version-pinned FastAPI server.

Related posts

  • How to Build, Run, and Package AI Models Locally with Docker Model Runner

    Docker mediumAdept

    Docker Model Runner, enabled as a beta feature in Docker Desktop 4.40+, pulls GGUF-format LLMs from Docker Hub or Hugging Face and runs them locally via the `docker model` CLI or an OpenAI-compatible HTTP endpoint on localhost. The guide walks through enabling the feature, pulling, tagging and pushing models to a local registry, one-shot and interactive prompts, curl calls to the chat completions API, and packaging your own .gguf file with a license as an OCI artifact. Constraints noted: only GGUF is supported, one model is loaded at a time, and models unload after 5 minutes idle. Compose v2.35+ can declare models as services and inject connection URLs into dependent containers.

  • How to Use Multimodal AI Models With Docker Model Runner

    Docker mediumAdept

    Docker Model Runner can run multimodal models such as Gemma3, Moondream2 and SmolVLM locally, accepting image and audio input through the CLI or an OpenAI-compatible chat completions API on localhost:12434. Images are sent as base64 data URLs in image_url content parts, and audio as input_audio parts. GGUF models like Ultravox can be pulled directly from Hugging Face. Multimodal support comes from a multimodal projector, a small adapter network that converts pixels or audio into token embeddings the language model can read. In Model Runner's OCI model artifacts it ships as a separate layer with media type application/vnd.docker.ai.mmproj.

  • Run LLMs Locally with Docker: A Quickstart Guide to Model Runner

    Docker mediumAdept

    Docker Model Runner, in beta with Docker Desktop 4.40 on Apple silicon, pulls LLMs packaged as OCI artifacts and serves them through an OpenAI-compatible API backed by llama.cpp. Unlike `docker container run`, `docker model run` starts no container. The inference engine runs as a native host process for GPU acceleration, loads models on demand, and unloads them after 5 minutes of inactivity. Containers reach it at model-runner.docker.internal, and host processes can use an optional TCP port (12434), so any OpenAI client such as LangChain4j can point at it by setting a base URL and a model tag of the form {model}:{parameters}-{quantization}.

  • Making a web app generator with open ML models

    Hugging Face mediumAdept

    A Node.js/Express server can generate web apps from a text prompt by streaming tokens from a code LLM (WizardCoder-15B on Hugging Face Inference Endpoints) straight into the browser as HTML. Prompt tuning does most of the work: terse imperative instructions, pre-seeding the output with `<html><body class=...>`, and requiring TailwindCSS so styles arrive inline without a stylesheet that stalls rendering. Image URLs come from a Stable Diffusion `/image` endpoint that the model is told to call. Alpine.js provides a minimal UI, and DaisyUI's shorthand classes cut token usage compared with verbose Tailwind utility classes.

  • Run ComfyUI workflows for free with Gradio on Hugging Face Spaces

    Hugging Face mediumAdept

    A ComfyUI node workflow can be turned into a standalone Gradio app and hosted for free on Hugging Face Spaces' serverless ZeroGPU tier. The steps: export the workflow to Python with ComfyUI-to-Python-Extension, then rewrite its main() into a generate_image function whose hard-coded node values become UI inputs and which returns the saved image path. To prepare for Spaces, fetch the models with hf_hub_download instead of uploading them, wrap inference in the @spaces.GPU decorator, and merge the custom nodes' dependencies into one requirements.txt. Loading models in global scope, outside the decorated function, keeps ZeroGPU from reloading them from disk on every run.

The quest for software engineering knowledge.

Look:
Layout: