Theme
Create Task - Through Model Version (Predictions)
POST
https://www.kkiai.com/replicate/v1/predictions
version models support the following
"ac732df83cea7fff18b8472768c88ad041fa750ff7682a21affe81863cbe77e4": "stability-ai/stable-diffusion",
"7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc": "stability-ai/sdxl",
"95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3": "stability-ai/stable-diffusion-inpainting",
"15a3689ee13b0d2616e98820eca31d4c3abcd36672df6afce5cb6feb1d66087d": "stability-ai/stable-diffusion-img2img",
"2a6b576af31790b470f0a8442e1e9791213fa13799cbb65a9fc1436e96389574": "lucataco/flux-schnell-lora",
"091495765fa5ef2725a175a57b276ec30dc9d39c22d30410f2ede68a3eab66b3": "lucataco/flux-dev-lora",
"ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5": "andreasjansson/stable-diffusion-animation",
"beecf59c4aee8d81bf04f0381033dfa10dc16e845b4ae00d281e2fa377e48a9f": "lucataco/animate-diff",
"153b0087c2576ad30d8cbddb35275b387d1a6bf986bda5499948f843f6460faf": "sujaykhandekar/object-removal",
"fb8af171cfa1616ddcf1242c093f9c46bcada5ad4cf6f2fbe8b81b330ec5c003": "cjwbw/rembg"
For specific model parameters, please visit replicate.com to view the specific model request parameters
Request Parameters
Authorization
Add the Authorization parameter in the Header, with its 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. Minimum: 1, Maximum: 4. |
└ guidance_scale | number | Required | Classifier-free guidance scale. Default: 7.5. Minimum: 1, Maximum: 20. |
└ num_inference_steps | integer | Required | Number of denoising steps. Default: 50. Minimum: 1, Maximum: 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://..."
}
]
}