Skip to content

Create Task black-forest-labs/flux-kontext-dev

POST https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-kontext-dev/predictions

Official Documentation: https://replicate.com/black-forest-labs/flux-kontext-dev

Request Parameters

Authorization

Add the Authorization parameter to the Header, with the value being the Token concatenated after Bearer

Example: Authorization: Bearer ********************

Header Parameters

ParameterTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}

Body Parameters (application/json)

ParameterTypeRequiredDescription
inputobjectOptional
  └ promptstringRequiredA text description of the content you want to generate, or instructions on how to edit a given image.
  └ go_fastbooleanOptionalMakes the model run faster; output quality may be slightly reduced for more difficult prompts. Default: true.
  └ guidancenumberOptionalPrompt guidance strength. Default: 2.5. Min: 0, Max: 10
  └ input_imagestringRequiredAn image to use as a reference. Must be in jpeg, png, gif, or webp format.
  └ aspect_ratiostringOptionalThe aspect ratio of the generated image. Use "match_input_image" to match the aspect ratio of the input image. Default: "match_input_image".
  └ output_formatstringOptionalOutput image format. Default: "webp".
  └ output_qualityintegerOptionalQuality when saving the output image, ranging from 0 to 100. 100 is best quality, 0 is lowest quality. Not applicable to .png output. Default: 80. Min: 0, Max: 100.
  └ num_inference_stepsintegerOptionalNumber of inference steps. Default: 28. Min: 4, Max: 50.

Request Example

json
{
    "input": {
      "prompt": "Change the car color to red, turn the headlights on",
      "go_fast": true,
      "guidance": 2.5,
      "input_image": "https://replicate.delivery/pbxt/N5YURZv4ifaW2bMwU7hmrwzgtxf99DTQXpBeobLt1O7dEc3h/pexels-jmark-253096.jpg",
      "aspect_ratio": "match_input_image",
      "output_format": "jpg",
      "output_quality": 80,
      "num_inference_steps": 30
    }
  }

cURL Example

bash
curl --location --request POST 'https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-kontext-dev/predictions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": {
      "prompt": "Change the car color to red, turn the headlights on",
      "go_fast": true,
      "guidance": 2.5,
      "input_image": "https://replicate.delivery/pbxt/N5YURZv4ifaW2bMwU7hmrwzgtxf99DTQXpBeobLt1O7dEc3h/pexels-jmark-253096.jpg",
      "aspect_ratio": "match_input_image",
      "output_format": "jpg",
      "output_quality": 80,
      "num_inference_steps": 30
    }
  }'

Response

🟢 200 Success

Response Body

ParameterTypeRequiredDescription
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://..."
        }
    ]
}