Theme
Create Task stability-ai/stable-diffusion-img2img
POST
https://www.kkiai.com/replicate/v1/predictions
Official Documentation: https://replicate.com/stability-ai/stable-diffusion-img2img
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 |
|---|---|---|---|
input | object | Optional | |
└ image | string | Required | Initial image for generating variations. |
└ prompt | string | Optional | |
└ scheduler | string | Optional | |
└ num_outputs | integer | Optional | Number of output images. Too many outputs may cause out of memory errors. Default: 1. Min: 1, Max: 8. |
└ guidance_scale | number | Optional | Classifier-free guidance scale. Default: 7.5. Min: 1, Max: 20. |
└ prompt_strength | number | Optional | Prompt strength when providing an image. 1.0 corresponds to completely destroying information in the initial image. Default: 0.8. |
└ num_inference_steps | integer | Optional | Number of denoising steps. Default: 25. Min: 1, Max: 500. |
Request Example
json
{
"version": "stability-ai/stable-diffusion-img2img:15a3689ee13b0d2616e98820eca31d4c3abcd36672df6afce5cb6feb1d66087d",
"input": {
"image": "https://replicate.delivery/pbxt/HtKMvJSvuGWDn2B35mM396QGzcrgCNkcgSko8JxtXux4aX9H/sketch-mountains-input.jpeg",
"prompt": "A fantasy landscape, trending on artstation",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"prompt_strength": 0.8,
"num_inference_steps": 25
}
}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-img2img:15a3689ee13b0d2616e98820eca31d4c3abcd36672df6afce5cb6feb1d66087d",
"input": {
"image": "https://replicate.delivery/pbxt/HtKMvJSvuGWDn2B35mM396QGzcrgCNkcgSko8JxtXux4aX9H/sketch-mountains-input.jpeg",
"prompt": "A fantasy landscape, trending on artstation",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"prompt_strength": 0.8,
"num_inference_steps": 25
}
}'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://..."
}
]
}