stable-diffusion-docker  by fboulnois

Docker container for Stable Diffusion

created 2 years ago
750 stars

Top 47.3% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a Dockerized environment for running official Stable Diffusion models, enabling users to generate images from text (txt2img) and modify existing images (img2img, depth2img, pix2pix, inpaint, upscale4x). It targets users who want a straightforward, GPU-accelerated way to leverage Stable Diffusion without complex local setup, offering flexibility in model selection and generation parameters.

How It Works

The project utilizes a build.sh script to manage Docker image building and execution. It pulls official Stable Diffusion models from Hugging Face, requiring a Hugging Face user access token. The script mounts local directories for input images and output PNGs, and uses Docker volumes for caching downloaded models. This approach simplifies dependency management and ensures consistent execution across different environments.

Quick Start & Requirements

  • Install/Run: ./build.sh pull then ./build.sh run [PROMPT]
  • Prerequisites: CUDA-capable GPU with 8GB+ VRAM (or --device cpu --onnx for CPU inference), Hugging Face user access token (saved in token.txt or provided via --token).
  • Setup: Minimal, primarily involves obtaining a Hugging Face token.
  • Docs: README

Highlighted Details

  • Supports multiple Stable Diffusion models including SDXL and specialized variants like Instruct-Pix2Pix and Upscalers.
  • Offers fine-grained control over generation parameters (seed, steps, scale, scheduler, attention slicing, VAE slicing/tiling).
  • Includes options for memory optimization (--half, --attention-slicing, --xformers-memory-efficient-attention) for lower-VRAM GPUs.

Maintenance & Community

No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

The repository itself appears to be under an unspecified license, but it facilitates the use of Stable Diffusion models, which are subject to Hugging Face's terms of service and individual model licenses. Compatibility for commercial use depends on the underlying models used.

Limitations & Caveats

The README notes that less powerful GPUs may require specific optimizations or CPU fallback. Some memory-saving options like --xformers-memory-efficient-attention have hardware/pipeline support dependencies.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 90 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers), Julien Chaumond Julien Chaumond(Cofounder of Hugging Face), and
1 more.

parallelformers by tunib-ai

0%
790
Toolkit for easy model parallelization
created 4 years ago
updated 2 years ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Anil Dash Anil Dash(Former CEO of Glitch), and
8 more.

diffusionbee-stable-diffusion-ui by divamgupta

0.1%
13k
GUI app for local Stable Diffusion on MacOS
created 2 years ago
updated 9 months ago
Feedback? Help us improve.