gpt-image-2

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

gpt-image-2 — Image Generation & Editing

gpt-image-2 — 图片生成与编辑

OpenAI
gpt-image-2
through AceDataCloud. Two endpoints, both synchronous (return image url(s) directly). Its standout is editing: feed real images (logos, QR codes, product shots, screenshots) and it composites/restyles them faithfully — great for on-brand video assets and character consistency.
Setup: See authentication for token setup.
通过AceDataCloud调用OpenAI
gpt-image-2
。提供两个同步接口(直接返回图片URL)。其突出优势在于编辑功能:上传真实图片(logo、二维码、产品照片、截图),它能精准地将其合成/重新设计风格——非常适合制作符合品牌调性的视频素材以及保持角色一致性。
设置: 请查看身份验证文档了解令牌设置方法。

1. Generate (text → image)

1. 生成(文本→图片)

bash
curl -X POST https://api.acedata.cloud/openai/images/generations \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-image-2","prompt":"a clean dark tech hero background with a glowing API hub, lots of negative space","size":"1792x1024","n":1}'
bash
curl -X POST https://api.acedata.cloud/openai/images/generations \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-image-2","prompt":"a clean dark tech hero background with a glowing API hub, lots of negative space","size":"1792x1024","n":1}'

2. Edit / composite (images + prompt → image) ← the powerful one

2. 编辑/合成(图片+提示词→图片)← 核心强大功能

Multipart. Pass one or more source images via repeated
image[]
(local files with
@
, or URLs). Use it to fuse a real logo/QR into a generated scene, keep a subject consistent across scenes, or restyle a screenshot.
bash
curl -X POST https://api.acedata.cloud/openai/images/edits \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -F "model=gpt-image-2" \
  -F "prompt=Place this logo crisply in the top-left on the tech background; keep the logo's exact colors and shape." \
  -F "image[]=@background.png" \
  -F "image[]=@logo.png" \
  -F "size=1792x1024" \
  -F "n=1"
Response (both endpoints):
{"data":[{"url":"https://...png"}]}
→ download
data[0].url
.
采用多部分表单提交。通过重复的
image[]
参数传递一张或多张源图片(本地文件用
@
前缀,或直接传入URL)。可用于将真实logo/二维码融入生成的场景、在不同场景中保持主体一致性,或重新设计截图风格。
bash
curl -X POST https://api.acedata.cloud/openai/images/edits \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -F "model=gpt-image-2" \
  -F "prompt=Place this logo crisply in the top-left on the tech background; keep the logo's exact colors and shape." \
  -F "image[]=@background.png" \
  -F "image[]=@logo.png" \
  -F "size=1792x1024" \
  -F "n=1"
响应(两个接口通用):
{"data":[{"url":"https://...png"}]}
→ 下载
data[0].url
对应的图片即可。

Sizes

尺寸规格

size
is
WxH
(a preset) or
"auto"
. Common presets:
AspectSizes
16:9
1792x1024
(HD),
2048x1152
,
3840x2160
(4K)
9:16
1024x1792
,
1152x2048
,
2160x3840
1:1
1024x1024
,
2048x2048
,
4096x4096
(Omit
size
or use
"auto"
to let the model pick. Invalid sizes 400.)
size
参数为
宽x高
(预设值)或
"auto"
。常用预设值如下:
宽高比尺寸
16:9
1792x1024
(高清),
2048x1152
,
3840x2160
(4K)
9:16
1024x1792
,
1152x2048
,
2160x3840
1:1
1024x1024
,
2048x2048
,
4096x4096
(省略
size
参数或使用
"auto"
将由模型自动选择。无效尺寸会返回400错误。)

Tips

使用技巧

  • Editing keeps things faithful — to place a logo/QR exactly, pass it as one of the
    image[]
    and say "keep its exact colors/shape, do not redraw it".
  • For character/scene consistency across video beats, generate one hero image, then
    edits
    it per beat instead of regenerating from scratch.
  • Text in images renders legibly — good for titles/labels you don't want to overlay in HTML.
  • Both endpoints are synchronous; no
    /tasks
    polling.
  • 编辑功能精准还原 — 若要精准放置logo/二维码,将其作为
    image[]
    参数之一传入,并在提示词中说明“保留其精确颜色和形状,不要重新绘制”。
  • 若要在视频不同片段中保持角色/场景一致性,先生成一张主图,然后针对每个片段对其进行编辑,而非从头重新生成。
  • 图片中的文字呈现清晰——适合制作无需通过HTML叠加的标题/标签。
  • 两个接口均为同步接口;无需调用
    /tasks
    接口轮询结果。