Theme
Create Task stability-ai/sdxl
POST
https://www.kkiai.com/replicate/v1/predictions
Official Documentation: https://replicate.com/stability-ai/sdxl
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value should be 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 | |
└ width | integer | Optional | Width of the output image. Default: 1024. |
└ height | integer | Optional | Height of the output image. Default: 1024. |
└ prompt | string | Optional | |
└ refine | string | Optional | Which refinement style to use. Default: "no_refiner". |
└ scheduler | string | Optional | Scheduler. Default: "K_EULER". |
└ lora_scale | number | Optional | LoRA additive scale. Only applicable to trained models. Default: 0.6. |
└ num_outputs | integer | Optional | Number of images to output. Default: 1. Min: 1, Max: 4. |
└ guidance_scale | number | Optional | Classifier-free guidance scale. Default: 7.5. Min: 1, Max: 50. |
└ apply_watermark | boolean | Optional | Apply watermark to determine if the image was generated in downstream applications. You can use this method to disable the watermark if you have other provisions for secure generation or deployment of images. Default: true. |
└ high_noise_frac | number | Optional | For expert_ensemble_refiner, the noise fraction to use. Default: 0.8. Min: 0, Max: 1. |
└ negative_prompt | string | Optional | Input negative prompt. Default: "". |
└ prompt_strength | number | Optional | Prompt strength when using img2img / inpaint. 1.0 corresponds to completely destroying the information in the image. Default: 0.8. Min: 0, Max: 1. |
└ num_inference_steps | integer | Optional | Number of denoising steps. Default: 50. Min: 1, Max: 500. |
Request Example
json
{
"version": "stability-ai/sdxl:7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc",
"input": {
"width": 768,
"height": 768,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"lora_scale": 0.6,
"num_outputs": 1,
"guidance_scale": 7.5,
"apply_watermark": false,
"high_noise_frac": 0.8,
"negative_prompt": "",
"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/sdxl:7762fd07cf82c948538e41f63f77d685e02b063e37e496e96eefd46c929f9bdc",
"input": {
"width": 768,
"height": 768,
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"refine": "expert_ensemble_refiner",
"scheduler": "K_EULER",
"lora_scale": 0.6,
"num_outputs": 1,
"guidance_scale": 7.5,
"apply_watermark": false,
"high_noise_frac": 0.8,
"negative_prompt": "",
"prompt_strength": 0.8,
"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://..."
}
]
}