- 发出请求
- 模 型接口
- 聊天接口(Chat)
- 自动补全接口(Completions)
- 图像接口(Images)
- 向量生成接口(Embeddings)
- 音频接口(Audio)
- Suno音乐接口
- Luma视频接口
- SD图像接口
- 帮助中心
- SDXL & SD1.6
- styles
- images
- 视频生 成
- 任务管理
- 内容补全接口POST
- 获取音乐GET
- 获取音乐GET
- flux-pro-1.1POST
- flux-proPOST
- flux-devPOST
- flux-查询GET
- Generate(文生图)POST
- Remix(混合图)POST
- Upscale(放大高清)POST
- Describe(描述)POST
- 图像生成POST
- 文生视频POST
- 图生视频POST
- 查询任务GET
- 图片描述POST
- 文生图POST
- 合成图POST
- 放大图片POST
- ideogram任务查询POST
Generate(文生图)
POST
/ideogram/v1/generate
根据给定的提示和可选参数同步生成图像。
返回的图像 URL 在 24 小时内有效,超过该时间将无法访问图像。
图像URL为官方原链接,请注意网络环境是否能访问。
请求参数
Header 参数
Authorization
string
必需
默认值:
{{YOUR_API_KEY}}
Body 参数application/json
image_request
object
必需
prompt
string
必需
aspect_ratio
string
可选
默认值:
ASPECT_1_1
model
string
可选
默认值:
V_2
示例值:
V_1V_2V_1_TURBOV_2_TURBO
magic_prompt_option
string
可选
默认值:
AUTO
示例值:
AUTOONOFF
seed
integer
可选
style_type
string
可选
示例值:
GENERALREALISTICDESIGNRENDER_3DANIME
negative_prompt
string
可选
resolution
string
可选
示例值:
RESOLUTION_576_1472
示例
{
"image_request": {
"model": "V_2",
"magic_prompt_option": "AUTO",
"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.",
"aspect_ratio": "ASPECT_10_16",
"seed": 12345,
"style_type": "GENERAL",
"negative_prompt": "string",
"resolution": "string"
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/ideogram/v1/generate' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_request": {
"model": "V_2",
"magic_prompt_option": "AUTO",
"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.",
"aspect_ratio": "ASPECT_10_16",
"seed": 12345,
"style_type": "GENERAL",
"negative_prompt": "string",
"resolution": "string"
}
}'
返回响应
🟢200成功
application/json
Body
data
array [object {5}]
必需
seed
integer
必需
prompt
string
必需
resolution
string
必需
url
string
必需
is_image_safe
boolean
必需
created
string
必需
示例
{
"data": [
{
"seed": 12345,
"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's 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": "1024x1024",
"url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
"is_image_safe": true
},
{
"seed": 12345,
"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's 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": "1024x1024",
"url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
"is_image_safe": true
}
],
"created": "2000-01-23T04:56:07.000Z"
}
修改于 2025-02-19 06:58:42