GPU-enabled Dockerfile for Stable Diffusion v2 with web UI
Top 77.7% on sourcepulse
This repository provides a Dockerized environment for running Stability.AI's Stable Diffusion v2 model, targeting artists and designers with limited coding experience. It simplifies the setup and execution of image generation tasks, including text-to-image, image-to-image, and inpainting, with an integrated web UI.
How It Works
The project leverages Docker and NVIDIA Container Toolkit to create a self-contained, GPU-accelerated environment. It utilizes the diffusers
library from Hugging Face to load and run Stable Diffusion models. The architecture supports multi-GPU inference through a "Data Parallel" approach, replicating the model across available GPUs to increase throughput. Users can configure FP16 (half-precision) for reduced memory usage or FP32 (single-precision) for potentially higher accuracy.
Quick Start & Requirements
docker run --name stable-diffusion --pull=always --gpus all -it -p 7860:7860 nicklucche/stable-diffusion
Highlighted Details
-e DEVICES=0,1
or -e DEVICES=all
).MODEL_ID
environment variable.-v /path/to/cache:/root/.cache/huggingface/diffusers
).Maintenance & Community
The project appears to be a personal effort with a TODO list indicating planned features. No specific community channels or active contributor information are listed in the README.
Licensing & Compatibility
The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
Model Parallelism is currently disabled. The project is primarily tested on Ubuntu 20.04 and Windows 10 21H2. Performance may vary based on GPU memory distribution in multi-GPU setups.
1 year ago
1 day