Using custom checkpoint (.ckpt) files

Diffusers-based repos (recommended):

  • Option 1: Use this script to convert to diffusers format:

    $ # Run the command with no arguments to see all options.
    $ convert_original_stable_diffusion_to_diffusers.py --checkpoint_path 
    YOURFILE.ckpt --dump_path MODEL_NAME
    

    Put the resulting MODEL_NAME directory in your repo, and use it as the model name, e.g.

    model = pipeline.from_pretrained(MODEL_NAME, ...)
    
  • Option2: Use docker-diffusers-api repo, that can do this all for you automatically at build time, by giving it a CHECKPOINT_URL either in the Dockerfile, or via build args on the banana dashboard.

CompVis based Repos

Simply use the checkpoint file as your model.ckpt instead of e.g. sd-v1-4.ckpt.

There’s an example in docker-compvis-stable-diffusion-api, but this repo is more of a proof-of-concept and all the real work is happening around diffusers.

Other Notes

Not clear? Other methods? Reply with your questions and feedback and we’ll improve the notes above.