> ## 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.

# Wan 2.7 Image 图像编辑

> Wan 2.7 Image 图像编辑 API 通过文字指令和最多四张视觉参考改造图像，探索新的构图和变体。

> [!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)接口获取结果。

使用 Wan 2.7，通过文字指令和最多四张视觉参考改造图像，探索新的构图和变体。

## 模型

* **alibaba/wan-2.7/image-edit** - 使用提示词和参考图编辑图像。

## 功能

* 使用提示词和参考图编辑图像。
* `image_urls` 接受 1-4 张图像。
* 通过 `n` 控制输出图像数量。

## 输出选项

### 图像尺寸

* `size`：可选。默认：`1024x1024`。
* 预设：`512x512`、`1024x1024`、`768x1024`、`1024x768`、`576x1024`、`1024x576`。
* 自定义尺寸时，提供包含整数 `width` 和 `height` 的对象，两者都必须为正数。

### 图像数量

* `n`：可选。要生成的图像数量。`1` 到 `4` 的整数。默认：`1`。

## 高级参数

`model` 和可选的 `callback_url` 放在请求根级。所有工作流参数（包括输出选项）都放在 `input` 内。

只发送本工作流支持的 input 字段。不支持的 `input` 字段会在扣除积分前被拒绝。输入 URL 必须使用 HTTP(S)、包含主机名，且不含内嵌凭证。

### 提示词

* `prompt`：必填。描述要做的修改。长度：**1-5,000 个字符**。
* 提供时不能为空。

### 图像 URL

* `image_urls`：必填。提供公开可访问的图像 URL。1-4 项。每项都必须是 HTTP(S) URL。顺序有意义：在提示词中以 image 1、image 2、image 3、image 4 引用。不接受单个字符串或 Base64 图像。

### 种子

* `seed`：可选。设置生成种子。整数。

## 计费因素

计费取决于所选模型版本和输出图像数量（`n`）。输出尺寸不会额外计费。参考图不会额外加价。

积分在提交时扣除，任务失败会退还。


## OpenAPI

````yaml zh/api-manual/image-series/alibaba-wan-2-7-image-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Wan 2.7 Image 图像编辑
  description: 使用 Wan 2.7，通过文字指令和最多四张视觉参考改造图像，探索新的构图和变体。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Image Series
      summary: Wan 2.7 Image 图像编辑
      description: |-
        只发送本工作流列出的字段。其他工作流的参数会在扣除积分前被拒绝。

        提供 prompt 时不能为空。输入 URL 字段须为带主机名、不含内嵌凭证的 HTTP(S) URL。

        自定义尺寸的宽和高都必须为正数。
      operationId: submit_alibaba_wan_2_7_image_edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  example: alibaba/wan-2.7/image-edit
                input:
                  type: object
                  required:
                    - image_urls
                    - prompt
                  description: 此公开接口的输入参数。需要提供参考图时请使用图像编辑接口。
                  properties:
                    prompt:
                      type: string
                      description: 描述期望输出的提示词。最大长度 5,000 个字符。
                      maxLength: 5000
                      example: A beautiful sunset over the ocean
                      minLength: 1
                    image_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                      minItems: 1
                      maxItems: 4
                      description: >-
                        用于编辑的参考图（必须 1-4 张）。顺序有意义：在提示词中以 image 1、image 2、image
                        3、image 4 引用。
                      example:
                        - https://example.com/reference1.jpg
                    size:
                      description: >-
                        输出尺寸。支持的预设值：`512x512`、`1024x1024`、`768x1024`、`1024x768`、`576x1024`、`1024x576`。自定义图像尺寸时，可以以对象形式传入
                        `width` 和 `height`：`{ "width": 1280, "height": 720 }`。
                      oneOf:
                        - type: string
                          enum:
                            - 512x512
                            - 1024x1024
                            - 768x1024
                            - 1024x768
                            - 576x1024
                            - 1024x576
                          example: 1024x1024
                          title: 尺寸字符串
                        - type: object
                          required:
                            - width
                            - height
                          properties:
                            width:
                              type: integer
                              minimum: 1
                              example: 1280
                            height:
                              type: integer
                              minimum: 1
                              example: 720
                          additionalProperties: false
                          title: 宽和高
                      default: 1024x1024
                      example: 1024x1024
                    'n':
                      type: integer
                      description: 要生成的图像数量（1-4）。积分按图像数量扣除。
                      minimum: 1
                      maximum: 4
                      default: 1
                      example: 1
                    seed:
                      type: integer
                      description: 可选的随机种子，用于复现输出
                      example: 24680
                  additionalProperties: false
                callback_url:
                  type: string
                  nullable: true
                  description: >-
                    可选的公开 HTTP(S) 接口，用于接收任务完成通知。建议使用 HTTPS。省略、设为 null
                    或空字符串即关闭回调。
              description: model 和 callback_url 放在根级。未知的根级字段会被忽略；不支持的 input 字段会被拒绝。
            examples:
              basic:
                summary: 基础流程
                value:
                  model: alibaba/wan-2.7/image-edit
                  input:
                    image_urls:
                      - https://example.com/image.png
                    prompt: >-
                      A quiet forest under soft morning light, with natural
                      detail.
                    size: 1024x1024
                    'n': 1
              callback:
                summary: 接收完成回调
                value:
                  model: alibaba/wan-2.7/image-edit
                  input:
                    image_urls:
                      - https://example.com/image.png
                    prompt: >-
                      A quiet forest under soft morning light, with natural
                      detail.
                    size: 1024x1024
                    'n': 1
                  callback_url: https://your-domain.com/callback
              preset-size:
                summary: 预设尺寸
                value:
                  model: alibaba/wan-2.7/image-edit
                  input:
                    prompt: A product photo on a pale blue background
                    size: 1024x1024
                    'n': 2
                    seed: 24680
                    image_urls:
                      - https://example.com/reference1.jpg
              custom-size:
                summary: 自定义尺寸
                value:
                  model: alibaba/wan-2.7/image-edit
                  input:
                    prompt: A product photo on a pale blue background
                    size:
                      width: 1280
                      height: 720
                    'n': 2
                    seed: 24680
                    image_urls:
                      - https://example.com/reference1.jpg
      responses:
        '200':
          description: 任务已提交
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: task-unified-example
                  status: running
                  created_time: '2026-09-10T08:00:00'
        '400':
          description: 输入无效、档位不支持、媒体无法访问或积分不足
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: 凭证无效
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: 拒绝访问
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: 模型未知或已停用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: 请求超时
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: JSON 无效或请求体不是对象
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: 超出速率限制或 API Key 积分限额
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: 内部错误
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: 无法创建上游生成任务
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: 请求的模型暂时不可用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 使用 VIDGO_API_KEY。

````

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