Skip to main content

An implementation of a server for the Stability AI API

Installation

Option 1 (recommended):

Install Miniconda, then in a Conda console:

git clone https://github.com/hafriedlander/stable-diffusion-grpcserver.git
cd stable-diffusion-grpcserver
conda env create -f environment.yaml
conda activate sd-grpc-server
sets HF_API_TOKEN={your huggingface token}
python ./server.py

Option 2:

PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu116 pip install stable-diffusion-grpcserver
set HF_API_TOKEN={your huggingface token} 
sdgrpcserver

Features

  • Txt2Img and Img2Img from Stability-AI/Stability-SDK, specifying a prompt
  • Can load multiple pipelines, such as Stable and Waifu Diffusion, and swap between them as needed
  • Mid and Low VRAM modes for larger generated images at the expense of some performance
  • Adjustable NSFW behaviour
  • Significantly enhanced masked painting:
    • When Strength < 1, uses normal diffusers inpainting (with improved mask gradient handling)
    • When Strength >= 1 and <= 2, uses seamless outpainting algorithm. Strength above 1 acts as a boost - the higher the value, the more even areas protected by a mask are allowed to change
  • Euler, Euler_A samplers are currently integrated, and DDIM accepts an ETA parameter
  • Cancel over API (using GRPC cancel will abort the currently in progress generation)
  • Negative prompting (send a Prompt object with text and a negative weight)

Thanks to / Credits:

Roadmap

Core API functions not working yet:

  • Some samplers (like dpm2) are not currently supported in Diffusers
  • ChainGenerate not implemented

Extra features to add

Metadata

Release files for stable-diffusion-grpcserver 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stable-diffusion-grpcserver 0.0.1
File Size Uploaded
stable-diffusion-grpcserver-0.0.1.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for stable-diffusion-grpcserver 0.0.1
File Interpreter ABI Platform
stable_diffusion_grpcserver-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 1.9 MB

Release files / stable-diffusion-grpcserver-0.0.1.tar.gz

Download URL stable-diffusion-grpcserver-0.0.1.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
97c586d37acc143f23c24c45757e546bad20739adda9b80ad188aa7da22c2509
BLAKE2b-256 checksum
How to use checksums
c92ddde6137942422eca7907a7737e73407117f0510d9fd8ed46d29f1b07c981
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / stable_diffusion_grpcserver-0.0.1-py2.py3-none-any.whl

Download URL stable_diffusion_grpcserver-0.0.1-py2.py3-none-any.whl
Size 61.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
21d1cc0430428f6acccd0081ed310c34df895099428f18c269412e90f036a4e2
BLAKE2b-256 checksum
How to use checksums
12bfc8c496659e09978dc67e40a7565865133385baf151c6ba583b5a6904c378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page