> ## 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-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus の3つのモデルをサポート

[アリババクラウド](https://tongyi.aliyun.com/wan) Tongyi Wanxiang Wan2 シリーズモデルを使用してテキストから画像を生成します。

**モデルの特徴:**

* **複数モデル選択可能** - wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus をサポート
* **ネイティブマルチモーダル** - 同一アーキテクチャでテキスト、画像など複数のモダリティ入出力をサポート
* **中国語ネイティブ** - 国内トップクラスの中国語理解能力、中国語プロンプトを直接使用可能
* **複雑な指示理解** - カメラワークなどの複雑な連続指示をサポート


## OpenAPI

````yaml /ja/openapi.yaml POST /generate/bailian/wan2-text-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: 本番サーバー
security: []
paths:
  /generate/bailian/wan2-text-to-image:
    post:
      tags:
        - public
      summary: 通義萬相 Wan2 テキストから画像生成
      description: >-
        通義萬相 Wan2
        シリーズモデルを使用して画像を生成します。wan2.5-t2i-preview/wan2.2-t2i-flash/wan2.2-t2i-plus
        の3つのモデルをサポート
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bailian.CreateWan2TextToImageTaskRequest'
        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.CreateWan2TextToImageTaskRequest:
      properties:
        model:
          description: |-
            モデル選択（オプション、デフォルトwan2.5-t2i-preview）
            選択可能値：wan2.5-t2i-preview, wan2.2-t2i-flash, wan2.2-t2i-plus
          enum:
            - wan2.5-t2i-preview
            - wan2.2-t2i-flash
            - wan2.2-t2i-plus
          type: string
        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）
            wan2.5-t2i-preview: 総ピクセル [768*768, 1440*1440]、アスペクト比 [1:4, 4:1]
            wan2.2以下: 幅・高さ [512, 1440]
          type: string
      required:
        - prompt
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: タスクID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: '機械可読なエラーコード（例: TASK.INVALID_PARAMS）'
          type: string
        message:
          description: ユーザーフレンドリーなエラーメッセージ
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Tokenを使用して認証を行ってください

````