Push a custom version of Stable Diffusion 3

📰 Replicate Blog

Push a custom version of Stable Diffusion 3 on Replicate with Cog and Docker

intermediate Published 14 Jun 2024
Action Steps
  1. Create a model on Replicate
  2. Install Cog
  3. Clone the SD3 repository
  4. Build and push the model with Cog
Who Needs to Know This

AI engineers and researchers can benefit from this guide to create and deploy custom models, while product managers can understand the capabilities of Stable Diffusion 3

Key Insight

💡 Stable Diffusion 3 can be customized and deployed on Replicate using Cog and Docker

Share This
🤖 Deploy custom Stable Diffusion 3 models on Replicate with Cog and Docker! 💻

Key Takeaways

Push a custom version of Stable Diffusion 3 on Replicate with Cog and Docker

Full Article

# Push a custom version of Stable Diffusion 3 – Replicate blog

[Replicate has joined Cloudflare](https://replicate.com/blog/replicate-cloudflare)

[](https://replicate.com/)

cmd+k

[Explore](https://replicate.com/explore)[Pricing](https://replicate.com/pricing)[Enterprise](https://replicate.com/enterprise)[Docs](https://replicate.com/docs)[Blog](https://replicate.com/blog)[Sign in](https://replicate.com/signin)[Try for free](https://replicate.com/signin)

Menu

[Explore](https://replicate.com/explore)[Pricing](https://replicate.com/pricing)[Enterprise](https://replicate.com/enterprise)[Docs](https://replicate.com/docs)[Blog](https://replicate.com/blog)[Sign in](https://replicate.com/signin)[Try for free](https://replicate.com/signin)

* * *

[Compare models in the Playground](https://replicate.com/playground)

* Replicate
* [Blog](https://replicate.com/blog)

# Push a custom version of Stable Diffusion 3

Posted June 14, 2024 by
* [zeke](https://replicate.com/zeke)

When the first version of Stable Diffusion appeared back in August 2022, there was an explosion of innovation around it. In a matter of days after its release, the open-source community created lots of compelling derivatives, like the [material diffusion models](https://replicate.com/search?query=material) which generated tiling images, the [inpainting models](https://replicate.com/guides/stable-diffusion/inpainting) that gave you an AI paintbrush, and [animation models](https://replicate.com/andreasjansson/stable-diffusion-animation) that could interpolate between prompts.

Fast forward nearly two years, and [Stable Diffusion 3 (SD3)](https://replicate.com/stability-ai/stable-diffusion-3) just came out this week. [People are hyped](https://x.com/fofrai/status/1795575555575705097) about the capabilities of this new model, and we expect to see a lot of the same open-source innovation we saw in Stable Diffusion’s early days.

In this post, we’ll show you how to get your own custom version of Stable Diffusion 3 running on Replicate.

## [](https://replicate.com/blog/push-a-custom-sd3#prerequisites)Prerequisites

To follow this guide, you’ll need:

* **Git** You’ll need Git to clone the [cog-stable-diffusion-3](https://github.com/replicate/cog-stable-diffusion-3) repository.
* **Docker.** You’ll be using the Cog command-line tool to build and push your model. Cog uses Docker to create a container for your model. You’ll need to [install and start Docker](https://docs.docker.com/get-docker/) before you can run Cog. You can confirm Docker is running by typing `docker info` in your terminal.
* **An account on Replicate.**

## [](https://replicate.com/blog/push-a-custom-sd3#step-0-create-your-model-on-replicate)Step 0: Create your model on Replicate

Start off by creating a page for your model on Replicate. Visit [replicate.com/create](https://replicate.com/create) and you’ll see a form to create the model.

Create the model under your personal account, or in an [organization](https://replicate.com/docs/how-does-replicate-work#organizations) if you want to share access to the model with your team. Choose the username or organization from top left corner of the screen.

Choose a name for your model, set the hardware to “GPU A40 Small”, and click **Create**.

Your model will be private by default, but you can make it public at any time, even after you create it.

## [](https://replicate.com/blog/push-a-custom-sd3#step-1-install-cog)Step 1: Install Cog

Next, you’ll use [Cog](https://cog.run/) to package SD3 and push it to Replicate. Cog is an open-source tool that makes it easy to put a machine learning model in a Docker container.

Run the following command to install Cog:

Copy

```
sudo curl -o /usr/local/bin/cog -L https://github.com/replicate/cog/releases/latest/download/cog_`uname -s`_`uname -m`
sudo chmod +x /usr/local/bin/cog
```

## [](https://replicate.com/blog/push-a-custom-sd3#step-2-clone-the-sd3-repository)Step 2: Clone the SD3 repository

Next,
Read full article → ← Back to Reads