typetext
{
"aspect_ratio": "2:3",
"magic_prompt_option": "Auto",
"prompt": "A beautiful typographic poster with the text \"Run Ideogram on Replicate\", against an epic space scene",
"resolution": "None",
"style_type": "None"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ke0**********************************
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 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "2:3",
magic_prompt_option: "Auto",
prompt: "A beautiful typographic poster with the text \"Run Ideogram on Replicate\", against an epic space scene",
resolution: "None",
style_type: "None"
};
const output = await replicate.run("ideogram-ai/ideogram-v2", { 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_Ke0**********************************
This is your API token. Keep it to yourself.
import replicate
Run ideogram-ai/ideogram-v2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ideogram-ai/ideogram-v2",
input={
"aspect_ratio": "2:3",
"magic_prompt_option": "Auto",
"prompt": "A beautiful typographic poster with the text \"Run Ideogram on Replicate\", against an epic space scene",
"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_Ke0**********************************
This is your API token. Keep it to yourself.
Run ideogram-ai/ideogram-v2 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": "2:3",
"magic_prompt_option": "Auto",
"prompt": "A beautiful typographic poster with the text \\"Run Ideogram on Replicate\\", against an epic space scene",
"resolution": "None",
"style_type": "None"
}
}' \
https://api.replicate.com/v1/models/ideogram-ai/ideogram-v2/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "e6je6p0q39rgc0cjph3s7rw43w",
"model": "ideogram-ai/ideogram-v2",
"version": "hidden",
"input": {
"aspect_ratio": "2:3",
"magic_prompt_option": "Auto",
"prompt": "A beautiful typographic poster with the text \"Run Ideogram on Replicate\", against an epic space scene",
"resolution": "None",
"style_type": "None"
},
"logs": "Using seed: 31855\nRunning prediction... \nGenerating...\nPrompt used: A typographic poster with the text \"Run Ideogram on Replicate\" in a modern, minimalist font. The text is white and placed on a deep blue background. The background is an epic space scene with stars, galaxies, and a planet. The planet has a ring around it. There are also space ships flying in the sky. The overall image has a vast and mysterious atmosphere.\nImage generation took 19.49 seconds",
"output": "https://replicate.delivery/czjl/O92SKpq8A4bRLJzpITyfkO0NP83TZJi68WvHlVfNM2ZXGVpTA/R8_ideogram.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-22T12:50:10.842Z",
"started_at": "2024-10-22T12:50:10.848926Z",
"completed_at": "2024-10-22T12:50:31.286742Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/e6je6p0q39rgc0cjph3s7rw43w/cancel",
"get": "https://api.replicate.com/v1/predictions/e6je6p0q39rgc0cjph3s7rw43w",
"web": "https://replicate.com/p/e6je6p0q39rgc0cjph3s7rw43w"
},
"metrics": {
"image_count": 1,
"predict_time": 20.437815705,
"total_time": 20.444742
}
}