stable-diffusion-docker  by fboulnois

Docker container for Stable Diffusion

Created 3 years ago
749 stars

Top 46.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

Inactive

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

Explore Similar Projects

Starred by Chaoyu Yang Chaoyu Yang(Founder of Bento), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
3 more.

nunchaku by nunchaku-tech

1.9%
3k
High-performance 4-bit diffusion model inference engine
Created 10 months ago
Updated 2 days ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Georgios Konstantopoulos Georgios Konstantopoulos(CTO, General Partner at Paradigm), and
15 more.

ThunderKittens by HazyResearch

0.6%
3k
CUDA kernel framework for fast deep learning primitives
Created 1 year ago
Updated 3 days ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Clement Delangue Clement Delangue(Cofounder of Hugging Face), and
58 more.

vllm by vllm-project

1.1%
58k
LLM serving engine for high-throughput, memory-efficient inference
Created 2 years ago
Updated 15 hours ago
Feedback? Help us improve.