typetext
{
"aspect_ratio": "1:1",
"magic_prompt_option": "Auto",
"prompt": "An illustration of a gold running shoe with the text \"Run AI with an API\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.",
"resolution": "None",
"style_type": "None"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_D4C**********************************
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 ideogram-ai/ideogram-v2-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
magic_prompt_option: "Auto",
prompt: "An illustration of a gold running shoe with the text \"Run AI with an API\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.",
resolution: "None",
style_type: "None"
};
const output = await replicate.run("ideogram-ai/ideogram-v2-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_D4C**********************************
This is your API token. Keep it to yourself.
import replicate
Run ideogram-ai/ideogram-v2-turbo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ideogram-ai/ideogram-v2-turbo",
input={
"aspect_ratio": "1:1",
"magic_prompt_option": "Auto",
"prompt": "An illustration of a gold running shoe with the text \"Run AI with an API\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.",
"resolution": "None",
"style_type": "None"
}
)
# 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_D4C**********************************
This is your API token. Keep it to yourself.
Run ideogram-ai/ideogram-v2-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": "1:1",
"magic_prompt_option": "Auto",
"prompt": "An illustration of a gold running shoe with the text \\"Run AI with an API\\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.",
"resolution": "None",
"style_type": "None"
}
}' \
https://api.replicate.com/v1/models/ideogram-ai/ideogram-v2-turbo/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "fkgz67vb7nrga0cjph091f1jg8",
"model": "ideogram-ai/ideogram-v2-turbo",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"magic_prompt_option": "Auto",
"prompt": "An illustration of a gold running shoe with the text \"Run AI with an API\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.",
"resolution": "None",
"style_type": "None"
},
"logs": "Using seed: 365\nRunning prediction... \nGenerating...\nPrompt used: An illustration of a gold running shoe with the text \"Run AI with an API\" written on the shoe. The shoe is placed on a pink background. The text is white and bold. The overall image has a modern and techy vibe, with elements of speed.\nImage generation took 11.19 seconds",
"output": "https://replicate.delivery/czjl/9aabtkgKeV2HS6bASFV9uEvkufPMZlE2MelytHKnUs4yeTlOB/R8_ideogram.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-22T12:42:53.629Z",
"started_at": "2024-10-22T12:42:53.63805Z",
"completed_at": "2024-10-22T12:43:05.999253Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/fkgz67vb7nrga0cjph091f1jg8/cancel",
"get": "https://api.replicate.com/v1/predictions/fkgz67vb7nrga0cjph091f1jg8",
"web": "https://replicate.com/p/fkgz67vb7nrga0cjph091f1jg8"
},
"metrics": {
"image_count": 1,
"predict_time": 12.361202155,
"total_time": 12.370253
}
}