You're looking at a specific version of this model. Jump to the model overview.
stability-ai /stable-diffusion:27b93a24
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
{
input: {
width: 512,
height: 512,
prompt: "multicolor hyperspace",
scheduler: "K-LMS",
num_outputs: 1,
guidance_scale: 7.5,
negative_prompt: "green",
prompt_strength: 0.8,
num_inference_steps: 50
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/stable-diffusion:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
input={
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": 1,
"guidance_scale": 7.5,
"negative_prompt": "green",
"prompt_strength": 0.8,
"num_inference_steps": 50
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478",
"input": {
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": 1,
"guidance_scale": 7.5,
"negative_prompt": "green",
"prompt_strength": 0.8,
"num_inference_steps": 50
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/stability-ai/stable-diffusion@sha256:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478 \
-i 'width=512' \
-i 'height=512' \
-i 'prompt="multicolor hyperspace"' \
-i 'scheduler="K-LMS"' \
-i 'num_outputs=1' \
-i 'guidance_scale=7.5' \
-i 'negative_prompt="green"' \
-i 'prompt_strength=0.8' \
-i 'num_inference_steps=50'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/stability-ai/stable-diffusion@sha256:27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "width": 512, "height": 512, "prompt": "multicolor hyperspace", "scheduler": "K-LMS", "num_outputs": 1, "guidance_scale": 7.5, "negative_prompt": "green", "prompt_strength": 0.8, "num_inference_steps": 50 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.0074. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-11-22T23:34:08.104586Z",
"created_at": "2022-11-22T23:34:03.421109Z",
"data_removed": false,
"error": null,
"id": "uu3pugtcofbn3cgac6k4aymef4",
"input": {
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": "1",
"guidance_scale": 7.5,
"negative_prompt": "green",
"prompt_strength": 0.8,
"num_inference_steps": 50
},
"logs": "Using seed: 63632\n 0%| | 0/50 [00:00<?, ?it/s]\n 4%|▍ | 2/50 [00:00<00:03, 13.41it/s]\n 8%|▊ | 4/50 [00:00<00:03, 13.57it/s]\n 12%|█▏ | 6/50 [00:00<00:03, 13.48it/s]\n 16%|█▌ | 8/50 [00:00<00:03, 13.60it/s]\n 20%|██ | 10/50 [00:00<00:02, 13.67it/s]\n 24%|██▍ | 12/50 [00:00<00:02, 13.68it/s]\n 28%|██▊ | 14/50 [00:01<00:02, 13.71it/s]\n 32%|███▏ | 16/50 [00:01<00:02, 13.68it/s]\n 36%|███▌ | 18/50 [00:01<00:02, 13.62it/s]\n 40%|████ | 20/50 [00:01<00:02, 13.47it/s]\n 44%|████▍ | 22/50 [00:01<00:02, 13.56it/s]\n 48%|████▊ | 24/50 [00:01<00:01, 13.62it/s]\n 52%|█████▏ | 26/50 [00:01<00:01, 13.53it/s]\n 56%|█████▌ | 28/50 [00:02<00:01, 13.54it/s]\n 60%|██████ | 30/50 [00:02<00:01, 13.55it/s]\n 64%|██████▍ | 32/50 [00:02<00:01, 13.49it/s]\n 68%|██████▊ | 34/50 [00:02<00:01, 13.46it/s]\n 72%|███████▏ | 36/50 [00:02<00:01, 13.52it/s]\n 76%|███████▌ | 38/50 [00:02<00:00, 13.57it/s]\n 80%|████████ | 40/50 [00:02<00:00, 13.59it/s]\n 84%|████████▍ | 42/50 [00:03<00:00, 13.33it/s]\n 88%|████████▊ | 44/50 [00:03<00:00, 13.40it/s]\n 92%|█████████▏| 46/50 [00:03<00:00, 13.36it/s]\n 96%|█████████▌| 48/50 [00:03<00:00, 13.50it/s]\n100%|██████████| 50/50 [00:03<00:00, 13.57it/s]\n100%|██████████| 50/50 [00:03<00:00, 13.54it/s]",
"metrics": {
"predict_time": 4.647599,
"total_time": 4.683477
},
"output": [
"https://replicate.delivery/pbxt/2zVI7LtEO0aeKSruhERO0PQCVEsbFivhEyXyR0LDMSg3cYBIA/out-0.png"
],
"started_at": "2022-11-22T23:34:03.456987Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/uu3pugtcofbn3cgac6k4aymef4",
"cancel": "https://api.replicate.com/v1/predictions/uu3pugtcofbn3cgac6k4aymef4/cancel"
},
"version": "27b93a2413e7f36cd83da926f3656280b2931564ff050bf9575f1fdf9bcd7478"
}
Using seed: 63632
0%| | 0/50 [00:00<?, ?it/s]
4%|▍ | 2/50 [00:00<00:03, 13.41it/s]
8%|▊ | 4/50 [00:00<00:03, 13.57it/s]
12%|█▏ | 6/50 [00:00<00:03, 13.48it/s]
16%|█▌ | 8/50 [00:00<00:03, 13.60it/s]
20%|██ | 10/50 [00:00<00:02, 13.67it/s]
24%|██▍ | 12/50 [00:00<00:02, 13.68it/s]
28%|██▊ | 14/50 [00:01<00:02, 13.71it/s]
32%|███▏ | 16/50 [00:01<00:02, 13.68it/s]
36%|███▌ | 18/50 [00:01<00:02, 13.62it/s]
40%|████ | 20/50 [00:01<00:02, 13.47it/s]
44%|████▍ | 22/50 [00:01<00:02, 13.56it/s]
48%|████▊ | 24/50 [00:01<00:01, 13.62it/s]
52%|█████▏ | 26/50 [00:01<00:01, 13.53it/s]
56%|█████▌ | 28/50 [00:02<00:01, 13.54it/s]
60%|██████ | 30/50 [00:02<00:01, 13.55it/s]
64%|██████▍ | 32/50 [00:02<00:01, 13.49it/s]
68%|██████▊ | 34/50 [00:02<00:01, 13.46it/s]
72%|███████▏ | 36/50 [00:02<00:01, 13.52it/s]
76%|███████▌ | 38/50 [00:02<00:00, 13.57it/s]
80%|████████ | 40/50 [00:02<00:00, 13.59it/s]
84%|████████▍ | 42/50 [00:03<00:00, 13.33it/s]
88%|████████▊ | 44/50 [00:03<00:00, 13.40it/s]
92%|█████████▏| 46/50 [00:03<00:00, 13.36it/s]
96%|█████████▌| 48/50 [00:03<00:00, 13.50it/s]
100%|██████████| 50/50 [00:03<00:00, 13.57it/s]
100%|██████████| 50/50 [00:03<00:00, 13.54it/s]