typetext
{
"aspect_ratio": "9:16",
"prompt": "@character holding up the small @product",
"reference_images": [
"https://replicate.delivery/pbxt/NZ4ShCI0XbXjzjphMoHPvbn75HDTAt2FK5WkPcVuGLiv73rC/replicate-prediction-bnz8va255nrm80crqqcswh9sb8.jpeg",
"https://replicate.delivery/pbxt/NZ4ShW72xlKAp9v1yOKgXHfM22LNOIAIJ6f4kNvxeF9AXx1k/lipgloss.jpeg"
],
"reference_tags": [
"character ",
"product"
],
"resolution": "720p"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pzc**********************************
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 runwayml/gen4-image-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "9:16",
prompt: "@character holding up the small @product",
reference_images: ["https://replicate.delivery/pbxt/NZ4ShCI0XbXjzjphMoHPvbn75HDTAt2FK5WkPcVuGLiv73rC/replicate-prediction-bnz8va255nrm80crqqcswh9sb8.jpeg","https://replicate.delivery/pbxt/NZ4ShW72xlKAp9v1yOKgXHfM22LNOIAIJ6f4kNvxeF9AXx1k/lipgloss.jpeg"],
reference_tags: ["character ","product"],
resolution: "720p"
};
const output = await replicate.run("runwayml/gen4-image-turbo", { 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_Pzc**********************************
This is your API token. Keep it to yourself.
import replicate
Run runwayml/gen4-image-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"runwayml/gen4-image-turbo",
input={
"aspect_ratio": "9:16",
"prompt": "@character holding up the small @product",
"reference_images": ["https://replicate.delivery/pbxt/NZ4ShCI0XbXjzjphMoHPvbn75HDTAt2FK5WkPcVuGLiv73rC/replicate-prediction-bnz8va255nrm80crqqcswh9sb8.jpeg","https://replicate.delivery/pbxt/NZ4ShW72xlKAp9v1yOKgXHfM22LNOIAIJ6f4kNvxeF9AXx1k/lipgloss.jpeg"],
"reference_tags": ["character ","product"],
"resolution": "720p"
}
)
# 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_Pzc**********************************
This is your API token. Keep it to yourself.
Run runwayml/gen4-image-turbo 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": "9:16",
"prompt": "@character holding up the small @product",
"reference_images": ["https://replicate.delivery/pbxt/NZ4ShCI0XbXjzjphMoHPvbn75HDTAt2FK5WkPcVuGLiv73rC/replicate-prediction-bnz8va255nrm80crqqcswh9sb8.jpeg","https://replicate.delivery/pbxt/NZ4ShW72xlKAp9v1yOKgXHfM22LNOIAIJ6f4kNvxeF9AXx1k/lipgloss.jpeg"],
"reference_tags": ["character ","product"],
"resolution": "720p"
}
}' \
https://api.replicate.com/v1/models/runwayml/gen4-image-turbo/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "8vzb3nv90srm80crrh5ad1abkm",
"model": "runwayml/gen4-image-turbo",
"version": "hidden",
"input": {
"aspect_ratio": "9:16",
"prompt": "@character holding up the small @product",
"reference_images": [
"https://replicate.delivery/pbxt/NZ4ShCI0XbXjzjphMoHPvbn75HDTAt2FK5WkPcVuGLiv73rC/replicate-prediction-bnz8va255nrm80crqqcswh9sb8.jpeg",
"https://replicate.delivery/pbxt/NZ4ShW72xlKAp9v1yOKgXHfM22LNOIAIJ6f4kNvxeF9AXx1k/lipgloss.jpeg"
],
"reference_tags": [
"character ",
"product"
],
"resolution": "720p"
},
"logs": "Using seed: 1671597201\nUpdated prompt: @character_holding up the small @product\nUpdated prompt: @character_holding up the small @product\nUsing reference tags: character_, product\nGenerating image with ratio 720:1280 (9:16 at 720p resolution)\nGenerating image with model: gen4_image_turbo\nGenerating...\n0%\nGenerated image in 10.9sec\nDownloading 1025754 bytes\nDownloaded 0.98MB in 0.23sec",
"output": "https://replicate.delivery/xezq/qM87MlivOnaVLlrH43xM9jRvRrIb1x7bwlOpqcx2aT8RiKTF/tmpqfzirhg6.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-19T21:44:27.654Z",
"started_at": "2025-08-19T21:44:27.67854Z",
"completed_at": "2025-08-19T21:44:39.247896Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/8vzb3nv90srm80crrh5ad1abkm/cancel",
"get": "https://api.replicate.com/v1/predictions/8vzb3nv90srm80crrh5ad1abkm",
"stream": "https://stream.replicate.com/v1/files/bcwr-cpmlm3qs453vjcizl2xzmqtgyhfy5uejhttyuxzlp3g26ycb2vga",
"web": "https://replicate.com/p/8vzb3nv90srm80crrh5ad1abkm"
},
"metrics": {
"predict_time": 11.569356264,
"total_time": 11.593896
}
}

