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

# GPT Image 2.6 Flare 图像编辑

> GPT Image 2.6 Flare 图像编辑 API 基于 1–16 张参考图编辑出一张 1K、2K 或 4K 图像，支持可选蒙版、透明背景和输出压缩。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

GPT Image 2.6 Flare 图像编辑根据文字指令编辑图像：传入 1–16 张参考图，可以重新调整风格、替换背景、把产品合成到新场景，或只修改蒙版区域。Flare 是 GPT Image 2.6 中速度更快的选项，适合快速迭代。

如只需根据提示词生成，请使用[GPT Image 2.6 Flare 文生图](https://docs.vidgo.ai/zh/api-manual/image-series/gpt-image-2-6-flare-text-to-image.md)（`openai/gpt-image-2.6-flare/text-to-image`）。GPT Image 2.6 的参数与 [GPT Image 2.5 Flare](https://docs.vidgo.ai/zh/api-manual/image-series/gpt-image-2-5-flare-edit.md) 相同，另外新增 `output_compression`、`moderation` 和 `complexity`。

## 模型

* **openai/gpt-image-2.6-flare/edit** — GPT Image 2.6 Flare 图像编辑，1–16 张参考图，每次请求生成一张图像。

## 功能

* 基于文字指令编辑，最多 16 张参考图，在提示词中按顺序引用。
* 可选蒙版，只编辑指定区域。
* 三档分辨率（`1K`、`2K`、`4K`），支持宽高比预设、`auto` 或自定义 `WIDTHxHEIGHT` 尺寸。
* 五档质量：`low`、`medium`、`high`、`xhigh`、`max`。
* 透明或不透明背景；输出 PNG、JPEG 或 WebP。
* 可调节 JPEG/WebP 压缩、内容审核强度和规划力度（`complexity`）。

## 必填参数

* `prompt` (string)：描述编辑内容的文字指令。最多 32,000 个字符，不能为空白。
* `image_urls` (string\[])：1–16 张参考图，使用公开可访问的 HTTP(S) URL，顺序与提示词中引用的顺序一致。

## 可选参数

* `size` (string)：宽高比预设、`auto` 或自定义 `WIDTHxHEIGHT`。省略时输出跟随第一张参考图的宽高比。参见[尺寸](#尺寸)。
* `resolution` (string)：`1K`、`2K` 或 `4K`。默认 `1K`。
* `quality` (string)：`low`、`medium`、`high`、`xhigh` 或 `max`。默认 `high`。
* `background` (string)：`auto`、`transparent` 或 `opaque`。默认 `auto`。透明背景需要输出 `png` 或 `webp`。
* `output_format` (string)：`png`、`jpeg` 或 `webp`。默认 `png`。
* `output_compression` (integer)：压缩级别，`0` 到 `100`。仅当 `output_format` 为 `jpeg` 或 `webp` 时可用。省略时使用默认压缩。
* `mask_url` (string)：选定编辑区域的蒙版图像，使用公开可访问的 HTTP(S) URL。需要同时传入 `image_urls`。
* `moderation` (string)：内容审核严格程度，`auto` 或 `low`。默认 `auto`；`low` 过滤更宽松。
* `complexity` (string)：模型生成前的规划力度，`low`、`medium` 或 `high`。默认 `high`。不影响价格。

## 尺寸

* 预设：`1:1`、`2:3`、`3:2`、`4:3`、`3:4`、`4:5`、`5:4`、`16:9`、`9:16`、`21:9`。省略 `size` 时，输出跟随第一张参考图的宽高比，在所选 `resolution` 档位下取最接近的支持比例。传入 `size` 可覆盖。
* 预设保持所选 `resolution` 档位；实际像素尺寸可能因每次生成而不同。需要精确像素时请使用自定义尺寸。
* `auto` 由模型决定图像尺寸（约 150 万像素），可与任意 `resolution` 搭配，按 `1K` 档计费。
* 自定义 `WIDTHxHEIGHT`（用 `x` 或 `X` 分隔，例如 `2304x1536`）可与任意 `resolution` 搭配。两条边都必须是 16 的倍数，最长边不超过 3,840 像素，宽高比不超过 3:1，总像素数在 655,360 到 8,294,400 之间。
* 自定义尺寸按总像素数对应的档位计费；所选 `resolution` 更高时按所选档位：

| 总像素数（自定义尺寸） | 计费档位 |
| - | - |
| 不超过 1,572,864 | `1K` |
| 1,572,865–4,194,304 | `2K` |
| 超过 4,194,304 | `4K` |

## 示例

* **使用参考图编辑**：在 `2K` 下替换背景，不传 `size`，输出保持参考图的宽高比。
* **蒙版编辑**：只修改蒙版区域，`size: auto`。
* **透明背景**：去除背景，WebP、`4K`、`xhigh` 质量。
* **自定义尺寸**：把产品放入 `2304x1536` 的全景场景，`2K`、`medium` 质量。
* **压缩 JPEG**：`3:2`、`medium` 质量，`output_format: jpeg`、`output_compression: 80`。

## 注意事项

* 每次请求只返回一张图像；`n` 不为 `1` 时返回 400。未列出的字段返回 400。`model` 和 `callback_url` 放在请求根级，不放在 `input` 内。
* 透明背景搭配 `output_format: jpeg` 返回 400。`output_compression` 搭配 `output_format: png` 同样返回 400。
* `image_urls` 为空数组、超过 16 张，或 URL 不是有效的 HTTP(S) URL 时返回 400。
* 积分取决于 `quality`、计费档位（`resolution`，或[尺寸](#尺寸)中所述的自定义尺寸档位）和参考图数量。`complexity` 和 `moderation` 不影响价格。提交时预扣单张图像的封顶积分；任务完成后按实际 token 用量计费（不超过封顶），差额退还。任务失败全额退还。当前价格见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/api-manual/image-series/gpt-image-2-6-flare-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - GPT Image 2.6 Flare 图像编辑
  description: >-
    GPT Image 2.6 Flare 图像编辑 API 基于 1–16 张参考图编辑出一张 1K、2K 或 4K
    图像，支持可选蒙版、透明背景和输出压缩。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - GPT Image 2.6 Flare Image Edit
      summary: 提交 GPT Image 2.6 Flare 图像编辑任务
      operationId: submitGPTImage26FlareImageEditTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              reference-edit:
                summary: 使用参考图编辑
                value:
                  model: openai/gpt-image-2.6-flare/edit
                  input:
                    prompt: >-
                      Preserve the product and replace the background with a
                      warm modern studio.
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
                    resolution: 2K
              mask-edit:
                summary: 编辑蒙版区域
                value:
                  model: openai/gpt-image-2.6-flare/edit
                  input:
                    prompt: Replace the masked area with a small vase of flowers.
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
                    mask_url: https://cdn.vidgo.ai/temp/edit-mask.png
                    size: auto
              transparent-background:
                summary: 编辑并输出透明背景图像
                value:
                  model: openai/gpt-image-2.6-flare/edit
                  input:
                    prompt: Keep the silver robot and remove its background.
                    background: transparent
                    output_format: webp
                    resolution: 4K
                    quality: xhigh
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
              custom-size:
                summary: 使用自定义尺寸编辑
                value:
                  model: openai/gpt-image-2.6-flare/edit
                  input:
                    prompt: >-
                      Preserve the product and place it in a panoramic city
                      garden.
                    size: 2304x1536
                    resolution: 2K
                    quality: medium
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
              compressed-jpeg:
                summary: 压缩 JPEG 输出
                value:
                  model: openai/gpt-image-2.6-flare/edit
                  input:
                    prompt: >-
                      Place the product on a linen tablecloth with soft window
                      light.
                    size: '3:2'
                    quality: medium
                    output_format: jpeg
                    output_compression: 80
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
      responses:
        '200':
          description: 任务提交结果。任务 ID 标识一项异步任务；生成可能仍在进行中。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: openai/gpt-image-2.6-flare/edit
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于接收完成或失败通知。
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
            - image_urls
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 32000
              description: |-
                描述编辑内容的文字指令。

                至少包含一个非空白字符。
            size:
              type: string
              description: >-
                输出宽高比预设、auto 或自定义 WIDTHxHEIGHT。


                省略时输出跟随第一张参考图的宽高比（在所选分辨率下取最接近的支持比例）。


                预设：`1:1`、`2:3`、`3:2`、`4:3`、`3:4`、`4:5`、`5:4`、`16:9`、`9:16`、`21:9`。


                `auto` 由模型决定尺寸，可与任意分辨率搭配，按 1K 计费。


                自定义尺寸可与任意分辨率搭配：两条边都是 16 的倍数，最长边不超过 3840，宽高比不超过 3:1，总像素数
                655360–8294400。宽和高之间用 `x` 或 `X` 分隔。按总像素数对应的档位计费（不超过 1572864 为
                1K，不超过 4194304 为 2K，更大为 4K），所选分辨率更高时按所选分辨率。
            resolution:
              type: string
              enum:
                - 1K
                - 2K
                - 4K
              default: 1K
              description: 输出分辨率档位。
            image_urls:
              type: array
              maxItems: 16
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTP(S) 下载 URL。
              description: 编辑所需的参考图，按提示词中的顺序排列。
              minItems: 1
            output_format:
              type: string
              enum:
                - png
                - jpeg
                - webp
              default: png
              description: |-
                输出图像格式。

                透明输出需要 PNG 或 WebP。
            output_compression:
              type: integer
              minimum: 0
              maximum: 100
              description: |-
                输出图像的压缩级别，0 到 100。

                仅当 output_format 为 jpeg 或 webp 时可用，其他格式返回 400。省略时使用默认压缩。
            quality:
              type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
              default: high
              description: |-
                图像质量档位。

                计费取决于质量和计费档位。
            background:
              type: string
              enum:
                - auto
                - transparent
                - opaque
              default: auto
              description: |-
                背景模式。

                透明输出需要 PNG 或 WebP。
            mask_url:
              type: string
              format: uri
              description: |-
                可选蒙版，用于选定要编辑的区域。

                需要至少一张参考图。

                使用公开可访问的 HTTP(S) 下载 URL。
            moderation:
              type: string
              enum:
                - auto
                - low
              default: auto
              description: |-
                内容审核严格程度。

                low 过滤更宽松。
            complexity:
              type: string
              enum:
                - low
                - medium
                - high
              default: high
              description: |-
                模型生成前的规划力度。

                不影响价格。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-10-09T10:30:00'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: prompt is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

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