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

# Wan2 图生图

> 使用通义万相 Wan2 图生图模型（wan2.5-i2i-preview）进行图像编辑和多图融合

使用[阿里云](https://tongyi.aliyun.com/wan)通义万相 Wan2.5 模型进行图像编辑和多图融合。

**模型特点：**

* **主体一致性** - 基于主体一致性的图像编辑能力
* **多图融合** - 支持多图输入实现创意融合
* **一句话P图** - 通过简单文本指令完成复杂编辑
* **中文原生** - 直接使用中文描述编辑需求


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/bailian/wan2-image-to-image
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI 模型任务调度平台 API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/bailian/wan2-image-to-image:
    post:
      tags:
        - public
      summary: 通义万相 Wan2 图生图
      description: 使用通义万相 Wan2 图生图模型（wan2.5-i2i-preview）进行图像编辑和多图融合
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan2ImageToImageTaskRequest'
        description: 任务参数
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: 参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '404':
          description: 模型不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: 服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    bailian.CreateWan2ImageToImageTaskRequest:
      properties:
        images:
          description: |-
            输入图片 URL 列表（必填，1-3张）
            支持公网 URL（HTTP/HTTPS）或 Base64 编码
          items:
            type: string
          maxItems: 3
          minItems: 1
          type: array
        negative_prompt:
          description: 负向提示词（可选，最大 500 字符）
          maxLength: 500
          type: string
        prompt:
          description: 正向提示词（必填，最大 2000 字符）
          maxLength: 2000
          minLength: 1
          type: string
        seed:
          description: 随机种子（可选，范围 0-2147483647）
          maximum: 2147483647
          minimum: 0
          type: integer
        size:
          description: |-
            输出分辨率（可选，默认 1280*1280）
            总像素 [768*768, 1280*1280]，宽高比 [1:4, 4:1]
          type: string
      required:
        - images
        - prompt
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g. TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 请使用您的 API Token 进行认证

````