typefile
{
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NQ5CYdHqiLE144eV8DBKSk14v4bB1hBOpOIz89NXURFxCshV/image.png",
"lora_strength": 1,
"output_format": "webp",
"prompt": "Place it"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pbs**********************************
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/place-it-overlay using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "match_input_image",
input_image: "https://replicate.delivery/pbxt/NQ5CYdHqiLE144eV8DBKSk14v4bB1hBOpOIz89NXURFxCshV/image.png",
lora_strength: 1,
output_format: "webp",
prompt: "Place it"
};
const output = await replicate.run("flux-kontext-apps/place-it-overlay", { 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_Pbs**********************************
This is your API token. Keep it to yourself.
import replicate
Run flux-kontext-apps/place-it-overlay using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"flux-kontext-apps/place-it-overlay",
input={
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NQ5CYdHqiLE144eV8DBKSk14v4bB1hBOpOIz89NXURFxCshV/image.png",
"lora_strength": 1,
"output_format": "webp",
"prompt": "Place 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_Pbs**********************************
This is your API token. Keep it to yourself.
Run flux-kontext-apps/place-it-overlay 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": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NQ5CYdHqiLE144eV8DBKSk14v4bB1hBOpOIz89NXURFxCshV/image.png",
"lora_strength": 1,
"output_format": "webp",
"prompt": "Place it"
}
}' \
https://api.replicate.com/v1/models/flux-kontext-apps/place-it-overlay/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "tnnh953cg1rmc0cr87hrrwygz8",
"model": "flux-kontext-apps/place-it-overlay",
"version": "hidden",
"input": {
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NQ5CYdHqiLE144eV8DBKSk14v4bB1hBOpOIz89NXURFxCshV/image.png",
"lora_strength": 1,
"output_format": "webp",
"prompt": "Place it"
},
"logs": "",
"output": "https://replicate.delivery/xezq/8wI9vkxRxcZkF5H05wqy0DsSwgOVCUmzYjtV5VRnfeDeBoIqA/output.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-07-25T14:01:20.256Z",
"started_at": "2025-07-25T14:01:28.492878Z",
"completed_at": "2025-07-25T14:01:34.857132Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/tnnh953cg1rmc0cr87hrrwygz8/cancel",
"children": "https://api.replicate.com/v1/predictions/tnnh953cg1rmc0cr87hrrwygz8/children",
"get": "https://api.replicate.com/v1/predictions/tnnh953cg1rmc0cr87hrrwygz8",
"root": "https://api.replicate.com/v1/predictions/tnnh953cg1rmc0cr87hrrwygz8",
"stream": "https://stream.replicate.com/v1/files/bcwr-f7rj6xstkmtiujavyzrydggt3jusxsghyvhiitcftcgc3pmvcria",
"web": "https://replicate.com/p/tnnh953cg1rmc0cr87hrrwygz8"
},
"metrics": {
"predict_time": 6.36425438,
"total_time": 14.601132
}
}
