Skip to content

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 NameTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
inputobjectOptional
  └ maskstringRequiredBlack and white image used as a mask for inpainting the provided image. White pixels will be inpainted, black pixels will be preserved.
  └ imagestringRequiredInitial image for generating variants. Will be resized to height x width.
  └ widthintegerOptionalWidth of the generated image in pixels. Must be a multiple of 64. Default: 512.
  └ heightintegerOptionalHeight of the generated image in pixels. Must be a multiple of 64. Default: 512.
  └ promptstringOptional
  └ schedulerstringOptionalSelect a scheduler. Default: "DPMSolverMultistep".
  └ num_outputsintegerOptionalNumber of images to generate. Default: 1. Min: 1, Max: 4.
  └ guidance_scalenumberOptionalClassifier-free guidance scale. Default: 7.5. Min: 1, Max: 20.
  └ num_inference_stepsintegerOptionalNumber 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 NameTypeRequiredDescription
idstringRequired
modelstringRequired
versionstringRequired
inputobjectRequired
  └ aspect_ratiostringRequired
  └ input_imagestringRequired
  └ output_formatstringRequired
  └ promptstringRequired
  └ prompt_upsamplingbooleanRequired
  └ safety_toleranceintegerRequired
logsstringRequired
outputnullRequired
data_removedbooleanRequired
errornullRequired
statusstringRequired
created_atstringRequired
urlsobjectRequired
  └ cancelstringRequired
  └ getstringRequired
  └ streamstringRequired
  └ webstringRequired

Response Example

json
{
    "created": 1589478378,
    "data": [
        {
            "url": "https://..."
        },
        {
            "url": "https://..."
        }
    ]
}