Theme
Create Task stability-ai/stable-diffusion-inpainting
POST
https://www.kkiai.com/replicate/v1/predictions
Official Documentation: https://replicate.com/stability-ai/stable-diffusion-inpainting
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 Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
input | object | Optional | |
└ mask | string | Required | Black and white image used as a mask for inpainting the provided image. White pixels will be inpainted, black pixels will be preserved. |
└ image | string | Required | Initial image for generating variants. Will be resized to height x width. |
└ width | integer | Optional | Width of the generated image in pixels. Must be a multiple of 64. Default: 512. |
└ height | integer | Optional | Height of the generated image in pixels. Must be a multiple of 64. Default: 512. |
└ 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 | Optional | Classifier-free guidance scale. Default: 7.5. Min: 1, Max: 20. |
└ num_inference_steps | integer | Optional | Number of denoising steps. Default: 50. Min: 1, Max: 500. |
Request Example
json
{
"version": "stability-ai/stable-diffusion-inpainting:95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
"input": {
"mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
"image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
"width": 512,
"height": 512,
"prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"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-inpainting:95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
"input": {
"mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
"image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
"width": 512,
"height": 512,
"prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 25
}
}'Response
🟢 200 Success
Response Body
| Parameter Name | 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://..."
}
]
}