Skip to content

Ideogram 角色编辑 ​

接口 ​

POST /images/generations

完整 URL: https://modelfold.ai/v1/images/generations

鉴权:所有请求都需要 Authorization: Bearer <API_KEY> 请求头。

模型参数直接放在 JSON 请求体中,不要套 input。请求等待生成完成后返回 data[].url;支持的媒体模型也可使用 异步创建、轮询及回调。示例素材地址须替换为自己的公开可访问文件。计费及错误说明见 API 网关。

生成任务的输入参数

请求参数 ​

请求体 (application/json) ​

参数类型必填说明
modelstring是用于生成任务的模型名称。必填字段。
- 该端点必须使用 ideogram/character-edit 模型 默认值:"ideogram/character-edit"。 可选值:ideogram/character-edit。 示例:ideogram/character-edit。
promptstring是本站网关要求传入 prompt,最长 2000 字。用于填充图像蒙版区域的文本提示词(最大长度:5000 字符) maxLength: 2000. 示例:造型惊艳,头部微微低垂,面带微笑向前看<br>。
image_urlstring是用于生成图像的基础图像 URL。应与蒙版宽高比一致。(为上传后的文件 URL,非文件内容;支持的类型:image/jpeg、image/png、image/webp;最大文件大小:10.0MB) 示例:https://file.aiquickdraw.com/custom-page/akr/section-images/17557680349256sa0lk53.webp。
mask_urlstring是用于图像修复的蒙版 URL。应与底图宽高比一致。(为上传后的文件 URL,非文件内容;支持的类型:image/jpeg、image/png、image/webp;最大文件大小:10.0MB) 示例:https://file.aiquickdraw.com/custom-page/akr/section-images/1755768046014ftgvma28.webp。
reference_image_urlsarray&lt;string&gt;是作为人物参考的图像集合。目前仅支持 1 张图像,其余图像将被忽略。(所有参考图像总大小不超过 10MB)。图像格式需为 JPEG、PNG 或 WebP(为上传后的文件 URL,非文件内容;支持的类型:image/jpeg、image/png、image/webp;最大文件大小:10.0MB) maxItems: 1.
rendering_speedstring否渲染速度。默认值:"BALANCED" 默认值:"BALANCED"。 可选值:TURBO / BALANCED / QUALITY。 示例:BALANCED。
stylestring否生成图像的风格类型。默认值:"AUTO" 默认值:"AUTO"。 可选值:AUTO / REALISTIC / FICTION。 示例:AUTO。
expand_promptboolean否是否启用 MagicPrompt 功能优化生成请求。默认值:true(布尔值:true/false) 示例:true。
seedinteger否随机数生成器的种子值

请求示例 ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "ideogram/character-edit",
  "prompt": "造型惊艳,头部微微低垂,面带微笑向前看\n",
  "image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/17557680349256sa0lk53.webp",
  "mask_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1755768046014ftgvma28.webp",
  "reference_image_urls": [
    "https://example.com/reference.png"
  ],
  "rendering_speed": "BALANCED",
  "style": "AUTO"
}'
json
{
  "model": "ideogram/character-edit",
  "prompt": "造型惊艳,头部微微低垂,面带微笑向前看\n",
  "image_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/17557680349256sa0lk53.webp",
  "mask_url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1755768046014ftgvma28.webp",
  "reference_image_urls": [
    "https://example.com/reference.png"
  ],
  "rendering_speed": "BALANCED",
  "style": "AUTO"
}

响应 ​

200 — 生成完成。usage 返回实际计费明细;结果地址仅作结构示例。 ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — 一个 API,接入所有主流 AI 模型。