Want to explore more than just the original Stable Diffusion model, including various fine-tuned models and other open-source derivatives?
-
Option 1: Modify the official starter template
(Only for diffusers models hosted on HuggingFace)- Clone GitHub - bananaml/serverless-template-stable-diffusion
- Edit
download.py
andapp.py
, search forStableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", ...)
and replace “CompVis/stable-diffusion-v1-4” with the hugging face model of your choice.
-
Option 2: With docker-diffusers-api
(Diffusers models anywhere, Checkpoint (.ckpt) files anywhere)- Fork GitHub - kiri-art/docker-diffusers-api: Diffusers / Stable Diffusion in docker with a REST API, supporting various models, pipelines & schedulers. and add to banana.
- In the dashboard, set the build-arg
MODEL_ID
to any huggingface model ID, or, set it to something arbitrary together with eitherCHECKPOINT_URL
to download a.ckpt
file and convert it to diffusers format, orMODEL_URL
* to download a tar.zst file containing a diffusers style model that you’ve chosen to host elsewhere (*available in the dev branch). - There’s a dedicated forum for help with docker-diffusers-api!
-
Option 3: By hand
-
Diffusers Model: the way diffusers it built, if you place the entire model in a directory with the same name as your
model_id
, it will read it from disk before checking if it exists on HuggingFace.model = StableDiffusionPipeline.from_pretrained(model_id)
-
Checkpoint File: See Using custom checkpoint (.ckpt) files
-