Ideogram 4.6 Edit API
ideogram/v4.6/editIdeogram 4.6 Edit API 按文字指令修改照片:添加招牌和手写字、替换材质、改变场景风格或在蒙版内重绘,并可用最多 4 张参考图引导结果,画面其余部分保持原样。Ideogram 4.6 Edit API 的 2K 图片每张 1.6 积分($0.008)起。
获取 API Key拖拽文件、粘贴剪贴板素材,或输入 URL。 恰好一张源图(公开 HTTP(S) URL)。
1/1 个素材
拖拽文件、粘贴剪贴板素材,或输入 URL。 可选,标出修改区域的蒙版,需要 size 为 auto。
拖拽文件、粘贴剪贴板素材,或输入 URL。 最多 4 张参考图,有蒙版时最多 3 张。
预计费用: 12 credits · $0.0600 · 4K
读取到源图尺寸前先按 4K 单价预扣,任务完成后按最终费用结算并退还差额。
REST API
快速开始
以下流程提交一个合法的 Ideogram 4.6 Edit 请求,取得 task_id,并在异步任务结束后读取结果文件 URL。
连接 Vidgo API
创建 API Key,仅保存在服务端,并通过 Authorization: Bearer VIDGO_API_KEY 发送。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交一个任务
向统一提交端点发送当前模型 ID 与 input 对象。input 只能包含本端点参数表列出的字段,其他字段会返回 400。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "ideogram/v4.6/edit",
"input": {
"prompt": "Write on the blank chalkboard sign in neat white chalk lettering: \"PASTÉIS DE NATA\" on the first line, \"1,40 €\" on the second line, and \"Fresh from 7am\" in smaller script at the bottom, with a small chalk sketch of a custard tart beside the price. Keep the street, the tiles, the sleeping cat and the morning light unchanged.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/ideogram/v4.6/edit/v1/01/input.jpg"
],
"quality": "low"
}
}'等待结果
读取 data.task_id,仅在 not_started 或 running 时继续轮询;finished 与 failed 都必须停止。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}建议每 2–5 秒查询一次,并对 429/5xx 退避。也可在顶层提供 callback_url,在任务进入终态时接收回调。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-11-03T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"created_time": "2026-11-03T08:00:00",
"progress": 100,
"files": [
{
"file_url": "https://example.com/result.png",
"file_type": "image"
}
]
}
}完整可运行轮询示例
展开后可查看同一 payload 的端到端脚本,包含业务 code、缺失 task_id、失败状态、异常状态和网络错误处理。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "ideogram/v4.6/edit",
"input": {
"prompt": "Write on the blank chalkboard sign in neat white chalk lettering: \"PASTÉIS DE NATA\" on the first line, \"1,40 €\" on the second line, and \"Fresh from 7am\" in smaller script at the bottom, with a small chalk sketch of a custard tart beside the price. Keep the street, the tiles, the sleeping cat and the morning light unchanged.",
"image_urls": [
"https://cdn.vidgo.ai/apis/models/ideogram/v4.6/edit/v1/01/input.jpg"
],
"quality": "low"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
下表仅列出 input 对象内的公开字段。顶层 model 与可选 callback_url 请参考快速开始示例。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| input.prompt | string | 是 | – | 编辑指令,非空,最多 10,000 个字符。要添加的文字请放进引号。 |
| input.image_urls | string[] | 是 | – | 恰好一张源图,数组中放一个公开的 HTTP(S) URL 或图片 data URI。 |
| input.mask_url | string | 否 | – | 标出修改区域的蒙版图,URL 或图片 data URI。需要 size 为 auto。 |
| input.reference_image_urls | string[] | 否 | – | 最多 4 张参考图;设置 mask_url 时最多 3 张。用于引导结果。 |
| input.edit_precision | string | 否 | regular | regular 或 high。high 需要 size 为 auto,且不能同时传 background。 |
| input.context_window | string | 否 | none | none 或 auto。auto 基于蒙版确定编辑窗口,需要 edit_precision 为 high 并提供 mask_url。 |
| input.quality | string | 否 | medium | very_low、low、medium 或 high。very_low 按 2K 档计价。 |
| input.size | string | 否 | auto | auto 跟随源图。预设(1:1、1:1 HD、4:3、3:4、16:9、9:16)或 WIDTHxHEIGHT(边长 256–4096、32 的倍数、宽高比不超过 6:1)适用于 edit_precision 为 regular 且无蒙版的请求。 |
| input.n | integer | 否 | 1 | 编辑结果张数,1–8。 |
| input.background | string | 否 | – | transparent 或 opaque,适用于 edit_precision 为 regular。 |
| input.seed | integer | 否 | – | 0 到 2147483647 的整数,用于复现结果。 |
响应字段
提交响应返回任务标识;状态响应在任务结束时提供结果文件或失败信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务返回码,0 或 200 表示成功。 |
| message | string | 可选的人类可读响应信息。 |
| data.task_id | string | 提交成功后用于查询状态的唯一任务 ID。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间。 |
| data.progress | integer | 状态响应中的 0–100 进度值。 |
| data.files[] | array | finished 时按返回顺序排列的生成文件。 |
| data.files[].file_url | string | 生成文件(.png)的直接 URL。 |
| data.files[].file_type | string | 结果文件类型为 image。 |
| data.error_message | string | null | failed 状态的可读失败原因。 |
任务生命周期
只有前两个状态可继续轮询;finished 与 failed 均为终态。
not_started已接收并排队,等待执行。
running正在生成,可以继续轮询。
finished成功终态,验证 files 并读取文件 URL。
failed失败终态,读取 error_message 并停止;预扣积分会全部退还。
轮询与错误处理
- 认证使用有效的 VIDGO_API_KEY,将密钥保存在服务端,并通过 Bearer 认证发送请求。
- 参数校验400 表示模型 ID、字段、枚举、长度、数量或尺寸不符合本端点契约,包括传入其他端点的字段。
- 轮询间隔从 2–5 秒开始;对 429 和 5xx 使用指数退避,并设置总超时。
- 终态finished 后读取 files 中的文件 URL;failed 后读取 error_message。两种状态均结束轮询。
- 回调在顶层提供公开 callback_url;服务会在 finished 或 failed 后 POST 任务对象。
- 网络错误区分请求超时、网络失败和任务失败;仅在安全时重试同一查询。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | ideogram/v4.6/edit | Ideogram 4.6 Edit |
| 输入 | prompt + image_urls(1 张) | 可选 mask_url 和最多 4 张 reference_image_urls |
| 输出 | PNG 图片 × n(1–8) | 图片 URL 位于 files[] |
| quality | very_low / low / medium / high | 2K:每张 1.6 / 6 / 12 / 44 积分;4K:每张 12 / 40 / 120 积分 |
| size | auto、6 种预设或 WIDTHxHEIGHT | auto 跟随源图;面积超过 2048×2048 为 4K |
Ideogram 4.6 Edit API 常见问题
Ideogram 4.6 Edit API 是什么?
Ideogram 4.6 Edit API 提供 Ideogram 4.6 的编辑能力,这是 Ideogram 可生成最高 4K 图片、最多接受 5 张参考图的模型。在 Vidgo 上,它根据提示词编辑一张源图,可选蒙版和最多 4 张参考图,每次返回 1–8 张结果。你可以通过 API 调用,也可以在上方体验区直接试用。
Ideogram 4.6 Edit API 多少钱?
2K 档 very_low、low、medium、high 每张分别为 1.6、6、12、44 积分;4K 档 low、medium、high 每张分别为 12、40、120 积分。总价为单价乘以 n。
编辑时 2K 和 4K 档位如何确定?
预设或自定义尺寸直接决定档位,very_low 始终为 2K。size 为 auto 时由源图决定:面积不超过 2048×2048 像素为 2K,更大为 4K。若提交时无法读取尺寸,先按 4K 单价预扣,完成后按最终费用结算。
Ideogram 4.6 Edit API 能在照片上添加文字吗?
可以。引用要写的文字并描述字体风格和所在表面,就像里斯本黑板示例那样,在空白黑板上写出糕点名、价格和开门时间。
Ideogram 4.6 Edit API 的蒙版怎么用?
mask_url 标出你要修改的区域,并要求 size 为 auto。配合 edit_precision high 还可以设置 context_window auto,它会基于蒙版确定编辑窗口。有蒙版时 reference_image_urls 最多 3 张。
一次 Ideogram 4.6 Edit API 请求能用几张图?
image_urls 中一张源图,加上 reference_image_urls 中最多 4 张,共 5 张;设置蒙版时参考图最多 3 张。



