Skip to content

An API specifically for SDXL txt2img, img2img, and inpainting utilizing Diffusers. It is setup to run locally in its current form and I have kept it as clean and minimal as possible. I personally only need this for SDXL but adding support for other pipelines wouldn't be too difficult.

Notifications You must be signed in to change notification settings

zacheryvaughn/sdxl-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDXL API

Super Simple Implementation of the SDXL Pipelines from Diffusers as an API.

Python 3.8+ FastAPI License: MIT

A high-performance, memory-efficient API for Stable Diffusion XL operations. Built for production use with zero file storage and automatic resource cleanup.

Features

  • 🚀 Memory-efficient operation with zero file storage
  • 🎨 Support for text-to-image, image-to-image, and inpainting
  • 🔧 Multiple scheduler options
  • 📦 LoRA model integration
  • 🔄 Automatic device selection (CUDA/MPS/CPU)
  • 🧹 Aggressive memory cleanup
  • 🛡️ Production-ready error handling

For MacOS Silicon (M1/M2) users:

# As of the time of posting this README, Mac Silicone users should use this Nightly version of Torch for FP16 support on MPS.
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu

The server will start on http://localhost:8000 by default.

Memory Management

The API is designed for long-running deployments with:

  • Zero file storage
  • Automatic cache clearing
  • Aggressive memory cleanup
  • Resource monitoring

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

An API specifically for SDXL txt2img, img2img, and inpainting utilizing Diffusers. It is setup to run locally in its current form and I have kept it as clean and minimal as possible. I personally only need this for SDXL but adding support for other pipelines wouldn't be too difficult.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages