typefile
{
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NPnbksFgRfoWhhj3MviiIgxBDhGCqKaFiJgysFyo7Uhk5UnH/Screenshot%202025-07-22%20at%207.33.33%E2%80%AFPM.png",
"output_format": "webp",
"prompt": "make this a realistic drone photo",
"seed": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Tjs**********************************
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/real-earth 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/NPnbksFgRfoWhhj3MviiIgxBDhGCqKaFiJgysFyo7Uhk5UnH/Screenshot%202025-07-22%20at%207.33.33%E2%80%AFPM.png",
output_format: "webp",
prompt: "make this a realistic drone photo",
seed: 0
};
const output = await replicate.run("flux-kontext-apps/real-earth", { 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_Tjs**********************************
This is your API token. Keep it to yourself.
import replicate
Run flux-kontext-apps/real-earth using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"flux-kontext-apps/real-earth",
input={
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NPnbksFgRfoWhhj3MviiIgxBDhGCqKaFiJgysFyo7Uhk5UnH/Screenshot%202025-07-22%20at%207.33.33%E2%80%AFPM.png",
"output_format": "webp",
"prompt": "make this a realistic drone photo",
"seed": 0
}
)
# 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_Tjs**********************************
This is your API token. Keep it to yourself.
Run flux-kontext-apps/real-earth 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/NPnbksFgRfoWhhj3MviiIgxBDhGCqKaFiJgysFyo7Uhk5UnH/Screenshot%202025-07-22%20at%207.33.33%E2%80%AFPM.png",
"output_format": "webp",
"prompt": "make this a realistic drone photo",
"seed": 0
}
}' \
https://api.replicate.com/v1/models/flux-kontext-apps/real-earth/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kgyxb4br5nrmc0cr7q2s354jq0",
"model": "flux-kontext-apps/real-earth",
"version": "hidden",
"input": {
"aspect_ratio": "match_input_image",
"input_image": "https://replicate.delivery/pbxt/NPnbksFgRfoWhhj3MviiIgxBDhGCqKaFiJgysFyo7Uhk5UnH/Screenshot%202025-07-22%20at%207.33.33%E2%80%AFPM.png",
"output_format": "webp",
"prompt": "make this a realistic drone photo",
"seed": 0
},
"logs": "Using Seed: 18993\nUpscaling image...",
"output": "https://replicate.delivery/xezq/szh93V4CcmZFOJBBYiaKXJq4TvqAhny26rhr2FWKnnHekBiKA/1337-12e13562-68bf-11f0-8a7e-9ec102a80e24.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-07-24T18:50:08.301Z",
"started_at": "2025-07-24T18:50:08.96263Z",
"completed_at": "2025-07-24T18:50:33.064554Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kgyxb4br5nrmc0cr7q2s354jq0/cancel",
"children": "https://api.replicate.com/v1/predictions/kgyxb4br5nrmc0cr7q2s354jq0/children",
"get": "https://api.replicate.com/v1/predictions/kgyxb4br5nrmc0cr7q2s354jq0",
"root": "https://api.replicate.com/v1/predictions/kgyxb4br5nrmc0cr7q2s354jq0",
"stream": "https://stream.replicate.com/v1/files/bcwr-3vgvyrozo3oz555evto2yr7rzgfmr2mouinwudx3cbrw22taf36a",
"web": "https://replicate.com/p/kgyxb4br5nrmc0cr7q2s354jq0"
},
"metrics": {
"predict_time": 24.101924198,
"total_time": 24.763554
}
}
