Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
stability-ai /stable-diffusion:5b703f0f
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:5b703f0fa41880f918ab1b12c88a25b468c18639be17515259fb66a83f4ad0a4",
{
input: {
width: 512,
height: 512,
prompt: "multicolor hyperspace",
scheduler: "K-LMS",
num_outputs: 1,
guidance_scale: 7.5,
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:5b703f0fa41880f918ab1b12c88a25b468c18639be17515259fb66a83f4ad0a4",
input={
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": 1,
"guidance_scale": 7.5,
"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": "5b703f0fa41880f918ab1b12c88a25b468c18639be17515259fb66a83f4ad0a4",
"input": {
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": 1,
"guidance_scale": 7.5,
"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.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-10-28T14:10:01.303206Z",
"created_at": "2022-10-28T14:09:57.451115Z",
"data_removed": false,
"error": null,
"id": "kmp3c6s2kjdqtboq22pyokrksi",
"input": {
"width": 512,
"height": 512,
"prompt": "multicolor hyperspace",
"scheduler": "K-LMS",
"num_outputs": "1",
"guidance_scale": 7.5,
"prompt_strength": 0.8,
"num_inference_steps": 50
},
"logs": "Using seed: 33234\n\n0it [00:00, ?it/s]\n2it [00:00, 13.23it/s]\n4it [00:00, 13.24it/s]\n6it [00:00, 13.82it/s]\n8it [00:00, 14.17it/s]\n10it [00:00, 14.39it/s]\n12it [00:00, 14.55it/s]\n14it [00:00, 14.65it/s]\n16it [00:01, 14.63it/s]\n18it [00:01, 14.68it/s]\n20it [00:01, 14.71it/s]\n22it [00:01, 14.65it/s]\n24it [00:01, 14.65it/s]\n26it [00:01, 14.68it/s]\n28it [00:01, 14.06it/s]\n30it [00:02, 14.37it/s]\n32it [00:02, 14.52it/s]\n34it [00:02, 14.62it/s]\n36it [00:02, 14.68it/s]\n38it [00:02, 14.67it/s]\n40it [00:02, 14.72it/s]\n42it [00:02, 14.71it/s]\n44it [00:03, 14.74it/s]\n46it [00:03, 14.73it/s]\n48it [00:03, 14.71it/s]\n50it [00:03, 14.67it/s]\n50it [00:03, 14.53it/s]",
"metrics": {
"predict_time": 3.810126,
"total_time": 3.852091
},
"output": [
"https://replicate.delivery/pbxt/AE5fg6Nbehm5fIkWbIVNsrK1jUEqRr8btVZwoQSEgMemLlpfB/out-0.png"
],
"started_at": "2022-10-28T14:09:57.493080Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/kmp3c6s2kjdqtboq22pyokrksi",
"cancel": "https://api.replicate.com/v1/predictions/kmp3c6s2kjdqtboq22pyokrksi/cancel"
},
"version": "5b703f0fa41880f918ab1b12c88a25b468c18639be17515259fb66a83f4ad0a4"
}
Using seed: 33234
0it [00:00, ?it/s]
2it [00:00, 13.23it/s]
4it [00:00, 13.24it/s]
6it [00:00, 13.82it/s]
8it [00:00, 14.17it/s]
10it [00:00, 14.39it/s]
12it [00:00, 14.55it/s]
14it [00:00, 14.65it/s]
16it [00:01, 14.63it/s]
18it [00:01, 14.68it/s]
20it [00:01, 14.71it/s]
22it [00:01, 14.65it/s]
24it [00:01, 14.65it/s]
26it [00:01, 14.68it/s]
28it [00:01, 14.06it/s]
30it [00:02, 14.37it/s]
32it [00:02, 14.52it/s]
34it [00:02, 14.62it/s]
36it [00:02, 14.68it/s]
38it [00:02, 14.67it/s]
40it [00:02, 14.72it/s]
42it [00:02, 14.71it/s]
44it [00:03, 14.74it/s]
46it [00:03, 14.73it/s]
48it [00:03, 14.71it/s]
50it [00:03, 14.67it/s]
50it [00:03, 14.53it/s]