Cog template to deploy any SD models as an inference API endpoint with the capabilities of SD WebUI, such as:
- Hires. fix
- Samplers
- Scripts
- All compatible extensions (e.g. ADetailer, ControlNet)
Put the model file (ckpt, safetensors, pth, etc.) into the model
directory. Make sure there is only one model file in the directory. For instance:
wget --content-disposition -P model https://civitai.com/api/download/models/176425
Execute the command below to deploy your model to Replicate.
cog push r8.im/${YOUR_MODEL_ID}
If you prefer to deploy to other private Docker registry, run the following command to build the image:
cog build -t ${IMAGE_TAG_FOR_PRIVATE_REGISTRY}
Then run docker push
to deploy.
Since the entire SD WebUI will be packaged into the image, you can utilize all functions provided by SD WebUI and it's extensions.
As you can see in cog.yaml
file, we've built-in ADetailer in this repo, you can achieve the same thing by adding extra scripts to bundle embedings, Lora, extensions into your image.