black-forest-labs / flux-kontext-pro
A state-of-the-art text-based image editing model that delivers high-quality outputs with excellent prompt following and consistent results for transforming images through natural language (Updated 2 weeks, 2 days ago)
- Public
- 2.8M runs
-
Commercial use
- Weights
Prediction
black-forest-labs/flux-kontext-proOfficial modelIDks1w6tyk9nrma0cq6ycacv92xmStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- Make this a 90s cartoon
- aspect_ratio
- match_input_image
- output_format
- jpg
- safety_tolerance
- 2
{ "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 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const 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 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", 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 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "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 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T21:00:56.319262Z", "created_at": "2025-06-03T21:00:51.917000Z", "data_removed": false, "error": null, "id": "ks1w6tyk9nrma0cq6ycacv92xm", "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 }, "logs": "Using seed: 1944901477\nGenerating...\nGenerated image in 4.2sec\nDownloading 207029 bytes\nDownloaded 0.20MB in 0.14sec", "metrics": { "image_count": 1, "predict_time": 4.372377316, "total_time": 4.402262 }, "output": "https://replicate.delivery/xezq/83OKs6yfdoT5YCpfREnrFFbqLbfWbus8Q0e06fQ0BAMDRKamC/tmpu3nqollf.jpg", "started_at": "2025-06-03T21:00:51.946885Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-53lhpegfrlvp2okti2n2ctaam2fuilck6mmi35jvdikz32r3mfkq", "get": "https://api.replicate.com/v1/predictions/ks1w6tyk9nrma0cq6ycacv92xm", "cancel": "https://api.replicate.com/v1/predictions/ks1w6tyk9nrma0cq6ycacv92xm/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelIDnp51x74339rme0cq70c9tavpwcStatusSucceededSourceWebTotal durationCreatedInput
{ "prompt": "Remove the background", "input_image": "https://replicate.delivery/pbxt/N55pSqbotI3rzaKDVbWZ6rscqt3SYAs2M5e0vtp9YJQsansl/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png", "aspect_ratio": "16:9", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "Remove the background", input_image: "https://replicate.delivery/pbxt/N55pSqbotI3rzaKDVbWZ6rscqt3SYAs2M5e0vtp9YJQsansl/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png", aspect_ratio: "16:9", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "Remove the background", "input_image": "https://replicate.delivery/pbxt/N55pSqbotI3rzaKDVbWZ6rscqt3SYAs2M5e0vtp9YJQsansl/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png", "aspect_ratio": "16:9", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "Remove the background", "input_image": "https://replicate.delivery/pbxt/N55pSqbotI3rzaKDVbWZ6rscqt3SYAs2M5e0vtp9YJQsansl/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png", "aspect_ratio": "16:9", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:20:24.642765Z", "created_at": "2025-06-03T23:20:19.994000Z", "data_removed": false, "error": null, "id": "np51x74339rme0cq70c9tavpwc", "input": { "prompt": "Remove the background", "input_image": "https://replicate.delivery/pbxt/N55pSqbotI3rzaKDVbWZ6rscqt3SYAs2M5e0vtp9YJQsansl/replicate-prediction-f2d25rg6gnrma0cq257vdw2n4c.png", "aspect_ratio": "16:9", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 737365947\nGenerating...\nGenerated image in 4.4sec\nDownloading 104485 bytes\nDownloaded 0.10MB in 0.13sec", "metrics": { "image_count": 1, "predict_time": 4.642258446, "total_time": 4.648765 }, "output": "https://replicate.delivery/xezq/aheXEzy4hpXoYS2lvxLoFpP7esSDdeCsSeO4hB4qRSZhTNNTB/tmp4i5moj6n.jpg", "started_at": "2025-06-03T23:20:20.000507Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-yk24d6dh5hyzmxpra7xeejd2fiesfscryvwsxp2b3t2i7g2x33gq", "get": "https://api.replicate.com/v1/predictions/np51x74339rme0cq70c9tavpwc", "cancel": "https://api.replicate.com/v1/predictions/np51x74339rme0cq70c9tavpwc/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelID2qak8pz5mnrma0cq70ca1f74rwStatusSucceededSourceWebTotal durationCreatedInput
{ "prompt": "make this a photo", "input_image": "https://replicate.delivery/pbxt/N56hgwBgzG8vtKd81daHBXdRg7GJ5Vks17uwuGlvLJCWRYt6/lofigirl-1-1000x563-1280097039.jpg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "make this a photo", input_image: "https://replicate.delivery/pbxt/N56hgwBgzG8vtKd81daHBXdRg7GJ5Vks17uwuGlvLJCWRYt6/lofigirl-1-1000x563-1280097039.jpg", aspect_ratio: "match_input_image", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "make this a photo", "input_image": "https://replicate.delivery/pbxt/N56hgwBgzG8vtKd81daHBXdRg7GJ5Vks17uwuGlvLJCWRYt6/lofigirl-1-1000x563-1280097039.jpg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "make this a photo", "input_image": "https://replicate.delivery/pbxt/N56hgwBgzG8vtKd81daHBXdRg7GJ5Vks17uwuGlvLJCWRYt6/lofigirl-1-1000x563-1280097039.jpg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:20:49.961458Z", "created_at": "2025-06-03T23:20:45.221000Z", "data_removed": false, "error": null, "id": "2qak8pz5mnrma0cq70ca1f74rw", "input": { "prompt": "make this a photo", "input_image": "https://replicate.delivery/pbxt/N56hgwBgzG8vtKd81daHBXdRg7GJ5Vks17uwuGlvLJCWRYt6/lofigirl-1-1000x563-1280097039.jpg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 1880007692\nGenerating...\nGenerated image in 4.5sec\nDownloading 119572 bytes\nDownloaded 0.11MB in 0.13sec", "metrics": { "image_count": 1, "predict_time": 4.733835895, "total_time": 4.740458 }, "output": "https://replicate.delivery/xezq/QYjBmohenWRdVy8wz2Dx2eebkqMwxNT52DB6Km9d6UOjqmmpA/tmp4s2tgbcv.jpg", "started_at": "2025-06-03T23:20:45.227623Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-m56nrewznbcjibotodlcracaujgp3sj4npgesxejk42wtas3zbkq", "get": "https://api.replicate.com/v1/predictions/2qak8pz5mnrma0cq70ca1f74rw", "cancel": "https://api.replicate.com/v1/predictions/2qak8pz5mnrma0cq70ca1f74rw/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelID7r8cr8vn15rme0cq70cv1bx0v0StatusSucceededSourceWebTotal durationCreatedInput
{ "prompt": " ", "input_image": "https://replicate.delivery/pbxt/N5aac0dHBimjTNOYimvaYdgylQTDUigPSTMgIrzyJxClgIKn/favorite-screenshot-from-each-movie-v0-2jlw02gbtfid1.jpg", "aspect_ratio": "2:3", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: " ", input_image: "https://replicate.delivery/pbxt/N5aac0dHBimjTNOYimvaYdgylQTDUigPSTMgIrzyJxClgIKn/favorite-screenshot-from-each-movie-v0-2jlw02gbtfid1.jpg", aspect_ratio: "2:3", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": " ", "input_image": "https://replicate.delivery/pbxt/N5aac0dHBimjTNOYimvaYdgylQTDUigPSTMgIrzyJxClgIKn/favorite-screenshot-from-each-movie-v0-2jlw02gbtfid1.jpg", "aspect_ratio": "2:3", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": " ", "input_image": "https://replicate.delivery/pbxt/N5aac0dHBimjTNOYimvaYdgylQTDUigPSTMgIrzyJxClgIKn/favorite-screenshot-from-each-movie-v0-2jlw02gbtfid1.jpg", "aspect_ratio": "2:3", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:21:26.253637Z", "created_at": "2025-06-03T23:21:21.929000Z", "data_removed": false, "error": null, "id": "7r8cr8vn15rme0cq70cv1bx0v0", "input": { "prompt": " ", "input_image": "https://replicate.delivery/pbxt/N5aac0dHBimjTNOYimvaYdgylQTDUigPSTMgIrzyJxClgIKn/favorite-screenshot-from-each-movie-v0-2jlw02gbtfid1.jpg", "aspect_ratio": "2:3", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 446811187\nGenerating...\nGenerated image in 4.1sec\nDownloading 69489 bytes\nDownloaded 0.07MB in 0.12sec", "metrics": { "image_count": 1, "predict_time": 4.3186548909999996, "total_time": 4.324637 }, "output": "https://replicate.delivery/xezq/NKcyCeiUXqTFdqeV7OsiSj6VreNTV1LAAsf6lCC0ufJxuaamC/tmp8i8r55a5.jpg", "started_at": "2025-06-03T23:21:21.934982Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-f4jorw2aetrj6ceptfhfkya3ixq2cdfpdhh2xjklgg63w7icjqsa", "get": "https://api.replicate.com/v1/predictions/7r8cr8vn15rme0cq70cv1bx0v0", "cancel": "https://api.replicate.com/v1/predictions/7r8cr8vn15rme0cq70cv1bx0v0/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelID14pr5yqe9nrma0cq70da6qn1pwStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- Replace 'joy' with 'Pro'
- aspect_ratio
- match_input_image
- output_format
- jpg
- safety_tolerance
- 2
{ "prompt": "Replace 'joy' with 'Pro'", "input_image": "https://replicate.delivery/pbxt/N5i6Pma4GRn4vLnKNMfNXs2mRrzPTAzRXgzZY6fBQZmCBDnE/choose-joy.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "Replace 'joy' with 'Pro'", input_image: "https://replicate.delivery/pbxt/N5i6Pma4GRn4vLnKNMfNXs2mRrzPTAzRXgzZY6fBQZmCBDnE/choose-joy.png", aspect_ratio: "match_input_image", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "Replace 'joy' with 'Pro'", "input_image": "https://replicate.delivery/pbxt/N5i6Pma4GRn4vLnKNMfNXs2mRrzPTAzRXgzZY6fBQZmCBDnE/choose-joy.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "Replace \'joy\' with \'Pro\'", "input_image": "https://replicate.delivery/pbxt/N5i6Pma4GRn4vLnKNMfNXs2mRrzPTAzRXgzZY6fBQZmCBDnE/choose-joy.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:23:03.256823Z", "created_at": "2025-06-03T23:22:58.509000Z", "data_removed": false, "error": null, "id": "14pr5yqe9nrma0cq70da6qn1pw", "input": { "prompt": "Replace 'joy' with 'Pro'", "input_image": "https://replicate.delivery/pbxt/N5i6Pma4GRn4vLnKNMfNXs2mRrzPTAzRXgzZY6fBQZmCBDnE/choose-joy.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 663375319\nGenerating...\nGenerated image in 4.5sec\nDownloading 129727 bytes\nDownloaded 0.12MB in 0.15sec", "metrics": { "image_count": 1, "predict_time": 4.741519853, "total_time": 4.747823 }, "output": "https://replicate.delivery/xezq/kMdXfZiQ3yyhdSTvSuA6d2cz8gS8RWdPwRprRqSp7r2rrpZKA/tmp6jyqxjqc.jpg", "started_at": "2025-06-03T23:22:58.515303Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-77ie2g5cznguhipgmkxnr4ybhfdkmmpov7vxcmezojhr4ta3lhxq", "get": "https://api.replicate.com/v1/predictions/14pr5yqe9nrma0cq70da6qn1pw", "cancel": "https://api.replicate.com/v1/predictions/14pr5yqe9nrma0cq70da6qn1pw/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelID6ecbh4c8bxrm80cq70ds0s20rmStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them
- aspect_ratio
- match_input_image
- output_format
- jpg
- safety_tolerance
- 2
{ "prompt": "Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them", "input_image": "https://replicate.delivery/pbxt/N5v1sR7FeOaBYBcRLwTcbxxrmoXytMt9mKpBD3BATJlf2FZt/old-man.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them", input_image: "https://replicate.delivery/pbxt/N5v1sR7FeOaBYBcRLwTcbxxrmoXytMt9mKpBD3BATJlf2FZt/old-man.png", aspect_ratio: "match_input_image", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them", "input_image": "https://replicate.delivery/pbxt/N5v1sR7FeOaBYBcRLwTcbxxrmoXytMt9mKpBD3BATJlf2FZt/old-man.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them", "input_image": "https://replicate.delivery/pbxt/N5v1sR7FeOaBYBcRLwTcbxxrmoXytMt9mKpBD3BATJlf2FZt/old-man.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:23:42.021543Z", "created_at": "2025-06-03T23:23:37.951000Z", "data_removed": false, "error": null, "id": "6ecbh4c8bxrm80cq70ds0s20rm", "input": { "prompt": "Change the background to a beach while keeping the person in the exact same position, scale, and pose. Maintain identical subject placement, camera angle, framing, and perspective. Only replace the environment around them", "input_image": "https://replicate.delivery/pbxt/N5v1sR7FeOaBYBcRLwTcbxxrmoXytMt9mKpBD3BATJlf2FZt/old-man.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 1659250145\nGenerating...\nGenerated image in 3.8sec\nDownloading 158277 bytes\nDownloaded 0.15MB in 0.12sec", "metrics": { "image_count": 1, "predict_time": 4.064651819, "total_time": 4.070543 }, "output": "https://replicate.delivery/xezq/pEX07z5DOJooLlDVczziumyOKjZGTgU6p1v9fh5X6GcfXTzUA/tmpemtbtszq.jpg", "started_at": "2025-06-03T23:23:37.956891Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-h6csmcw5k2cviapkopu7iotdulajwrgaox7dryq3w3ae5ijwkhza", "get": "https://api.replicate.com/v1/predictions/6ecbh4c8bxrm80cq70ds0s20rm", "cancel": "https://api.replicate.com/v1/predictions/6ecbh4c8bxrm80cq70ds0s20rm/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelIDjcb8e9t09srme0cq70ebn00aq4StatusSucceededSourceWebTotal durationCreatedInput
- prompt
- Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table
- aspect_ratio
- match_input_image
- output_format
- jpg
- safety_tolerance
- 2
{ "prompt": "Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table", "input_image": "https://replicate.delivery/pbxt/N5iHx84xgpS6jyvXeVQ7s3GAMyL6xCLsS5Kk3RhLxJOpcasc/black-and-white-style.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table", input_image: "https://replicate.delivery/pbxt/N5iHx84xgpS6jyvXeVQ7s3GAMyL6xCLsS5Kk3RhLxJOpcasc/black-and-white-style.png", aspect_ratio: "match_input_image", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table", "input_image": "https://replicate.delivery/pbxt/N5iHx84xgpS6jyvXeVQ7s3GAMyL6xCLsS5Kk3RhLxJOpcasc/black-and-white-style.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table", "input_image": "https://replicate.delivery/pbxt/N5iHx84xgpS6jyvXeVQ7s3GAMyL6xCLsS5Kk3RhLxJOpcasc/black-and-white-style.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:24:29.541746Z", "created_at": "2025-06-03T23:24:25.038000Z", "data_removed": false, "error": null, "id": "jcb8e9t09srme0cq70ebn00aq4", "input": { "prompt": "Using this style, a bunny, a dog and a cat are having a tea party seated around a small white table", "input_image": "https://replicate.delivery/pbxt/N5iHx84xgpS6jyvXeVQ7s3GAMyL6xCLsS5Kk3RhLxJOpcasc/black-and-white-style.png", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 1279866004\nGenerating...\nGenerated image in 4.3sec\nDownloading 349813 bytes\nDownloaded 0.33MB in 0.15sec", "metrics": { "image_count": 1, "predict_time": 4.497435279, "total_time": 4.503746 }, "output": "https://replicate.delivery/xezq/XSaq6jcZUAJxC9vOL41lbotfdKfFbJAYfhpf4gCPeAIpFbamC/tmpon7_4qhh.jpg", "started_at": "2025-06-03T23:24:25.044311Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-pt6ndu4slvmchglg5eoxh2d7ht5bptagh3dgbzygsoa2hlvlgw3a", "get": "https://api.replicate.com/v1/predictions/jcb8e9t09srme0cq70ebn00aq4", "cancel": "https://api.replicate.com/v1/predictions/jcb8e9t09srme0cq70ebn00aq4/cancel" }, "version": "hidden" }
Prediction
black-forest-labs/flux-kontext-proOfficial modelID04k7d14dbsrm80cq70eanv1hgrStatusSucceededSourceWebTotal durationCreatedInput
- prompt
- Using this style, a panda astronaut riding a unicorn
- aspect_ratio
- match_input_image
- output_format
- jpg
- safety_tolerance
- 2
{ "prompt": "Using this style, a panda astronaut riding a unicorn", "input_image": "https://replicate.delivery/pbxt/N5cepICxyaagdvULl0phi7ImdxuFz05TR2l623zqxhNR9q5Y/van-gogh.jpeg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = { prompt: "Using this style, a panda astronaut riding a unicorn", input_image: "https://replicate.delivery/pbxt/N5cepICxyaagdvULl0phi7ImdxuFz05TR2l623zqxhNR9q5Y/van-gogh.jpeg", aspect_ratio: "match_input_image", output_format: "jpg", safety_tolerance: 2 }; const output = await replicate.run("black-forest-labs/flux-kontext-pro", { input }); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "black-forest-labs/flux-kontext-pro", input={ "prompt": "Using this style, a panda astronaut riding a unicorn", "input_image": "https://replicate.delivery/pbxt/N5cepICxyaagdvULl0phi7ImdxuFz05TR2l623zqxhNR9q5Y/van-gogh.jpeg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run black-forest-labs/flux-kontext-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "input": { "prompt": "Using this style, a panda astronaut riding a unicorn", "input_image": "https://replicate.delivery/pbxt/N5cepICxyaagdvULl0phi7ImdxuFz05TR2l623zqxhNR9q5Y/van-gogh.jpeg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 } }' \ https://api.replicate.com/v1/models/black-forest-labs/flux-kontext-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2025-06-03T23:24:49.418885Z", "created_at": "2025-06-03T23:24:44.766000Z", "data_removed": false, "error": null, "id": "04k7d14dbsrm80cq70eanv1hgr", "input": { "prompt": "Using this style, a panda astronaut riding a unicorn", "input_image": "https://replicate.delivery/pbxt/N5cepICxyaagdvULl0phi7ImdxuFz05TR2l623zqxhNR9q5Y/van-gogh.jpeg", "aspect_ratio": "match_input_image", "output_format": "jpg", "safety_tolerance": 2 }, "logs": "Using seed: 1808295432\nGenerating...\nGenerated image in 4.4sec\nDownloading 291799 bytes\nDownloaded 0.28MB in 0.13sec", "metrics": { "image_count": 1, "predict_time": 4.641977229, "total_time": 4.652885 }, "output": "https://replicate.delivery/xezq/Zk6873DOWw6HCRVYh4kU3OdABAjOXqUByuXmeKl8AkigspZKA/tmp9geu7x04.jpg", "started_at": "2025-06-03T23:24:44.776908Z", "status": "succeeded", "urls": { "stream": "https://stream.replicate.com/v1/files/bcwr-svbkyhcoguw764o2gkqpqlld6mc2euloqrscnku6voufebubbu7a", "get": "https://api.replicate.com/v1/predictions/04k7d14dbsrm80cq70eanv1hgr", "cancel": "https://api.replicate.com/v1/predictions/04k7d14dbsrm80cq70eanv1hgr/cancel" }, "version": "hidden" }
Want to make some of these yourself?
Run this model