注册

Replicate Ideogram V2 功能

POST https://api.quickrouter.ai/replicate/v1/models/ideogram-ai/ideogram-v2-turbo/predictions 在线调试 →
Authorization

在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token

示例: Authorization: Bearer ********************

请求参数

Header 参数
Authorization string
可选
示例: Bearer {{YOUR_API_KEY}}
Content-Type string
可选
示例: application/json
Body 参数 application/json
input object
可选
模型输入参数
prompt string
必需
图像生成的文字提示。
resolution string
可选
分辨率。覆盖宽高比。如果指定了修复图像,则忽略该参数。默认值:"None"。
style_type string
可选
样式有助于定义您想要生成的图像的特定美感。默认值:"None"。
aspect_ratio string
可选
长宽比。如果指定了分辨率或修复图像,则忽略。默认值:"1:1"。
magic_prompt_option string
可选
Magic Prompt 会解释您的提示并进行优化,以最大限度地提高生成的图像的多样性和质量。您还可以使用它用不同的语言编写提示。默认值:"Auto"。
示例
{
    "input": {
        "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",
        "aspect_ratio": "1:1",
        "magic_prompt_option": "Auto"
    }
}

请求示例代码

curl --location --request POST 'https://api.quickrouter.ai/replicate/v1/models/ideogram-ai/ideogram-v2-turbo/predictions' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{
    "input": {
        "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",
        "aspect_ratio": "1:1",
        "magic_prompt_option": "Auto"
    }
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "input": {
    "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",
    "aspect_ratio": "1:1",
    "magic_prompt_option": "Auto"
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.quickrouter.ai/replicate/v1/models/ideogram-ai/ideogram-v2-turbo/predictions", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
import http.client
import json

conn = http.client.HTTPSConnection("api.quickrouter.ai")
payload = json.dumps({
  "input": {
    "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",
    "aspect_ratio": "1:1",
    "magic_prompt_option": "Auto"
  }
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}
conn.request("POST", "/replicate/v1/models/ideogram-ai/ideogram-v2-turbo/predictions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

返回响应

响应参数 application/json
id string
可选
任务ID
status string
可选
任务状态
output string
可选
任务输出
示例
{
    "id": "2jycc2v9nnrmc0crap5tv5zaxr",
    "status": "starting"
}