Theme
Create Task stability-ai/stable-diffusion
POST
https://www.kkiai.com/replicate/v1/predictions
Official Documentation: https://replicate.com/stability-ai/stable-diffusion
Request Parameters
Authorization
Add the Authorization parameter to the Header, with the value being the Token concatenated after Bearer
Example: Authorization: Bearer ********************
Header Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
version | string | Optional | |
input | object | Optional | |
└ width | integer | Optional | Width of the generated image in pixels. Must be a multiple of 64. Default: 768. |
└ height | integer | Optional | Height of the generated image in pixels. Must be a multiple of 64. Default: 768. |
└ prompt | string | Optional | |
└ scheduler | string | Optional | Select a scheduler. Default: "DPMSolverMultistep". |
└ num_outputs | integer | Optional | Number of images to generate. Default: 1. Min: 1, Max: 4. |
└ guidance_scale | number | Required | Classifier-free guidance scale. Default: 7.5. Min: 1, Max: 20. |
└ num_inference_steps | integer | Required | Number of denoising steps. Default: 50. Min: 1, Max: 500. |
Request Example
json
{
"version": "stability-ai/stable-diffusion:ac732df83cea7fff18b8472768c88ad041fa750ff7682a21affe81863cbe77e4",
"input": {
"width": 768,
"height": 768,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 50
}
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/replicate/v1/predictions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"version": "stability-ai/stable-diffusion:ac732df83cea7fff18b8472768c88ad041fa750ff7682a21affe81863cbe77e4",
"input": {
"width": 768,
"height": 768,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"scheduler": "K_EULER",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 50
}
}'Response
🟢 200 Success
Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Required | |
model | string | Required | |
version | string | Required | |
input | object | Required | |
└ aspect_ratio | string | Required | |
└ input_image | string | Required | |
└ output_format | string | Required | |
└ prompt | string | Required | |
└ prompt_upsampling | boolean | Required | |
└ safety_tolerance | integer | Required | |
logs | string | Required | |
output | null | Required | |
data_removed | boolean | Required | |
error | null | Required | |
status | string | Required | |
created_at | string | Required | |
urls | object | Required | |
└ cancel | string | Required | |
└ get | string | Required | |
└ stream | string | Required | |
└ web | string | Required |
Response Example
json
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}