gpt-image-2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegpt-image-2 — Image Generation & Editing
gpt-image-2 — 图片生成与编辑
OpenAI 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.
gpt-image-2Setup: See authentication for token setup.
通过AceDataCloud调用OpenAI 。提供两个同步接口(直接返回图片URL)。其突出优势在于编辑功能:上传真实图片(logo、二维码、产品照片、截图),它能精准地将其合成/重新设计风格——非常适合制作符合品牌调性的视频素材以及保持角色一致性。
gpt-image-2设置: 请查看身份验证文档了解令牌设置方法。
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 (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.
image[]@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): → download .
{"data":[{"url":"https://...png"}]}data[0].url采用多部分表单提交。通过重复的参数传递一张或多张源图片(本地文件用前缀,或直接传入URL)。可用于将真实logo/二维码融入生成的场景、在不同场景中保持主体一致性,或重新设计截图风格。
image[]@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].urlSizes
尺寸规格
sizeWxH"auto"| Aspect | Sizes |
|---|---|
| 16:9 | |
| 9:16 | |
| 1:1 | |
(Omit or use to let the model pick. Invalid sizes 400.)
size"auto"size宽x高"auto"| 宽高比 | 尺寸 |
|---|---|
| 16:9 | |
| 9:16 | |
| 1:1 | |
(省略参数或使用将由模型自动选择。无效尺寸会返回400错误。)
size"auto"Tips
使用技巧
- Editing keeps things faithful — to place a logo/QR exactly, pass it as one of the
and say "keep its exact colors/shape, do not redraw it".
image[] - For character/scene consistency across video beats, generate one hero image, then
it per beat instead of regenerating from scratch.
edits - Text in images renders legibly — good for titles/labels you don't want to overlay in HTML.
- Both endpoints are synchronous; no polling.
/tasks
- 编辑功能精准还原 — 若要精准放置logo/二维码,将其作为参数之一传入,并在提示词中说明“保留其精确颜色和形状,不要重新绘制”。
image[] - 若要在视频不同片段中保持角色/场景一致性,先生成一张主图,然后针对每个片段对其进行编辑,而非从头重新生成。
- 图片中的文字呈现清晰——适合制作无需通过HTML叠加的标题/标签。
- 两个接口均为同步接口;无需调用接口轮询结果。
/tasks