# Self-host Stable Diffusion WebUI

> A browser interface for generating and editing images with Stable Diffusion checkpoints.

- Page: https://levelrail.com/templates/stable-diffusion-webui/
- JSON: https://levelrail.com/templates/stable-diffusion-webui.json
- Category: AI
- Licence: AGPL-3.0 (Network copyleft (AGPL) license)
- Source: https://github.com/AUTOMATIC1111/stable-diffusion-webui
- Upstream docs: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki

## Requirements
- Memory: about 8 GiB
- amd64: published, arm64: absent
- Needs configuration before start: no
- Pinned image tag: latest-cuda

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| sd-webui | ghcr.io/ai-dock/stable-diffusion-webui | latest-cuda | 7860 | sd_webui_workspace -> /workspace |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| sd-webui | WEB_ENABLE_AUTH | preset |
| sd-webui | WEB_PASSWORD | generated |
| sd-webui | WEB_USER | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy stable-diffusion-webui --name my-stable-diffusion-webui
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/stable-diffusion-webui/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Stable Diffusion WebUI on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Stable Diffusion WebUI, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/ai-dock/stable-diffusion-webui:latest-cuda is what you deploy there.

Self-host Stable Diffusion WebUI, Stable Diffusion WebUI docker compose file, deploy Stable Diffusion WebUI on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
