https://github.com/trinitronx/docker-rocm-stable-diffusion-webui
ROCm stable-diffusion-webui in Docker
https://github.com/trinitronx/docker-rocm-stable-diffusion-webui
Last synced: 4 months ago
JSON representation
ROCm stable-diffusion-webui in Docker
- Host: GitHub
- URL: https://github.com/trinitronx/docker-rocm-stable-diffusion-webui
- Owner: trinitronx
- License: agpl-3.0
- Created: 2025-07-10T12:31:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-19T18:35:18.000Z (10 months ago)
- Last Synced: 2025-10-04T09:52:53.606Z (8 months ago)
- Language: Dockerfile
- Size: 49.8 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ROCm-enabled Stable Diffusion WebUI in Docker
A Dockerized implementation of [AUTOMATIC1111's Stable Diffusion WebUI][1] with AMD
ROCm 6.4.1 and PyTorch 2.7.1 support.
## Prerequisites
- AMD GPU with ROCm 6.4.1 [supported hardware][2]
- This project built & tested with AMD Radeon RX 7900 XTX
- `Navi 31`
- RDNA3
- `vendor:device` ID: `1002:744c`
- LLVM target: `gfx1100`
- See [compatibility matrix][3] for specific ROCm version & LLVM target
support
- Docker installed
- [`amdgpu` Kernel drivers for ROCm][4]
- GPU firmware `linux-firmware-amdgpu`
- GNU Make 4.0+
- 100GiB free disk space for Docker image
- 10GiB+ extra disk space for models
## Quick Start
During build & run steps, the `AUTOMATIC1111/stable-diffusion-webui` project
will need to download some large files & models from HuggingFace on the first
run. It's recommended to generate a HuggingFace token to avoid rate limits.
Before running either of the commands below, set the `HF_TOKEN` variable to use
your token.
```shell
export HF_TOKEN='hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' # <- your token here
```
### Build the Docker Image
```shell
make build
```
### Run the Container
```shell
make run
```
The WebUI will be available at: [http://localhost:7860](http://localhost:7860)
## Sponsor
If you find this project useful and appreciate my work,
would you be willing to click one of the buttons below to Sponsor this project
and help me continue?
| Method | Button |
| :----------- | :----------------------------------------------------------------------------------------------------------------------------------: |
| GitHub | [](https://github.com/sponsors/trinitronx) |
| Liberapay | [](https://liberapay.com/trinitronx/donate) |
| PayPal | [](https://paypal.me/JamesCuzella) |
| Ko-Fi | [](https://ko-fi.com/trinitronx) |
| BuyMeACoffee | [](https://www.buymeacoffee.com/TrinitronX) |
| Polar | [](https://polar.sh/lyraphase) |
| Patreon (_my artist page_) | [](https://www.patreon.com/bePatron?u=16585899) |
Every little bit is appreciated! Thank you! 🙏
## Project Structure
Key directories:
- `data/`: Persistent storage for:
- Models (`models/Stable-diffusion`)
- Extensions (`extensions/`)
- Configuration files (`config.json`, `ui-config.json`)
- Logs (`log/`)
- Output image files (`outputs/`)
- Last used prompt & parameters (`params.txt`)
- Localization & translation files (`localizations`)
- Cache files (`cache`)
- Temporary files (`tmp`)
- `bin/`: Contains build/run scripts
- `patches/`: Custom patches applied during build
## Data Persistence
Your models and configurations persist in:
```shell
./data/
├── models/ # Put models here (.ckpt, .safetensors)
├── extensions/ # WebUI extensions (drag-and-drop folders)
└── config.json # WebUI config (generated on first run)
```
## Customization
### Modify settings in Web UI
1. Run the container once
- A default config is generated under `data/config.json`
2. Open Web UI in a browser & navigate to Settings
3. Change any desired settings
4. Settings are saved to `data/config.json`
### Modify settings manually
1. Run the container once to generate default config
2. Edit `data/config.json`
3. Restart container with `make run`
**Port customization:** Edit the port for the `make run` command:
```bash
# Change first number to host port
docker run -it -p 8080:7860/tcp --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
# ... SNIP ...
```
## Troubleshooting
### Common issues
- **Port conflict**: Change host port in `make run` script
- **Permission issues**: Add your user to groups and/or fix permissions
- Ensure your user has access to `/dev/kfd` & `/dev/dri/*` devices (e.g. `video`, `render` groups + `udev` `TAG+="uaccess"` rules)
- Ensure your user has write access to `data/` directory
- Ensure your user has access to capability `SYS_PTRACE` & to run `seccomp=unconfined` containers.
- **GPU detection**: Verify ROCm installation with `rocminfo`
- **Missing models**:
- Place base models in `data/models/Stable-diffusion/`
- Place LoRA models in `data/models/Lora/`
- Place VAE models in `data/models/VAE/`
- Place ESRGAN models in `data/models/ESRGAN/`
- Place GFPGAN models in `data/models/GFPGAN/`
- Place CodeFormer models in `data/models/Codeformer/`
- Place ControlNet models in `data/models/ControlNet/`
- Place DeepDanbooru tagging classifier in `data/models/deepbooru/`
- Place fine-tuning hypernetworks in `data/models/hypernetworks/`
- Place karlo base models in `data/models/karlo/`
- **Installing Extensions**:
- Place extensions as sub-directories in `data/extensions/`
- For example: `data/extensions/sd-webui-controlnet`
**View container logs:**
Find the name or ID of the running container with `docker ps`, then run:
```shell
docker logs -f $CONTAINER_ID_OR_NAME
```
## License
AGPLv3 License - See [LICENSE](LICENSE) file
[1]: https://github.com/AUTOMATIC1111/stable-diffusion-webui
"AUTOMATIC1111/stable-diffusion-webui"
[2]: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html#supported-gpus
"AMD ROCm: Supported Hardware"
[3]: https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html#compatibility-matrix
"AMD ROCm: Compatibility matrix"
[4]: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html#running-rocm-docker-containers
"AMD ROCm: Running ROCm Docker containers"