Running other diffusion models

Want to explore more than just the original Stable Diffusion model, including various fine-tuned models and other open-source derivatives?

  1. Option 1: Modify the official starter template
    (Only for diffusers models hosted on HuggingFace)

    1. Clone GitHub - bananaml/serverless-template-stable-diffusion
    2. Edit and, search for StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", ...) and replace “CompVis/stable-diffusion-v1-4” with the hugging face model of your choice.
  2. Option 2: With docker-diffusers-api
    (Diffusers models anywhere, Checkpoint (.ckpt) files anywhere)

    1. 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.
    2. In the dashboard, set the build-arg MODEL_ID to any huggingface model ID, or, set it to something arbitrary together with either CHECKPOINT_URL to download a .ckpt file and convert it to diffusers format, or MODEL_URL* to download a tar.zst file containing a diffusers style model that you’ve chosen to host elsewhere (*available in the dev branch).
    3. 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