stable-diffusion-api-server  by cantrell

Local API server for Stable Diffusion inference

Created 3 years ago
361 stars

Top 77.6% 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

Inactive

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Tomas Valenta Tomas Valenta(Cofounder of E2B), and
12 more.

diffusionbee-stable-diffusion-ui by divamgupta

0.1%
13k
GUI app for local Stable Diffusion on MacOS
Created 3 years ago
Updated 10 months ago
Feedback? Help us improve.