typetext
{
"aspect_ratio": "1:1",
"input_image_1": "https://replicate.delivery/pbxt/N5rSeJrCafWpmJuLb62moY8pSMEpSBBwSf7N6hxyIn4fNYMa/w8msa88d01rm80cq3hzsqrdehg.png",
"input_image_2": "https://replicate.delivery/pbxt/N5rSdTCgBqIRvbkedcfLfS5xTSEEOqMtX9FsR1hLK9JYryml/0_1.webp",
"prompt": "Put the woman into a white t-shirt with the text on it"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_f7T**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run flux-kontext-apps/multi-image-kontext-max using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
input_image_1: "https://replicate.delivery/pbxt/N5rSeJrCafWpmJuLb62moY8pSMEpSBBwSf7N6hxyIn4fNYMa/w8msa88d01rm80cq3hzsqrdehg.png",
input_image_2: "https://replicate.delivery/pbxt/N5rSdTCgBqIRvbkedcfLfS5xTSEEOqMtX9FsR1hLK9JYryml/0_1.webp",
prompt: "Put the woman into a white t-shirt with the text on it"
};
const output = await replicate.run("flux-kontext-apps/multi-image-kontext-max", { 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.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_f7T**********************************
This is your API token. Keep it to yourself.
import replicate
Run flux-kontext-apps/multi-image-kontext-max using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"flux-kontext-apps/multi-image-kontext-max",
input={
"aspect_ratio": "1:1",
"input_image_1": "https://replicate.delivery/pbxt/N5rSeJrCafWpmJuLb62moY8pSMEpSBBwSf7N6hxyIn4fNYMa/w8msa88d01rm80cq3hzsqrdehg.png",
"input_image_2": "https://replicate.delivery/pbxt/N5rSdTCgBqIRvbkedcfLfS5xTSEEOqMtX9FsR1hLK9JYryml/0_1.webp",
"prompt": "Put the woman into a white t-shirt with the text on it"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_f7T**********************************
This is your API token. Keep it to yourself.
Run flux-kontext-apps/multi-image-kontext-max 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": {
"aspect_ratio": "1:1",
"input_image_1": "https://replicate.delivery/pbxt/N5rSeJrCafWpmJuLb62moY8pSMEpSBBwSf7N6hxyIn4fNYMa/w8msa88d01rm80cq3hzsqrdehg.png",
"input_image_2": "https://replicate.delivery/pbxt/N5rSdTCgBqIRvbkedcfLfS5xTSEEOqMtX9FsR1hLK9JYryml/0_1.webp",
"prompt": "Put the woman into a white t-shirt with the text on it"
}
}' \
https://api.replicate.com/v1/models/flux-kontext-apps/multi-image-kontext-max/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "n06kn3k221rmc0cq3j0rpat0rc",
"model": "flux-kontext-apps/multi-image-kontext-max",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"input_image_1": "https://replicate.delivery/pbxt/N5rSeJrCafWpmJuLb62moY8pSMEpSBBwSf7N6hxyIn4fNYMa/w8msa88d01rm80cq3hzsqrdehg.png",
"input_image_2": "https://replicate.delivery/pbxt/N5rSdTCgBqIRvbkedcfLfS5xTSEEOqMtX9FsR1hLK9JYryml/0_1.webp",
"prompt": "Put the woman into a white t-shirt with the text on it"
},
"logs": "Using seed: 122495798\nGenerating...\nGenerated image in 6.4sec\nDownloading 590297 bytes\nDownloaded 0.56MB in 1.05sec",
"output": "https://replicate.delivery/xezq/7wlLiKHs0arKBtHaijl2tM1fFU2R18b57eR3nWzA2KlTUixUA/tmpe2rpyzyh.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-29T14:45:30.768Z",
"started_at": "2025-05-29T14:45:30.776375Z",
"completed_at": "2025-05-29T14:45:39.015889Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/n06kn3k221rmc0cq3j0rpat0rc/cancel",
"get": "https://api.replicate.com/v1/predictions/n06kn3k221rmc0cq3j0rpat0rc",
"stream": "https://stream.replicate.com/v1/files/bcwr-zjknhtgqwz7e4c7cubdigsjnf2yfoknp26iy66sjelin4obygsqq",
"web": "https://replicate.com/p/n06kn3k221rmc0cq3j0rpat0rc"
},
"metrics": {
"image_count": 1,
"predict_time": 8.239513763,
"total_time": 8.247889
}
}

