Docs Replicate official format /replicate/v1/models/black-forest-labs/flux-kontext-pro/predictions
API reference

Create task black-forest-labs/flux-kontext-pro

Official documentation: https://replicate.com/black-forest-labs/flux-kontext-pro

POST/replicate/v1/models/black-forest-labs/flux-kontext-pro/predictions

Body Parametersapplication/json

input object

Input content

properties
aspect_ratio string

The aspect ratio of the generated image. Use "match_input_image" to match the aspect ratio of the input image. Default value: "match_input_image", supports 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.

input_image string

Pictures to use as reference. Must be in jpeg, png, gif or webp format.

output_format string

The output format of the generated image. Default value: "png".

prompt* string

A text description of what you want generated, or instructions on how to edit a given image.

prompt_upsampling boolean

Auto prompt improvements. Default value: false.

safety_tolerance integer

Security tolerance, 0 is the strictest and 6 is the loosest. 2 is currently the maximum value allowed when using input images. Default value: 2

Responses

200 application/json
response-200 object
properties
input* object

Input content

400 Bad request or validation failed application/json
response-400 object
properties
error* object
401 Missing or invalid API Key application/json
response-401 object
Request Body Example
1{
2"input": {
3"aspect_ratio": "match_input_image",
4"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
5"output_format": "jpg",
6"prompt": "Make this a 90s cartoon",
7"prompt_upsampling": false,
8"safety_tolerance": 2
9}
10}
Code Sample cURL
1curl -X POST "https://api.digislash.com/replicate/v1/models/black-forest-labs/flux-kontext-pro/predictions" \
2-H "Authorization: Bearer <API Key>" \
3-H "Content-Type: application/json" \
4-d '{
5"input": {
6"aspect_ratio": "match_input_image",
7"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
8"output_format": "jpg",
9"prompt": "Make this a 90s cartoon",
10"prompt_upsampling": false,
11"safety_tolerance": 2
12}
13}'
Response
1▼{
2"created_at": "2025-07-29T06:51:12.591Z",
3"data_removed": false,
4"id": "b1qw7g8h9xrma0crakst3xbj8m",
5▼"input": {
6"aspect_ratio": "match_input_image",
7"input_image": "https://replicate.delivery/pbxt/N55l5TWGh8mSlNzW8usReoaNhGbFwvLeZR3TX1NL4pd2Wtfv/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png",
8"output_format": "jpg",
9"prompt": "Make this a 90s cartoon",
10"prompt_upsampling": false,
11"safety_tolerance": 2
12},
13"logs": "",
14"model": "black-forest-labs/flux-kontext-pro",
15"status": "starting",
16▼"urls": {
17"cancel": "https://api.replicate.com/v1/predictions/b1qw7g8h9xrma0crakst3xbj8m/cancel",
18"get": "https://api.replicate.com/v1/predictions/b1qw7g8h9xrma0crakst3xbj8m",
19"stream": "https://stream.replicate.com/v1/files/bcwr-3g5lstbmjxzikqt225npeguwi4bu47ndhirdgete5npgzzzogkpq",
20"web": "https://replicate.com/p/b1qw7g8h9xrma0crakst3xbj8m"
21},
22"version": "hidden"
23}