Skip to content

Latest commit

 

History

History
 
 

cog_example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Stable Diffusion v2 Example Using Cog

This is an example of creating a RunPod serverless worker for Stable Diffusion v2 using cog-stable-diffusion as the base.

Stable Diffusion v2 Cog model

This is an implementation of the Diffusers Stable Diffusion v2.1 as a Cog model. Cog packages machine learning models as standard containers.

First, download the pre-trained weights:

cog run script/download-weights

Then, you can run predictions:

cog predict -i prompt="monkey scuba diving"

RunPod Serverless Worker Changes

These are the changes made to the base repo.

  • cog.yaml - Add runpod as a dependency
  • Add runpod_infer.py file - This defines how the worker interacts with your model, the file name is arbitrary.