Theme
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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Optional | |
└ prompt | string | Required | A text description of the content you want to generate, or instructions on how to edit a given image. |
└ go_fast | boolean | Optional | Makes the model run faster; output quality may be slightly reduced for more difficult prompts. Default: true. |
└ guidance | number | Optional | Prompt guidance strength. Default: 2.5. Min: 0, Max: 10 |
└ input_image | string | Required | An image to use as a reference. Must be in jpeg, png, gif, or webp format. |
└ aspect_ratio | string | Optional | The aspect ratio of the generated image. Use "match_input_image" to match the aspect ratio of the input image. Default: "match_input_image". |
└ output_format | string | Optional | Output image format. Default: "webp". |
└ output_quality | integer | Optional | Quality 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_steps | integer | Optional | Number 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
| 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://..."
}
]
}