Skip to content

Dvorson/mac_m1_coreml_stable_diffusion_flask_api

Repository files navigation


API server for CoreMl Stable Diffusion

This is Stable Diffusion CoreML version, working on Mac M series processors with Flask API
The original implementation of CoreML Stable Diffusion by Apple

· Report Bug · Request Feature

Table of Contents
  1. Getting Started
  2. Usage

Getting Started

Prerequisites

First you need to download a model with download_model.py

python3 download_model.py

If you choose non-default model - make sure that model_version, repo_id and mlpackages_dir match between download_model.py and flask_api.py More on models in the original docs

Installation

  1. Clone the repo

    git clone https://github.com/dvorson/mac_m1_coreml_stable_diffusion_flask_api.git
  2. Create virtual env

    python3 -m venv /path/to/new/virtual/environment
  3. Install python packages

    pip3 install -r requirements.txt

(back to top)

Usage

When a server is up, send a POST request to localhost:3000/app/inference with the prompt payload:

{
    "prompt": "a painting of a spaceship by basquiat, intricate detail"
}

(back to top)

About

API server for CoreMl Stable Diffusion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages