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

> 千问图像 2.0 加速版，支持文生图和图片编辑，支持自由分辨率和多图输出（1-6张）。

使用[阿里云](https://www.aliyun.com)千问图像 2.0 加速版模型生成图片。

**模型特点：**

* **自由分辨率** - 支持自由宽高，总像素在 512x512 至 2048x2048 之间
* **多图输出** - 单次请求可生成 1-6 张图片
* **文生图与图片编辑** - 同时支持文生图和图片编辑两种模式


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/bailian/qwen-image-2.0
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/qwen-image-2.0:
    post:
      tags:
        - public
      summary: 千问图像 2.0 生成
      description: 千问图像 2.0 加速版，支持文生图和图片编辑，支持自由分辨率和多图输出（1-6张）。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateQwenImage20TaskRequest'
        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.CreateQwenImage20TaskRequest:
      properties:
        images:
          description: |-
            输入图片列表（可选，0-3张图片，用于图片编辑模式）
            不传则为文生图模式，传入则为图片编辑模式
          items:
            type: string
          maxItems: 3
          type: array
        'n':
          description: 输出图像数量（可选，1-6，默认 1）
          maximum: 6
          minimum: 1
          type: integer
        negative_prompt:
          description: 负向提示词（可选，最大 500 字符）
          maxLength: 500
          type: string
        prompt:
          description: 正向提示词（必填，最大 800 字符）
          maxLength: 800
          minLength: 1
          type: string
        prompt_extend:
          description: 启用提示词智能改写（可选，默认 true）
          type: boolean
        seed:
          description: 随机种子（可选，范围 0-2147483647）
          maximum: 2147483647
          minimum: 0
          type: integer
        size:
          description: >-
            图片尺寸（可选，默认 2048*2048）

            qwen-image-2.0 支持自由宽高，总像素在 512*512 至 2048*2048 之间

            推荐分辨率：2688*1536(16:9) 1536*2688(9:16) 2048*2048(1:1) 2368*1728(4:3)
            1728*2368(3:4)
          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 进行认证

````