typetext
{
"aspect_ratio": "3:2",
"magic_prompt_option": "Auto",
"prompt": "Vector art of a friendly robot, in a speech bubble it says \"Hello! I'm Ideogram V2A\" in a friendly font, in a second speech bubble it says \"I'm faster!\", the robot is in a 3D garden",
"resolution": "None",
"style_type": "None"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Unq**********************************
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-v2a using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "3:2",
magic_prompt_option: "Auto",
prompt: "Vector art of a friendly robot, in a speech bubble it says \"Hello! I'm Ideogram V2A\" in a friendly font, in a second speech bubble it says \"I'm faster!\", the robot is in a 3D garden",
resolution: "None",
style_type: "None"
};
const output = await replicate.run("ideogram-ai/ideogram-v2a", { 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_Unq**********************************
This is your API token. Keep it to yourself.
import replicate
Run ideogram-ai/ideogram-v2a using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ideogram-ai/ideogram-v2a",
input={
"aspect_ratio": "3:2",
"magic_prompt_option": "Auto",
"prompt": "Vector art of a friendly robot, in a speech bubble it says \"Hello! I'm Ideogram V2A\" in a friendly font, in a second speech bubble it says \"I'm faster!\", the robot is in a 3D garden",
"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_Unq**********************************
This is your API token. Keep it to yourself.
Run ideogram-ai/ideogram-v2a 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": "3:2",
"magic_prompt_option": "Auto",
"prompt": "Vector art of a friendly robot, in a speech bubble it says \\"Hello! I\'m Ideogram V2A\\" in a friendly font, in a second speech bubble it says \\"I\'m faster!\\", the robot is in a 3D garden",
"resolution": "None",
"style_type": "None"
}
}' \
https://api.replicate.com/v1/models/ideogram-ai/ideogram-v2a/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "1yv65m0qx5rmc0cn8wr9eqa3vw",
"model": "ideogram-ai/ideogram-v2a",
"version": "hidden",
"input": {
"aspect_ratio": "3:2",
"magic_prompt_option": "Auto",
"prompt": "Vector art of a friendly robot, in a speech bubble it says \"Hello! I'm Ideogram V2A\" in a friendly font, in a second speech bubble it says \"I'm faster!\", the robot is in a 3D garden",
"resolution": "None",
"style_type": "None"
},
"logs": "Using seed: 1481275024\nModerating content...\nModeration complete in 0.21sec\nRunning prediction...\nGenerating...\nPrompt used: Vector art of a friendly robot, in a speech bubble it says \"Hello! I'm Ideogram V2A\" in a friendly font, in a second speech bubble it says \"I'm faster!\", the robot is in a 3D garden\nImage generation took 9.84 seconds\nDownloading 608948 bytes\nDownloaded 0.58MB in 0.39sec",
"output": "https://replicate.delivery/xezq/QYvIf0JBe8kd4UDVLm1XxxdtYfva6jVmVUZwJfonkuQOef3EF/tmp682z_d3p.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-27T11:34:49.065Z",
"started_at": "2025-02-27T11:34:49.074188Z",
"completed_at": "2025-02-27T11:34:59.521793Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/1yv65m0qx5rmc0cn8wr9eqa3vw/cancel",
"get": "https://api.replicate.com/v1/predictions/1yv65m0qx5rmc0cn8wr9eqa3vw",
"stream": "https://stream.replicate.com/v1/files/bcwr-3leikxoixt4tqacxqecm3nwcw4imwhyghmoa2hwwqdo3srdkvrkq",
"web": "https://replicate.com/p/1yv65m0qx5rmc0cn8wr9eqa3vw"
},
"metrics": {
"image_count": 1,
"predict_time": 10.447605138,
"total_time": 10.456793
}
}