主题
ideogram(文生图)
POST
https://az.gptplus5.com/ideogram/generate
Generates images synchronously based on a given prompt and optional parameters.
具体参数请看官方文档:https://developer.ideogram.ai/api-reference/api-reference/describe
根据给定的提示和可选参数同步生成图像。
返回的图像 URL 在 24 小时内有效,超过该时间将无法访问图像。
已反代图片
请求参数
Header 参数
| 参数名 | 类型 | 必需 | 说明 | 示例 |
|---|---|---|---|---|
Content-Type | string | 必需 | application/json | |
Accept | string | 必需 | application/json | |
Authorization | string | 必需 | Bearer {{YOUR_API_KEY}} |
Body 参数 (application/json)
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
image_request | object | 必需 | 图像请求对象 (必填) |
└ prompt | string | 必需 | 用于生成图像的提示词 (必填) |
└ aspect_ratio | string | 必需 | 图像宽高比 (可选) 可选值:ASPECT_10_16/ASPECT_16_10/ASPECT_9_16/ASPECT_16_9/ASPECT_3_2/ASPECT_2_3/ASPECT_4_3/ASPECT_3_4/ASPECT_1_1/ASPECT_1_3/ASPECT_3_1 |
└ model | string | 必需 | 使用的模型 (可选) 默认V_2,可选值:V_1/V_1_TURBO/V_2/V_2_TURBO |
└ magic_prompt_option | string | 必需 | 是否使用MagicPrompt (可选) 可选值:AUTO/ON/OFF |
└ seed | integer | 必需 | 随机种子 (可选) 范围:0-2147483647 |
└ style_type | string | 必需 | 风格类型 (可选) 可选值:AUTO/GENERAL/REALISTIC/DESIGN/RENDER_3D/ANIME |
└ negative_prompt | string | 必需 | 反向提示词 (可选) 描述不想在图像中出现的内容 |
└ num_images | integer | 必需 | 生成图片数量 (可选) 范围:1-8,默认1 |
└ resolution | string | 必需 | 分辨率 (可选) 可选值包含从512x1536到1536x640等多种分辨率组合 |
└ color_palette | object | 必需 | 颜色调色板 (可选) |
请求示例
json
{
"image_request": {
"aspect_ratio": "ASPECT_10_16",
"magic_prompt_option": "AUTO",
"model": "V_1",
"prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."
}
}cURL 示例
bash
curl --location --request POST 'https://az.gptplus5.com/ideogram/generate' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_request": {
"aspect_ratio": "ASPECT_10_16",
"magic_prompt_option": "AUTO",
"model": "V_1",
"prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset."
}
}'返回响应
🟢200成功
响应 Body
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
created | string | 必需 | |
data | array[object] | 必需 | |
└ is_image_safe | boolean | 可选 | |
└ prompt | string | 可选 | |
└ resolution | string | 可选 | |
└ seed | integer | 可选 | |
└ style_type | null | 可选 | |
└ url | string | 可选 |
响应示例
json
{
"created": "2024-12-15T17:32:00.965408+00:00",
"data": [
{
"is_image_safe": true,
"prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
"resolution": "768x1232",
"seed": 1785282233,
"style_type": null,
"url": "https://ideogram.ai/api/images/ephemeral/WkoxvqiOTaaCqG1nO2tQoA.png?exp=1734370337&sig=110fe96dc9e01002c8d837e5b4cde1aaa266195561d231ce76e19e095e478ffe"
}
]
}