> ## 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.2 先頭・末尾フレームから動画生成モデル（wan2.2-kf2v-flash）を使用します。先頭フレームと末尾フレームの画像を提供し、プロンプトと組み合わせることで滑らかで流動的な動画を生成します。エフェクトテンプレートをサポート

[アリババクラウド](https://tongyi.aliyun.com/wan) Tongyi Wanxiang キーフレーム動画生成モデルを使用して、最初と最後のフレーム画像を提供するだけで滑らかなダイナミック動画を生成します。

**モデルの特徴:**

* **キーフレーム制御** - 動画の開始と終了フレームを正確に制御
* **スムーズな遷移** - 滑らかな中間フレームアニメーションを自動生成
* **マルチ解像度** - 480P、720P、1080P出力をサポート
* **スマートリライト** - より良い結果のためのプロンプト自動改善をサポート
* **エフェクトテンプレート** - プリセット動画エフェクトテンプレートをサポート


## OpenAPI

````yaml /ja/openapi.yaml POST /generate/bailian/wan2-keyframe-to-video
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-keyframe-to-video:
    post:
      tags:
        - public
      summary: 通義萬相 Wan2 先頭・末尾フレームから動画生成
      description: >-
        通義萬相 Wan2.2
        先頭・末尾フレームから動画生成モデル（wan2.2-kf2v-flash）を使用します。先頭フレームと末尾フレームの画像を提供し、プロンプトと組み合わせることで滑らかで流動的な動画を生成します。エフェクトテンプレートをサポート
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/bailian.CreateWan2KeyframeToVideoTaskRequest
        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.CreateWan2KeyframeToVideoTaskRequest:
      properties:
        first_frame_url:
          description: |-
            先頭フレーム画像 URL（必須）
            公衆インターネット URL（HTTP/HTTPS）または Base64 エンコードをサポート
            画像形式：JPEG、JPG、PNG（透明チャンネルなし）、BMP、WEBP
            画像解像度：幅と高さの範囲は [360, 2000] ピクセル
            ファイルサイズ：10MB以下
            出力ビデオのアスペクト比はこの画像を基準とします
          type: string
        last_frame_url:
          description: |-
            末尾フレーム画像のURL（オプション）
            要件は先頭フレーム画像と同じ、解像度は先頭フレームと異なっても可
            エフェクトテンプレート（template）を使用する場合は入力不要
          type: string
        model:
          description: |-
            モデル名（オプション、空欄推奨）
            空欄の場合は最新バージョンのモデルを使用し、以降のモデルアップグレードは自動適用
            現在のデフォルト：wan2.2-kf2v-flash
          enum:
            - wan2.2-kf2v-flash
          type: string
        negative_prompt:
          description: |-
            ネガティブプロンプト（オプション、最大500文字）
            動画内に表示したくない内容を記述
          maxLength: 500
          type: string
        prompt:
          description: |-
            テキストプロンプト（オプション、最大800文字）
            生成動画に含めたい要素や視覚的特徴を記述
            先頭/末尾フレームの主題/シーンが大きく変化する場合、変化の過程（カメラワーク、主題の動きなど）の記述を推奨
          maxLength: 800
          type: string
        prompt_extend:
          description: |-
            プロンプトのインテリジェントリライトを有効化するか（オプション、デフォルトtrue）
            有効時は大規模言語モデルを使用して入力プロンプトをインテリジェントにリライト
          type: boolean
        resolution:
          description: |-
            解像度設定（オプション、デフォルト720P）
            wan2.2-kf2v-flash：選択可能値 480P、720P、1080P
          enum:
            - 480P
            - 720P
            - 1080P
          type: string
        seed:
          description: ランダムシード（オプション、範囲 0-2147483647）
          maximum: 2147483647
          minimum: 0
          type: integer
        template:
          description: |-
            動画エフェクトテンプレート名（オプション）
            このパラメータ使用時は、first_frame_urlのみ入力
            異なるモデルは異なるエフェクトテンプレートをサポート
          type: string
        watermark:
          description: |-
            透かしを追加するか（オプション、デフォルトfalse）
            透かしは動画右下に表示、固定文言は「AI生成」
          type: boolean
      required:
        - first_frame_url
      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を使用して認証を行ってください

````