Skip to content

lucataco/cog-civitai-sdxl-template

Repository files navigation

Civitai SDXL Safetensor Cog template

This is a template to push a Civitai SDXL model as a Cog model. Cog packages machine learning models as standard containers.

First, get a Civitai SDXL Model URL and download the safetensors file:

wget -O model.safetensors https://civitai.com/api/download/models/154625?type=Model&format=SafeTensor&size=full&fp=fp16

To get the URL, find the safetensors file and select "Copy Link Address" alt text

Then run the script convert to Diffusers, and download weights needed for SDXL (VAE, safety checker):

cog run script/download-weights

Then, you can run predictions:

cog predict -i prompt="An astronaut riding a rainbow unicorn"

And finally push to Replicate:

cog login
cog push r8.im/<Replicate_Username>/<Replicate_Model_name>

Example:

alt text

About

Cog template to deploy any CivitAI model on Replicate

Topics

Resources

Stars

Watchers

Forks

Languages