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

# Wan2.7 画像から動画

> - WAN2.7 (wan2.7-image-to-video) モデルはマルチモーダル入力（画像 / 音声 / 動画）による画像→動画生成をサポート
- `generation_mode` で 3 つのモードから選択:
  - `first_frame`: **先頭フレーム→動画** — 先頭フレーム画像から動画を生成、駆動音声はオプション
  - `first_last_frame`: **先頭/末尾フレーム→動画** — 先頭フレーム＋末尾フレームの間を補間して動画生成、駆動音声はオプション
  - `video_continuation`: **動画継続** — 入力動画クリップから続きを生成、末尾フレーム画像はオプション（駆動音声不可）
- `generation_mode` はオプション（後方互換）。指定しない場合、リクエスト内の素材から適切なモードが自動選択されます
- 有効な素材の組み合わせ（その他は拒否）:
  1. `image_start`（先頭フレーム）
  2. `image_start` + `audio_urls`（先頭フレーム + 駆動音声）
  3. `image_start` + `image_end`（先頭/末尾フレーム）
  4. `image_start` + `image_end` + `audio_urls`（先頭/末尾フレーム + 駆動音声）
  5. `video_urls`（動画継続）
  6. `video_urls` + `image_end`（動画継続 + 末尾フレーム）
- 非同期処理モード、返却されたタスク ID で[ステータスを照会](/ja/api-manual/task-management/get-task-detail)
- 生成された動画リンクの有効期間は 24 時間です。お早めに保存してください



## OpenAPI

````yaml ja/api-manual/video-series/wan2.7/wan2.7-image-to-video.json POST /v1/videos/generations
openapi: 3.1.0
info:
  title: wan2.7-image-to-video API
  description: WAN2.7 モデルで画像から動画を生成。先頭フレーム/末尾フレーム画像、動画継続クリップ、音声駆動による生成をサポート
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - 動画生成
      summary: wan2.7-image-to-video API
      description: >-
        - WAN2.7 (wan2.7-image-to-video) モデルはマルチモーダル入力（画像 / 音声 /
        動画）による画像→動画生成をサポート

        - `generation_mode` で 3 つのモードから選択:
          - `first_frame`: **先頭フレーム→動画** — 先頭フレーム画像から動画を生成、駆動音声はオプション
          - `first_last_frame`: **先頭/末尾フレーム→動画** — 先頭フレーム＋末尾フレームの間を補間して動画生成、駆動音声はオプション
          - `video_continuation`: **動画継続** — 入力動画クリップから続きを生成、末尾フレーム画像はオプション（駆動音声不可）
        - `generation_mode` はオプション（後方互換）。指定しない場合、リクエスト内の素材から適切なモードが自動選択されます

        - 有効な素材の組み合わせ（その他は拒否）:
          1. `image_start`（先頭フレーム）
          2. `image_start` + `audio_urls`（先頭フレーム + 駆動音声）
          3. `image_start` + `image_end`（先頭/末尾フレーム）
          4. `image_start` + `image_end` + `audio_urls`（先頭/末尾フレーム + 駆動音声）
          5. `video_urls`（動画継続）
          6. `video_urls` + `image_end`（動画継続 + 末尾フレーム）
        - 非同期処理モード、返却されたタスク ID
        で[ステータスを照会](/ja/api-manual/task-management/get-task-detail)

        - 生成された動画リンクの有効期間は 24 時間です。お早めに保存してください
      operationId: createWan27ImageToVideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27ImageToVideoRequest'
            examples:
              first_frame:
                summary: 先頭フレーム→動画
                value:
                  model: wan2.7-image-to-video
                  generation_mode: first_frame
                  prompt: ピアノを弾く猫
                  image_start: https://example.com/first_frame.jpg
              first_frame_with_audio:
                summary: 先頭フレーム + 駆動音声
                value:
                  model: wan2.7-image-to-video
                  generation_mode: first_frame
                  prompt: 英語ラップを披露する若者
                  image_start: https://example.com/first_frame.jpg
                  audio_urls:
                    - https://example.com/rap.mp3
              first_last_frame:
                summary: 先頭/末尾フレーム→動画
                value:
                  model: wan2.7-image-to-video
                  generation_mode: first_last_frame
                  prompt: カメラが目線の高さから徐々に上昇し俯瞰へ
                  image_start: https://example.com/first_frame.png
                  image_end: https://example.com/last_frame.png
              video_continuation:
                summary: 動画継続
                value:
                  model: wan2.7-image-to-video
                  generation_mode: video_continuation
                  prompt: 鏡の前で自撮りを終えた女の子がリュックを背負って家を出る
                  video_urls:
                    - https://example.com/clip.mp4
      responses:
        '200':
          description: 動画タスクの作成に成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: リクエストパラメータが無効
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足、チャージが必要
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセス権限がありません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: wan2.7-image-to-video'
                  type: invalid_request_error
        '429':
          description: リクエストレート上限超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: サーバ内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    Wan27ImageToVideoRequest:
      required:
        - model
      type: object
      properties:
        model:
          type: string
          description: モデル名、`wan2.7-image-to-video` 固定
          enum:
            - wan2.7-image-to-video
          example: wan2.7-image-to-video
        generation_mode:
          type: string
          description: >-
            素材の組み合わせの妥当性を決定する生成モード。**明示的な指定を推奨**


            **値:**

            - `first_frame`: 先頭フレーム→動画。必須: `image_start`。任意: `audio_urls`。不可:
            `image_end`、`video_urls`

            - `first_last_frame`: 先頭/末尾フレーム→動画。必須: `image_start` +
            `image_end`。任意: `audio_urls`。不可: `video_urls`

            - `video_continuation`: 動画継続。必須: `video_urls[0]`。任意:
            `image_end`（末尾フレームとして）。不可: `image_start`、`audio_urls`


            **後方互換動作:** `generation_mode`
            を省略した場合、リクエスト内の素材から適切なモードが自動選択されます。曖昧さを避けるため明示指定を推奨
          enum:
            - first_frame
            - first_last_frame
            - video_continuation
          example: first_frame
        prompt:
          type: string
          description: >-
            動画生成用のテキストプロンプト。中国語と英語をサポート、各文字/アルファベットを 1
            文字としてカウントし、超過分は自動的に切り詰められます。最大 5000 文字
          maxLength: 5000
          example: ピアノを弾く猫
        negative_prompt:
          type: string
          description: 動画に表示したくない内容を記述するネガティブプロンプト。中国語と英語をサポート、最大 500 文字、超過分は自動的に切り詰められます
          maxLength: 500
          example: ぼやけ、低品質
        image_start:
          type: string
          format: uri
          description: |-
            先頭フレーム画像 URL

            **モード制約:**
            - `first_frame` モード: **必須**
            - `first_last_frame` モード: **必須**
            - `video_continuation` モード: **送信不可**

            **画像制限:**
            - フォーマット: JPEG、JPG、PNG（透明非対応）、BMP、WEBP
            - 解像度: 幅・高さが `[240, 8000]` ピクセル
            - アスペクト比: 1:8 ~ 8:1
            - ファイルサイズ: `20MB` 以下
          example: https://example.com/first_frame.jpg
        image_end:
          type: string
          format: uri
          description: >-
            末尾フレーム画像 URL


            **モード制約:**

            - `first_last_frame` モード: **必須**

            - `video_continuation` モード: 任意（継続の末尾フレームとして使用）

            - `first_frame` モード: **送信不可**（先頭/末尾の両方が必要な場合は `first_last_frame`
            を使用）


            **画像制限:**

            - フォーマット: JPEG、JPG、PNG（透明非対応）、BMP、WEBP

            - 解像度: 幅・高さが `[240, 8000]` ピクセル

            - アスペクト比: 1:8 ~ 8:1

            - ファイルサイズ: `20MB` 以下
          example: https://example.com/last_frame.jpg
        video_urls:
          type: array
          items:
            type: string
            format: uri
          description: |-
            動画継続 URL のリスト。**1 要素のみサポート**

            **モード制約:**
            - `video_continuation` モード: **必須**
            - `first_frame` / `first_last_frame` モード: **送信不可**
            - `audio_urls` と併用不可

            **動画制限:**
            - フォーマット: mp4、mov
            - 長さ: `2 ~ 10` 秒（入力クリップ自体の長さ）
            - 解像度: 幅・高さが `[240, 4096]` ピクセル
            - アスペクト比: 1:8 ~ 8:1
            - ファイルサイズ: `100MB` 以下

            **継続時間ルール:**
            - `duration` は **最終出力動画の総時間** を表します（入力クリップ + モデル生成の継続部分）
            - モデル生成部分の長さ = `duration` − 入力動画の長さ
            - `duration` は入力動画の長さ以上である必要があります
            - 課金は最終出力動画の総時間（つまり `duration`）に基づきます

            **例:**

            | 入力クリップの長さ | duration | 生成された継続 | 最終出力 | 課金時間 |
            | --- | --- | --- | --- | --- |
            | 3秒 | 15 | 12秒 | 15秒 | 15秒 |
            | 5秒 | 10 | 5秒 | 10秒 | 10秒 |
            | 8秒 | 8 | 0秒（入力のみ） | 8秒 | 8秒 |
          example:
            - https://example.com/clip.mp4
        audio_urls:
          type: array
          items:
            type: string
            format: uri
          minItems: 1
          maxItems: 1
          description: >-
            駆動音声 URL のリスト。**現在は 1
            要素のみサポート**。モデルはこの音声を駆動ソースとして動画生成（口パク同期、モーション同期など）に使用します


            **モード制約:**

            - `first_frame` モード: 任意

            - `first_last_frame` モード: 任意

            - `video_continuation` モード: **送信不可**（`video_urls` と併用不可）


            **フォーマット要件:**

            - 対応フォーマット: `wav`、`mp3`

            - 長さ: `2 ~ 30` 秒

            - ファイルサイズ: `15MB` 以下


            **切り詰め処理:**

            - 音声長が `duration` を超える場合、先頭 N 秒を使用し残りを破棄

            - 音声長が動画長より短い場合、超過部分は無音となります。例: 音声 3 秒、動画 5 秒の場合、最初の 3 秒は有音、後の 2
            秒は無音
          example:
            - https://example.com/audio.mp3
        quality:
          type: string
          description: |-
            動画品質、デフォルト `720p`

            **オプション:**
            - `720p`: 標準画質、標準価格（デフォルト）
            - `1080p`: 高画質、価格が高くなります
          enum:
            - 720p
            - 1080p
          default: 720p
          example: 720p
        duration:
          type: number
          description: |-
            動画長（秒、整数）。範囲 `2 ~ 15`、デフォルト `5`

            **意味:**
            - `first_frame` / `first_last_frame` モード: 生成動画の総時間
            - `video_continuation` モード: 最終出力動画の総時間（= 入力クリップ + モデル生成の継続部分）

            **`video_continuation` モードでの追加制約:**
            - `duration` は **入力動画の長さ以上** である必要があります（そうでない場合エラー）
            - モデル生成部分の長さ = `duration` − 入力動画の長さ
            - `duration` が入力動画の長さと等しい場合、継続は生成されず入力クリップがそのまま出力されます
            - 詳細は `video_urls` フィールドの継続時間ルールと例を参照

            **課金:** 実際に生成された動画の長さに基づきます
          minimum: 2
          maximum: 15
          default: 5
          example: 5
        seed:
          type: integer
          description: |-
            ランダムシード、デフォルトはランダム

            **説明:**
            - 範囲: `1` ~ `2147483647`
            - シードを固定するとプロンプト調整時の変動を抑制し再現性が向上します
          minimum: 1
          maximum: 2147483647
          example: 42
        prompt_extend:
          type: boolean
          description: >-
            プロンプトのインテリジェント書き換えを有効にするかどうか。有効にすると、大規模モデルがプロンプトを最適化し、シンプルまたは記述の不十分なプロンプトの結果を大幅に改善します。


            **注意:** デフォルト値は `false` です。フィールドを省略するか `false`
            を送信した場合、書き換えは行われません。有効にするには明示的に `true` を送信してください。
          default: false
          example: false
        callback_url:
          type: string
          description: >-
            タスク完了時の HTTPS コールバック URL


            **コールバックタイミング:**

            - タスクの完了 (completed)、失敗 (failed)、キャンセル (cancelled) 時にトリガー

            - 課金確定後に送信


            **セキュリティ制約:**

            - HTTPS のみサポート

            - 内部 IP アドレス（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x
            など）へのコールバックは禁止

            - URL の長さは `2048` 文字以内


            **コールバックメカニズム:**

            - タイムアウト: `10` 秒

            - 失敗後最大 `3` 回リトライ（失敗から `1`/`2`/`4` 秒後）

            - コールバックレスポンス形式はタスク照会 API と一致

            - 2xx ステータスは成功とみなされ、その他はリトライをトリガー
          format: uri
          example: https://your-domain.com/webhooks/video-task-completed
    VideoGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1757169743
        id:
          type: string
          description: タスク ID
          example: task-unified-1757169743-7cvnl5zw
        model:
          type: string
          description: 実際に使用したモデル名
          example: wan2.7-image-to-video
        object:
          type: string
          enum:
            - video.generation.task
          description: タスクの具体的な種類
        progress:
          type: integer
          description: タスク進捗率 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/VideoTaskInfo'
          description: 動画タスクの詳細情報
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: タスクの出力タイプ
          example: video
        usage:
          $ref: '#/components/schemas/Usage'
          description: 使用量と課金情報
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラーの説明
            type:
              type: string
              description: エラーの種類
    VideoTaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: タスクをキャンセル可能かどうか
          example: true
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 120
    Usage:
      type: object
      description: 使用量と課金情報
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 推定消費クレジット
          minimum: 0
          example: 5
        user_group:
          type: string
          description: ユーザーグループ
          enum:
            - default
            - vip
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ## すべての API は Bearer Token 認証が必要です ##

        **API Key の取得:**

        [API Key 管理ページ](https://evolink.ai/dashboard/keys) で API Key を取得してください

        **リクエストヘッダーに追加:**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````