Run Stable Diffusion 3 with an API on Replicate:
This is an implementation of Stability AI's Stable Diffusion 3 as a Cog model.
Stable Diffusion 3 has a non-commercial license. stability-ai/stable-diffusion-3 on Replicate is licensed and can be used for commercial work, but if you want to use custom versions built from this repository for commercial work, you'll need to buy a commercial license.
This Cog implementation uses ComfyUI and is based on https://github.com/fofr/cog-comfyui. If you prefer to use diffusers, check out our diffusers implementation: https://github.com/replicate/cog-stable-diffusion-3
For a local prediction, run:
cog predict -i prompt="a photo of a cool dog"
The local ComfyUI server is available at http://localhost:8000.
- GPU Machine: Start the Cog container and expose port 8188 so you can access it:
sudo cog run -p 8188 bash
- Inside Cog Container: Now that we have access to the Cog container, we start the server, binding to all network interfaces:
cd ComfyUI/
python main.py --listen 0.0.0.0
- Local Machine: Access the server using your GPU machine's IP and the exposed port (8188):
http://<gpu-ip>:8188
Now if you visit http://<gpu-ip>:8188
you’ll see the classic ComfyUI server. You can load in the workflow_api.json
or workflow_ui.json
file to get started.
You’ll also need a copy of the Stable Diffusion 3 weights.
First get access by filling out the form on the weights page. You’ll need to download sd3_medium_incl_clips_t5xxlfp8.safetensors
to the ComfyUI/models/checkpoints
folder.