Skip to content

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

Body Parameters (application/json)

Parameter NameTypeRequiredDescription
inputobjectOptional
  └ widthintegerOptionalWidth of the output image. Default: 1024.
  └ heightintegerOptionalHeight of the output image. Default: 1024.
  └ promptstringOptional
  └ refinestringOptionalWhich refinement style to use. Default: "no_refiner".
  └ schedulerstringOptionalScheduler. Default: "K_EULER".
  └ lora_scalenumberOptionalLoRA additive scale. Only applicable to trained models. Default: 0.6.
  └ num_outputsintegerOptionalNumber of images to output. Default: 1. Min: 1, Max: 4.
  └ guidance_scalenumberOptionalClassifier-free guidance scale. Default: 7.5. Min: 1, Max: 50.
  └ apply_watermarkbooleanOptionalApply 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_fracnumberOptionalFor expert_ensemble_refiner, the noise fraction to use. Default: 0.8. Min: 0, Max: 1.
  └ negative_promptstringOptionalInput negative prompt. Default: "".
  └ prompt_strengthnumberOptionalPrompt 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_stepsintegerOptionalNumber 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 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://..."
        }
    ]
}