> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-Image-2.6

GPT-Image-2.6 Flare 在质量、编辑效率和速度方面带来了同样的提升，是大多数应用程序的默认选择。它提供的图像质量高于 GPT-Image-2，但延迟则低了 50%。该模型适用于各种场景，从创作者和社交内容到产品体验、视觉搜索、快速图像原型制作以及大量图像生成任务。

GPT-Image-2.6 Sunburst 旨在满足对视觉效果有高要求的创作需求，能够让用户在编辑过程中拥有更精细的控制能力。它可以用于各种创意性编辑工作，比如制作出适合发布的广告创意图片，或者打造精美的产品形象图。

可以直接在 Image API 中使用这两个模型，或者将其作为 Responses API 图像生成工具的模型。

### 模型参数

* 模型ID：`gpt-image-2.6-sunburst`/`gpt-image-2.6-flare`
* 模型价格：[GPT-Image-2.6-Sunburst](https://geekai.co/models/gpt-image-2.6-sunburst)、[GPT-Image-2.6-Flare](https://geekai.co/models/gpt-image-2.6-flare)
* 调用入口：`https://geekai.co/api/v1/images/generations`
* 模型参数：参考[画图 API 手册](https://docs.geekai.co/cn/api/image/generations.md)
* API认证：[获取 API KEY](https://docs.geekai.co/cn/docs/quick_start.md)

> [!NOTE]
>
> 不支持画图公共 API 中的以下参数：
>
> * `negative_prompt`
> * `seed`
> * `strength`
> * `aspect_ratio`
> * `style_preset`
>
> 附：[GPT-Image-2.6 官方 API 文档](https://developers.openai.com/api/docs/guides/image-generation)

GPT-Image-2.6 的 `size` 参数默认值是 `auto` 且支持满足以下条件的任意尺寸：

* 图片宽、高长度必须是 16 的倍数（整数）；
* 图片宽、高长度不得大于 3840 像素；
* 图片像素总数必须在 655360 到 8294400 之间；
* 图片宽高比不得大于 3:1 或小于 1:3。

GPT-Image-2.6 的 `quality` 参数默认值是 `medium`，并支持以下参数值：

* `low`
* `medium`
* `high`
* `xhigh`
* `max`

### 模型价格

GPT-Image-2.6 Sunburst 和 GPT-Image-2.6 Flare 的价格完全一致。不同尺寸和质量对应的价格不同，以下是 GPT-Image-2.6 的价格表：

| 质量（quality） | 尺寸（size） | 价格（单位：元/张） |
| - | - | - |
| low | 1024x1024 | 0.185 |
| low | 1024x1536 | 0.149 |
| low | 1536x1024 | 0.149 |
| low | 2048x2048(2K) | 0.375 |
| low | 2048x1152(2K) | 0.148 |
| low | 3840x2160(4K) | 0.351 |
| low | 2160x3840(4K) | 0.351 |
| medium | 1024x1024 | 0.326 |
| medium | 1024x1536 | 0.255 |
| medium | 1536x1024 | 0.255 |
| medium | 2048x2048(2K) | 0.662 |
| medium | 2048x1152(2K) | 0.272 |
| medium | 3840x2160(4K) | 0.642 |
| medium | 2160x3840(4K) | 0.642 |
| high | 1024x1024 | 0.395 |
| high | 1024x1536 | 0.309 |
| high | 1536x1024 | 0.309 |
| high | 2048x2048(2K) | 0.803 |
| high | 2048x1152(2K) | 0.318 |
| high | 3840x2160(4K) | 0.751 |
| high | 2160x3840(4K) | 0.751 |
| xhigh | 1024x1024 | 0.702 |
| xhigh | 1024x1536 | 0.553 |
| xhigh | 1536x1024 | 0.553 |
| xhigh | 2048x2048(2K) | 1.427 |
| xhigh | 2048x1152(2K) | 0.565 |
| xhigh | 3840x2160(4K) | 1.334 |
| xhigh | 2160x3840(4K) | 1.334 |
| max | 1024x1024 | 1.580 |
| max | 1024x1536 | 1.235 |
| max | 1536x1024 | 1.235 |
| max | 2048x2048(2K) | 3.211 |
| max | 2048x1152(2K) | 1.271 |
| max | 3840x2160(4K) | 3.002 |
| max | 2160x3840(4K) | 3.002 |

> [!NOTE]
>
> 以上只是常见尺寸的价格示例，GPT-Image-2.6 支持的尺寸非常广泛，实际价格会根据你选择的具体尺寸和质量进行计算。

GPT-Image-2.6 模型参数默认值 `quality` 是 `medium`，`size` 是 `1024x1024`。

使用极客智坊提供的[低价代理渠道](https://docs.geekai.co/cn/docs/model_price.md)调用时，不同参数对应价格按照价格表x对应的折扣值即可：以高可用通道为例，折扣值是 `0.5`，那么生成一张 `size` 为 `1024x1024`、`quality` 为 `medium` 的图片价格是 `0.099 x 0.5 = 0.0495` 元，如果生成同样尺寸但 `quality` 为 `high` 的图片价格是 `0.395 x 0.5 = 0.1975` 元。其他参数依次类推。

### 文生图片

通过文字描述来生成对应图像：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-2.6-flare",
    "prompt":"画一只可爱的小猫在草丛中玩耍"
}'
```

### 以图生图

**单图**

基于已有图片，结合文字指令进行图像编辑，生成新的图像：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-2.6-flare",
    "prompt":"修复这张破损的照片",
    "image":"https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'
```

注意，GPT-Image-2.6 支持图片编辑接口，这里我们还可以借助图片编辑接口实现图生图功能：

```bash json theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "修复这张破损的照片",
    "image": "https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'
```

```bash form theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2.6-flare"' \
--form 'prompt="修复这张破损的照片"' \
--form 'image=@/path/to/your/local/image.jpg'
```

> [!NOTE]
>
> `image` 参数支持传入图片 URL 或图片的 Base64 编码字符串，国内版请传入国内公网可访问的 URL，否则请通过 Base64 编码传递。

**多图**

基于多张参考图片，融合它们的风格、元素等特征来生成新图像，如衣裤鞋帽与模特图融合成穿搭图，人物与风景融合为人物风景图等：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-2.6-flare",
    "prompt": "将图1中的面料应用至图2的服装上，图片比例按照图2来",
    "image": [
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/针织.jpg",
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/款式图.jpg"
    ],
    "quality": "high",
    "background": "auto",
    "output_format": "png",
    "response_format": "url",
    "async": true
}'
```

同样地，图片编辑接口也支持多图编辑：

```bash json theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "将图1中的面料应用至图2的服装上，图片比例按照图2来",
    "image": [
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/针织.jpg",
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/款式图.jpg"
    ],
    "quality": "high",
    "background": "auto",
    "output_format": "png",
    "response_format": "url",
    "async": true
}'
```

```bash form theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2.6-flare"' \
--form 'prompt="将图1中的面料应用至图2的服装上，图片比例按照图2来"' \
--form 'image[]=@/path/to/your/local/image1.jpg' \
--form 'image[]=@/path/to/your/local/image2.jpg'
```

**通过标记引导编辑**

GPT-Image-2.6 支持通过 `markup` 传入标记图层引导编辑，即在图片上添加标记区域，模型会根据标记区域的提示进行相应的编辑：

```bash json theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "将标记区域内的蝴蝶换成蜜蜂",
    "image": "https://static.geekai.co/image/image1.jpg",
    "markup": "https://static.geekai.co/image/markup.jpg",
    "quality": "high",
    "background": "auto",
    "output_format": "png",
    "response_format": "url",
    "async": true
}'
```

```bash form theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2.6-flare"' \
--form 'prompt="将标记区域内的蝴蝶换成蜜蜂"' \
--form 'image[]=@/path/to/your/local/image1.jpg' \
--form 'markup=@/path/to/your/local/markup.jpg'
```

标记图要求：

* 标记图应为与原图尺寸一致的背景透明PNG图片；
* 标记作用于第一个输入图像，附加图片可作为参考；
* 标记图与第一张图片最多包含 16,777,216 个像素，且标记图片大小不得超过 50M；
* 标记图 `markup` 与遮罩图 `mask` 不能同时存在。

**通过遮罩图进行编辑**

遮罩图 `mask` 用于指定图片中需要编辑的区域，模型只会对遮罩区域进行编辑，未被遮罩的区域保持原图不变：

```bash json theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "一个阳光充足的室内休息区，池中有火烈鸟",
    "image": "https://static.geekai.co/image/image1.jpg",
    "mask": "https://static.geekai.co/image/mask.png",
    "quality": "high",
    "background": "auto",
    "output_format": "png",
    "response_format": "url",
    "async": true
}'
```

```bash form theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2.6-flare"' \
--form 'prompt="一个阳光充足的室内休息区，池中有火烈鸟"' \
--form 'image[]=@/path/to/your/local/image1.jpg' \
--form 'mask=@/path/to/your/local/mask.png'
```

遮罩图要求：

* 遮罩图应为与原图尺寸一致的背景透明PNG图片，大小不得超过 50M;
* 遮罩图必须包含一个α通道；
* 遮罩图 `mask` 与标记图 `markup` 不能同时存在。

### 生成 SVG/GIF 图片

要生成 SVG/GIF 动图，需将 `output_format` 设置为 `svg`/`gif` 即可：

```bash json theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "生成一张照片级写实图像：以纯白色为背景，展示一个装有参考图片中所有物品的礼品篮，搭配缎带，并以手写风格字体标注GeekAI",
    "image": [
        "https://static.geekai.co/image/image1.jpg",
        "https://static.geekai.co/image/image2.jpg",
        "https://static.geekai.co/image/image3.jpg",
        "https://static.geekai.co/image/image4.jpg"
    ],
    "output_format": "gif",
    "response_format": "url",
    "async": true
}'
```

> [!NOTE]
>
> 对于耗时生图任务，可以通过设置 `async` 参数为 `true` 开启异步任务模式。异步任务模式下，画图接口会返回一个 `task_id`，你可以通过轮询 `https://geekai.co/api/v1/images/{task_id}` 来获取图像生成的最新状态，当任务完成后即可获得最终的图像URL，相关细节请参考[异步生图](https://docs.geekai.co/cn/docs/image/txt2img.md#异步生图)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.