Runs AUTOMATIC1111 Stable Diffusion WebUI in a Docker container for local AI image generation. Compatible with Windows + WSL2 on both AMD and NVIDIA GPUs.
This WebUI is powered by AUTOMATIC1111 Stable Diffusion WebUI. For the full list of supported model formats and architectures, refer to the AUTOMATIC1111 repository.
Place .safetensors or .ckpt model files in the sd_models Docker volume, or download them through the WebUI.
The CPU Docker image ships with two SD 1.5-based checkpoints so you can start generating immediately:
| Model | Style | Size |
|---|---|---|
deliberate_v2 |
Photorealistic | ~2 GB — high quality portraits and scenes |
dreamshaper_8 |
Versatile | ~2 GB — good at both artistic and photorealistic |
- Docker with Compose v2 (
docker compose) - At least 8 GB RAM (16 GB+ recommended)
- At least 20 GB free disk space
- Update WSL kernel:
wsl --update - Install NVIDIA driver ≥525 on Windows from nvidia.com/drivers
- Inside WSL2, run the included setup script to install the NVIDIA Container Toolkit and configure Docker:
(See ollama/README.md for the manual installation steps.)
chmod +x scripts/setup-wsl-nvidia.sh ./scripts/setup-wsl-nvidia.sh
- Minimum 4 GB VRAM (6 GB+ recommended)
- Update WSL kernel to 5.15+:
wsl --update - Install ROCm 6.x inside WSL2 using the included setup script:
Or follow the ROCm installation guide manually.
chmod +x scripts/setup-wsl-amd.sh ./scripts/setup-wsl-amd.sh
- Add your user to
renderandvideogroups (the script does this automatically):sudo usermod -aG render,video $USER - Supported GPUs: RX 6000/7000 series (gfx1030+), Instinct MI series — check the AMD ROCm compatibility matrix
No additional prerequisites beyond Docker. The compose file sets the OpenVINO-compatible flags automatically:
--skip-torch-cuda-test— bypasses the GPU detection that would otherwise prevent startup on CPU-only hosts--precision full --no-half— disables half-precision arithmetic, required for CPU inferencePYTORCH_TRACING_MODE=TORCHFX— enables OpenVINO acceleration viatorch.compile--enable-insecure-extension-access— allows WebUI extensions broader access to internal APIs; this is enabled for compatibility with common extensions and assumes you are running on a trusted local network and not exposing the WebUI directly to the internet
Note: Image generation on CPU is very slow (minutes per image). This mode is intended for testing the interface or on Intel CPU-only machines. See the Intel Silicon installation guide for more details.
docker compose -f docker-compose.nvidia.yml up -ddocker compose -f docker-compose.amd.yml up -ddocker compose -f docker-compose.cpu.yml up -dOpen http://localhost:7860 in your browser.
Download model files from Hugging Face or CivitAI and copy them into the Docker volume:
# Find the volume mount path
docker volume inspect thinkexponential-ailab-stable-diffusion_sd_models
# Or copy a model file directly into the container
docker cp my-model.safetensors stable-diffusion-webui:/app/stable-diffusion-webui/models/Stable-diffusion/After copying, click Refresh in the WebUI model selector.
The sd_models Docker volume mounts to models/Stable-diffusion/ inside the container.
You can add models without rebuilding:
# Download from Hugging Face (example: Realistic Vision v5.1)
docker exec stable-diffusion-webui curl -L -o models/Stable-diffusion/realisticVision_v51.safetensors \
"https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE/resolve/main/Realistic_Vision_V5.1_fp16-no-ema.safetensors"
# Or copy a local file into the running container
docker cp my-model.safetensors stable-diffusion-webui:/app/stable-diffusion-webui/models/Stable-diffusion/After adding a model, click 🔄 Refresh next to the checkpoint dropdown in the WebUI (no restart needed).
- Select "Accelerate with OpenVINO" from the Script dropdown at the bottom of the txt2img / img2img tab
- Set OpenVINO Device to
CPUin the script options - Use a better model — select
deliberate_v2ordreamshaper_8via the checkpoint dropdown (top-left) - Recommended settings:
- Steps: 20–30 (more steps = better quality but slower)
- Sampler: DPM++ 2M Karras or Euler a
- CFG Scale: 7
- Resolution: 512×512 (SD 1.5 models) or 768×768 max
- First inference is slow (~2-5 min) because OpenVINO compiles the model. Subsequent runs with the same resolution/settings are much faster due to caching
- Use descriptive prompts:
photo of a golden retriever in a sunlit meadow, shallow depth of field, professional photography, 8k, highly detailed - Use negative prompts to avoid common artifacts:
blurry, low quality, deformed, ugly, bad anatomy, watermark, text
The WebUI exposes a REST API at http://localhost:7860/sdapi/v1/:
curl -X POST http://localhost:7860/sdapi/v1/txt2img \
-H "Content-Type: application/json" \
-d '{"prompt": "a beautiful sunset over mountains", "steps": 20}'docker compose -f docker-compose.nvidia.yml down # stop and remove containers
docker compose -f docker-compose.nvidia.yml down -v # also remove volumes (model data)