用 GPT Image 2.6 整理图片创意与编辑要求。描述新画面或参考图需要修改的内容,在 APIMart 工作台中检查画面比例、分辨率、质量和文件设置。
GPT Image 2.6 API 配置概览
描述主体、构图、光线以及需要呈现的文字。
透明背景需选择 PNG 或 WebP 格式。
参考图片
最多添加 16 张图片,支持公开 HTTP(S) 地址或本地 PNG、JPEG、WebP 文件,每张不超过 10 MB。
生成的图片将在这里显示
示例沿用 APIMart 通用图片异步任务格式。先核对模型配置值与工作台选项,再参考任务 ID 和结果查询结构。
将 APIMart 密钥保存为环境变量 APIMART_API_KEY。提交请求与查询任务时,使用 Authorization: Bearer <key>。
示例向 POST /v1/images/generations 发送 model: gpt-image-2.6、prompt 与输出设置。图片编辑时加入 image_urls。通用任务响应通过 data[0].task_id 返回任务 ID。
使用 GET /v1/tasks/{task_id} 查询。任务完成时读取 data.result.images[0].url[0];任务失败时查看 data.error.message。
APIMart 鉴权与通用 API 使用方式请参阅APIMart 文档。
curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6",
"prompt": "浅色木桌上的陶瓷咖啡杯,柔和的窗边光线,右侧保留充足留白,杂志风格产品摄影。",
"size": "1:1",
"resolution": "1k",
"quality": "auto",
"n": 1,
"output_format": "png",
"background": "auto"
}'import os
import time
import requests
API_BASE = "https://api.apimart.ai"
headers = {"Authorization": f"Bearer {os.environ['APIMART_API_KEY']}"}
# 1. Submit the generation task
payload = {
"model": "gpt-image-2.6",
"prompt": "浅色木桌上的陶瓷咖啡杯,柔和的窗边光线,右侧保留充足留白,杂志风格产品摄影。",
"size": "1:1",
"resolution": "1k",
"quality": "auto",
"n": 1,
"output_format": "png",
"background": "auto"
}
resp = requests.post(f"{API_BASE}/v1/images/generations", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
task_id = resp.json()["data"][0]["task_id"]
# 2. Poll the task until it finishes
for _ in range(200):
task_resp = requests.get(f"{API_BASE}/v1/tasks/{task_id}", headers=headers, timeout=30)
task_resp.raise_for_status()
task = task_resp.json()["data"]
if task["status"] == "completed":
print(task["result"]["images"][0]["url"][0])
break
if task["status"] == "failed":
raise RuntimeError(task.get("error", {}).get("message", "generation failed"))
time.sleep(3)
else:
raise TimeoutError(f"task {task_id} did not finish in time; continue GET polling with this task ID")curl -X POST https://api.apimart.ai/v1/images/generations \
-H "Authorization: Bearer $APIMART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6",
"prompt": "将参考图中的产品放到浅色石材台面上,保留产品形状、颜色和标签。",
"size": "auto",
"resolution": "1k",
"quality": "auto",
"n": 1,
"output_format": "png",
"background": "auto",
"image_urls": [
"https://example.com/product.png"
]
}'TASK_ID="task_xxx" # replace with the task_id returned by the POST request
curl "https://api.apimart.ai/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $APIMART_API_KEY"| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | 默认值: gpt-image-2.6 | 本工作台及示例使用的模型配置值:gpt-image-2.6。 |
prompt | string | 是 | 默认值: — | 描述要创建的画面,或需要修改的内容与参考图中应保留的细节。 |
size | string | 否 | 默认值: auto | 工作台选项:auto、1:1、3:2、2:3、16:9、9:16、4:3、3:4、4:5 或 5:4。 |
resolution | string | 否 | 默认值: 1k | 工作台分辨率选项:1k、2k 或 4k。这是请求配置,不代表原生输出像素规格。 |
quality | string | 否 | 默认值: auto | 工作台质量选项:auto、low、medium 或 high。 |
n | integer | 否 | 默认值: 1 | 本工作台的图片数量,取 1 至 4 的整数。 |
output_format | string | 否 | 默认值: png | 输出格式选项:png、jpeg 或 webp。透明背景需要搭配 png 或 webp。 |
background | string | 否 | 默认值: auto | 背景选项:auto、opaque 或 transparent。transparent 不能与 jpeg 同时使用。 |
image_urls | array | 否 | 默认值: — | 可选参考图 URL 数组,本工作台最多填写 16 个 HTTP 或 HTTPS 地址。本地文件仅供本地预览;请求示例需使用可访问的图片 URL。 |
把图片请求中需要明确的细节整理好。
说明画面的目标,以及验收时需要检查的细节。
用三个步骤整理图片需求。
描述主体和构图。编辑图片时,分别写清需要修改与需要保留的内容。
按需添加参考图,设置画面比例、分辨率、质量、背景和文件格式。
在 Form 或 JSON 中检查草稿,再对照下方调用示例和参数表。
提示词、名称变体、参考图与请求配置。
你可以整理文生图或参考图编辑需求,选择输出设置,并通过 Form 与 JSON 检查草稿。页面还提供 APIMart 通用异步请求结构的示例。
先说明主体和场景,再补充构图与光线。画面需要文字时,提供准确内容及位置。把修改要求与需要保留的细节分别写清。
工作台最多选择 16 张参考图,可以填写公开的 HTTP 或 HTTPS 图片地址,也可以选择本地文件预览。请说明每张参考图在需求中的作用。
本地文件在你的设备上预览。API 示例的 image_urls 使用可访问的 HTTP 或 HTTPS 地址;选择文件不会上传文件,也不会生成公开链接。
工作台提供 auto、1:1、3:2、2:3、16:9、9:16、4:3、3:4、4:5 和 5:4,可根据图片的展示位置选择。
页面提供 1k、2k、4k 请求配置,默认选择 1k。这些标签表示工作台中的选项,不构成原生像素尺寸或模型性能的说明。
工作台提供 auto、low、medium 和 high,默认值为 auto。将质量要求明确保留在配置中,方便检查。
将背景设为 transparent,并选择 png 或 webp。JPEG 不保存透明通道,因此工作台会提示不能将 transparent 与 jpeg 组合。
n 接受 1 至 4 的整数,默认值为 1。这是本页配置表单提供的数量范围。
根据素材使用位置选择 png、jpeg 或 webp,默认格式为 png。需要透明背景配置时,使用 PNG 或 WebP。
两种视图对应同一份草稿。有效且受支持的 JSON 值会更新表单;无效 JSON 会保留编辑内容并显示错误,方便继续修正。
APIMart 通用流程先提交 POST /v1/images/generations,读取 data[0].task_id,再查询 GET /v1/tasks/{task_id}。完成后通过 data.result.images[0].url[0] 获取图片地址。
通用任务响应的状态为 failed 时,data.error.message 提供错误信息。先检查原因,再决定修改输入还是重试。
GPT Image 2.6 API、GPT-Image-2.6、gpt-image-2-6、gpt-image-2-6-api 和 OpenAI GPT Image 2.6 是本页使用的名称或搜索写法,不代表不同的可请求模型。工作台配置值为 gpt-image-2.6。
本页介绍请求配置与调用示例。规划预算前,请结合 APIMart 的价格信息和相关 API 文档核对计费方式与可用请求标识。
登录后,点击获取 API Key 进入 APIMart 密钥管理页。请将 APIMart 密钥保存在服务端或环境变量中,避免写入公开的客户端代码。
探索同类型的其他模型。

Muse Image Ext
Muse Image turns inspiration into compelling visuals. From a spark of an idea to a fully imagined scene, it helps bring your creative vision to life with images that express your style and tell your story. Explore new possibilities and give every idea a visual voice.

Hy Image V3.5 Preview
HY Image 3.5 Preview is an image generation and editing model developed by Tencent Hunyuan. It supports text-to-image creation, reference-based generation, and multi-turn editing, allowing users to refine images through conversational instructions. With support for up to 4K output and flexible image dimensions, it offers a versatile tool for creating and refining visual content.

Flux 3 Image Klein
FLUX 3 Image Klein is a compact, open-weight image generation and editing model developed by Black Forest Labs. It combines text-to-image creation, image editing, and composition using up to 10 reference images in a single model. With support for up to 4K resolution and bounding-box layout control, it gives creators flexible tools to bring their ideas to life.

Mai Image 2.6
MAI-Image-2.6 is Microsoft's image model for text-to-image, single-image editing and composition with up to 5 reference images. It is available in high-quality and Flash versions, with 1K and 2K output and sharp text rendering.