stable-diffusion-api-server  by cantrell

Local API server for Stable Diffusion inference

created 2 years ago
360 stars

Top 78.9% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a local REST API server for Stable Diffusion, enabling programmatic image generation and integration with tools like the Stable Diffusion Photoshop plugin. It targets users who want to run Stable Diffusion inference locally, offering flexibility for custom fine-tuned models and direct API access for various applications.

How It Works

The server leverages the Hugging Face diffusers library to load and run Stable Diffusion models. It supports automatic downloading of weights from Hugging Face and can load custom fine-tuned models in the diffusers format. The architecture is designed for ease of use, with a straightforward API for text-to-image, image-to-image, and masking operations, all accessible via standard HTTP requests.

Quick Start & Requirements

  • Install: Use Conda to create and activate an environment (conda env create -f environment.yaml or environment-m1.yaml for M1 Macs).
  • Prerequisites: Python, Conda, Hugging Face account (email/username agreement and a read-only token). NVIDIA GPU recommended for Linux/Windows; M1 Mac support is experimental via MPS.
  • Configuration: Requires setting up a Hugging Face token in config.json.
  • Run: python3 server.py
  • Docs: README

Highlighted Details

  • Supports custom fine-tuned models (e.g., DreamBooth) in Hugging Face diffusers format.
  • Offers endpoints for txt2img, img2img, and masking operations.
  • Allows defining custom model endpoints via config.json.
  • Includes a content safety filter.

Maintenance & Community

No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned 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

M1 Mac support via MPS is experimental and may require nightly PyTorch builds or specific environment variables. Direct loading of .ckpt checkpoint files is not supported, requiring conversion to the diffusers format. Performance is best on a dedicated Linux machine.

Health Check
Last commit

2 years ago

Responsiveness

1 day

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

Explore Similar Projects

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
2 more.

mflux by filipstrand

0.7%
2k
MLX port of FLUX for local image generation on Macs
created 11 months ago
updated 18 hours 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
Starred by Max Howell Max Howell(Author of Homebrew) and Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers).

kohya_ss by bmaltais

0.2%
11k
GUI for Stable Diffusion training scripts
created 2 years ago
updated 1 week ago
Feedback? Help us improve.