typefile
{
"alignment": "left",
"font_size": 100,
"image": "https://replicate.delivery/pbxt/NXeqzM0LEAO7F2Zds2chKV8xdMEASpGSzH8xK666872sXOOj/7285c58df_logo.png",
"line_spacing": 4,
"max_width": 0,
"outline_color": "black",
"outline_width": 4,
"text": "HERE\nBE \nDRAGONS",
"text_color": "white"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_c92**********************************
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 tristanbob/text-behind-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
alignment: "left",
font_size: 100,
image: "https://replicate.delivery/pbxt/NXeqzM0LEAO7F2Zds2chKV8xdMEASpGSzH8xK666872sXOOj/7285c58df_logo.png",
line_spacing: 4,
max_width: 0,
outline_color: "black",
outline_width: 4,
text: "HERE\nBE \nDRAGONS",
text_color: "white"
};
const output = await replicate.run("tristanbob/text-behind-image", { 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_c92**********************************
This is your API token. Keep it to yourself.
import replicate
Run tristanbob/text-behind-image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tristanbob/text-behind-image",
input={
"alignment": "left",
"font_size": 100,
"image": "https://replicate.delivery/pbxt/NXeqzM0LEAO7F2Zds2chKV8xdMEASpGSzH8xK666872sXOOj/7285c58df_logo.png",
"line_spacing": 4,
"max_width": 0,
"outline_color": "black",
"outline_width": 4,
"text": "HERE\nBE \nDRAGONS",
"text_color": "white"
}
)
# 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_c92**********************************
This is your API token. Keep it to yourself.
Run tristanbob/text-behind-image 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": {
"alignment": "left",
"font_size": 100,
"image": "https://replicate.delivery/pbxt/NXeqzM0LEAO7F2Zds2chKV8xdMEASpGSzH8xK666872sXOOj/7285c58df_logo.png",
"line_spacing": 4,
"max_width": 0,
"outline_color": "black",
"outline_width": 4,
"text": "HERE\\nBE \\nDRAGONS",
"text_color": "white"
}
}' \
https://api.replicate.com/v1/models/tristanbob/text-behind-image/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "jkr0sz9p61rma0crnz58makecg",
"model": "tristanbob/text-behind-image",
"version": "hidden",
"input": {
"alignment": "left",
"font_size": 100,
"image": "https://replicate.delivery/pbxt/NXeqzM0LEAO7F2Zds2chKV8xdMEASpGSzH8xK666872sXOOj/7285c58df_logo.png",
"line_spacing": 4,
"max_width": 0,
"outline_color": "black",
"outline_width": 4,
"text": "HERE\nBE \nDRAGONS",
"text_color": "white"
},
"logs": "",
"output": "https://replicate.delivery/xezq/PfMTpa6dVET9VikGL3XSVGk5i06ALnFFJN8Hp3kNWfW1KWLVA/final_composite.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-15T22:12:01.712Z",
"started_at": "2025-08-15T22:12:02.132926Z",
"completed_at": "2025-08-15T22:12:05.457742Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/jkr0sz9p61rma0crnz58makecg/cancel",
"children": "https://api.replicate.com/v1/predictions/jkr0sz9p61rma0crnz58makecg/children",
"get": "https://api.replicate.com/v1/predictions/jkr0sz9p61rma0crnz58makecg",
"root": "https://api.replicate.com/v1/predictions/jkr0sz9p61rma0crnz58makecg",
"stream": "https://stream.replicate.com/v1/files/bcwr-4p4fzhtdo3mizeicnfkk5x2t4xbyufbvaoeqr4tics5unfuy6zwa",
"web": "https://replicate.com/p/jkr0sz9p61rma0crnz58makecg"
},
"metrics": {
"predict_time": 3.324815589,
"total_time": 3.745742
}
}
