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

# 万相 2.7 图像生成

> 万相 2.7 图像生成与编辑模型，支持文生图和图片编辑。不传 images 为文生图模式，传入 images（最多9张）为图片编辑模式。

使用[阿里云](https://www.aliyun.com)万相 2.7 图像生成与编辑模型生成图片。

**模型特点：**

* **文生图与图片编辑** - 同时支持文生图和图片编辑模式（最多 9 张参考图）
* **高分辨率** - 支持 1K 和 2K 输出分辨率
* **长提示词** - 支持最长 5000 字符的提示词


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/bailian/wan27-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/wan27-image:
    post:
      tags:
        - public
      summary: 万相 2.7 图像生成
      description: 万相 2.7 图像生成与编辑模型，支持文生图和图片编辑。不传 images 为文生图模式，传入 images（最多9张）为图片编辑模式。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan27ImageTaskRequest'
        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'
        '500':
          description: 服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    bailian.CreateWan27ImageTaskRequest:
      properties:
        images:
          description: |-
            输入图片 URL 列表（可选，0-9 张图片，用于图片编辑模式）
            不传则为文生图模式，传入则为图片编辑模式
          items:
            type: string
          maxItems: 9
          type: array
        prompt:
          description: 正向提示词（必填，最大 5000 字符）
          maxLength: 5000
          minLength: 1
          type: string
        seed:
          description: 随机种子（可选，范围 0-2147483647）
          maximum: 2147483647
          minimum: 0
          type: integer
        size:
          description: |-
            输出分辨率（可选，默认 2K）
            wan2.7-image 支持 1K、2K
          enum:
            - 1K
            - 2K
          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 进行认证

````