Theme
Create Task black-forest-labs/flux-kontext-pro
POST
https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-kontext-pro/predictions
Official Documentation: https://replicate.com/black-forest-labs/flux-kontext-pro
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. |
└ input_image | string | Optional | 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". Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9, 9:21, 2:1, 1:2. |
└ output_format | string | Optional | The output format of the generated image. Default: "png". |
└ safety_tolerance | integer | Optional | Safety tolerance, 0 is most strict, 6 is most lenient. 2 is the maximum allowed when using input images. Default: 2 |
└ prompt_upsampling | boolean | Optional | Automatic prompt improvement. Default: false. |
Request Example
json
{
"input": {
"prompt": "Make this a 90s cartoon",
"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
"aspect_ratio": "match_input_image",
"output_format": "jpg",
"safety_tolerance": 2,
"prompt_upsampling": false
}
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/replicate/v1/models/black-forest-labs/flux-kontext-pro/predictions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": {
"prompt": "Make this a 90s cartoon",
"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
"aspect_ratio": "match_input_image",
"output_format": "jpg",
"safety_tolerance": 2,
"prompt_upsampling": false
}
}'Response
🟢 200 Success
Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
input | object | Required | |
└ aspect_ratio | string | Optional | |
└ input_image | string | Optional | |
└ output_format | string | Optional | |
└ prompt | string | Required | |
└ prompt_upsampling | boolean | Optional | |
└ safety_tolerance | integer | Optional |
Response Example
json
{
"id": "b1qw7g8h9xrma0crakst3xbj8m",
"model": "black-forest-labs/flux-kontext-pro",
"version": "hidden",
"input": {
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
"output_format": "jpg",
"prompt": "Make this a 90s cartoon",
"prompt_upsampling": false,
"safety_tolerance": 2
},
"logs": "",
"output": null,
"data_removed": false,
"error": null,
"status": "starting",
"created_at": "2025-07-29T06:51:12.591Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/b1qw7g8h9xrma0crakst3xbj8m/cancel",
"get": "https://api.replicate.com/v1/predictions/b1qw7g8h9xrma0crakst3xbj8m",
"stream": "https://stream.replicate.com/v1/files/bcwr-3g5lstbmjxzikqt225npeguwi4bu47ndhirdgete5npgzzzogkpq",
"web": "https://replicate.com/p/b1qw7g8h9xrma0crakst3xbj8m"
}
}