すべてのプロダクト
Search
ドキュメントセンター

Alibaba Cloud Model Studio:Wan - 画像から動画生成 - 先頭フレーム API リファレンス (2.1~2.6)

最終更新日:Jun 04, 2026

Wan 画像から動画生成モデルは、先頭フレーム画像テキストプロンプトから滑らかな動画を生成します。

関連ドキュメントユーザーガイド

説明

Wan 2.7 - 画像から動画生成は、先頭フレームから動画生成、先頭・末尾フレームから動画生成、および動画継続に対応しています。このバージョンの使用を推奨します

Wan 2.6 以前のモデルにおける画像から動画生成(先頭フレームベース)機能は、先頭フレームからの動画生成のみをサポートしています。

可用性

ご利用のモデル、エンドポイント URL、API キーは同一リージョンに配置されている必要があります。リージョンをまたいだ呼び出しは失敗します。

説明

本トピックのサンプルコードはシンガポールリージョン向けです。

重要

シンガポールリージョン用のレガシドメイン https://dashscope-intl.aliyuncs.com はまもなく非推奨になります。できるだけ早く新しいドメイン https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com に移行してください。

HTTP 呼び出し

画像から動画生成タスクは非同期呼び出しを使用します(通常 1~5 分):タスクを作成 → 結果をポーリング

ステップ 1:タスクを作成

シンガポール

POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

WorkspaceId は、実際のワークスペース IDに置き換えてください。

米国 (バージニア)

POST https://dashscope-us.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

北京

POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

フランクフルト

POST https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

WorkspaceId は、ワークスペース IDに置き換えてください。

説明
  • タスク作成後、返された task_id を使用して結果を照会します。task_id の有効期間は 24 時間です。重複したタスクを作成しないでください。代わりに、ポーリングを使用して結果を取得してください。

  • 初心者向けガイドについては、「Postman」をご参照ください。

リクエストパラメーター

マルチショットナラティブ

この機能は Wan2.6 シリーズモデルでのみサポートされています。

"prompt_extend": true および "shot_type":"multi" を設定することで有効化できます。

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.6-i2v-flash",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
    },
    "parameters": {
        "resolution": "720P",
        "prompt_extend": true,
        "duration": 10,
        "shot_type":"multi"
    }
}'

自動ダビング

この機能は Wan2.6 および Wan2.5 シリーズモデルでのみサポートされています。

input.audio_url を指定しない場合、モデルは動画コンテンツに基づいて自動的に背景音楽または効果音を生成します。

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-i2v-preview",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true,
        "duration": 10
    }
}'

カスタムオーディオ

この機能は Wan2.6 および Wan2.5 シリーズモデルでのみサポートされています。

動画の背景音楽またはボイスオーバーを指定するには、カスタムオーディオファイルの URL を input.audio_url パラメーターに渡します。

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.5-i2v-preview",
    "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true,
        "duration": 10
    }
}'

無音動画

以下のモデルのみが無音動画の生成をサポートしています:

  • wan2.6-i2v-flash: 無音動画を生成するには、parameters.audio = false を明示的に設定する必要があります

  • wan2.2 および wan2.1 シリーズモデル: デフォルトで無音動画を生成します。追加のパラメーターは不要です。

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-i2v-plus",
    "input": {
        "prompt": "A cat running on the grass",
        "img_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true
    }
}'

ネガティブプロンプト

ネガティブプロンプトパラメーターを使用して、生成された動画に「花」が表示されないようにします。

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.2-i2v-plus",
    "input": {
        "prompt": "A cat running on the grass",
        "negative_prompt": "flowers",
        "img_url": "https://cdn.translate.alibaba.com/r/wanx-demo-1.png"
    },
    "parameters": {
        "resolution": "480P",
        "prompt_extend": true
    }
}'
ヘッダー

Content-Type string (必須)

リクエストのコンテンツタイプです。application/json である必要があります。

Authorization string (必須)

Model Studio API キーを使用してリクエストを認証します。例:Bearer sk-xxxx。

X-DashScope-Async string (必須)

非同期処理を有効にします。HTTP リクエストは非同期呼び出しのみをサポートします。enable である必要があります。

重要

このリクエストヘッダーが欠落している場合、「current user api does not support synchronous calls」というエラーが返されます。

リクエスト本文

model string (必須)

モデル名です。利用可能なモデルと料金については、「モデル料金」をご参照ください。

例:wan2.6-i2v-flash。

input object (必須)

プロンプトを含む入力フィールドです。

プロパティ

prompt string (任意)

生成される動画の目的の視覚的要素と特徴を記述します。

中国語および英語をサポートしています。各文字は 1 文字としてカウントされます。制限を超えたテキストは切り捨てられます。モデルごとの文字数制限は次のとおりです。

  • Wan2.6 および Wan2.5 シリーズモデル: 最大 1,500 文字。

  • wan2.2 および wan2.1 シリーズモデル: 最大 800 文字。

例:草の上で走る子猫。

プロンプト作成のヒント:「テキストから動画/画像から動画生成プロンプトガイド」。

negative_prompt string (任意)

動画から除外する内容を記述し、出力を制約します。

中国語および英語をサポートしています。最大 500 文字。それ以上のテキストは切り捨てられます。

例:低解像度、エラー、最悪の品質、低品質、変形、余分な指、不適切な比率など。

img_url string (必須)

初期画像の URL または Base64 エンコードデータです。

画像の制約条件:

  • 画像形式:JPEG、JPG、PNG(alpha チャンネルは未対応)、BMP、WEBP。

  • 画像解像度:幅と高さの両方が [240、8000] ピクセルの範囲内である必要があります。

  • ファイルサイズ:

    • Wan2.6 および Wan2.5 シリーズモデル: 最大 20 MB。

    • wan2.2 および wan2.1 シリーズモデル: 最大 10 MB。

サポートされる入力形式:

  1. パブリック URL:

    • HTTP および HTTPS プロトコルをサポートしています。

    • 例:https://cdn.translate.alibaba.com/r/wanx-demo-1.png。

  2. Base64 エンコード画像文字列:

audio_url string (任意)

サポートモデル:Wan2.6 および Wan2.5 シリーズモデル。

オーディオファイルの URL です。モデルはこのオーディオを使用して動画を生成します。

サポートされる入力形式:

  1. パブリック URL:

    • HTTP および HTTPS プロトコルをサポートしています。

    • 例:https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/xxx.mp3。

オーディオの制約条件:

  • 形式:WAV、MP3。

  • 持続時間:3~30 秒。

  • ファイルサイズ:最大 15 MB。

  • 範囲外の処理:オーディオの持続時間が指定された duration (5 または 10 秒)を超える場合、システムは最初の 5 または 10 秒にオーディオを自動的に切り詰め、残りは破棄します。オーディオが動画の持続時間より短い場合、オーディオ終了後に動画は無音になります。たとえば、オーディオが 3 秒で動画の持続時間が 5 秒の場合、出力動画の最初の 3 秒は音声が入り、最後の 2 秒は無音になります。

例:https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3。

parameters object (任意)

解像度、持続時間、インテリジェントプロンプトリライト、ウォーターマークを制御します。

プロパティ

resolution string (任意)

重要

解像度はコストに直接影響します。API を呼び出す前に「モデル料金」をご確認ください。

出力動画の解像度階層を指定します。モデルは、選択された階層に基づいて類似の総ピクセル数になるように出力をスケーリングします。モデルは、img_url の入力画像の縦横比を可能な限り維持します。詳細については、「よくある質問」をご参照ください。

このパラメーターのデフォルト値および利用可能な列挙値は、model パラメーターに依存し、次のとおりです。

  • wan2.6-i2v-flash: 有効値:720P、1080P。デフォルト値:1080P

  • wan2.6-i2v: 有効値:720P、1080P。デフォルト値:1080P

  • wan2.6-i2v-us: 有効値:720P、1080P。デフォルト値:1080P

  • wan2.5-i2v-preview: 有効値:480P、720P、1080P。デフォルト値:1080P

  • wan2.2-i2v-flash: 有効値:480P、720P。デフォルト値:720P

  • wan2.2-i2v-plus: 有効値:480P、1080P。デフォルト値:1080P

  • wan2.1-i2v-turbo: 有効値:480P、720P。デフォルト値:720P

  • wan2.1-i2v-plus: 有効値:720P。デフォルト値:720P

例:1080P。

duration integer (任意)

重要

持続時間はコストに直接影響します。API を呼び出す前に「モデル料金」をご確認ください。

出力動画の持続時間(秒単位)です。有効値は model パラメーターに依存します。

  • wan2.6-i2v-flash: [2、15] の整数。デフォルト:5。

  • wan2.6-i2v: [2、15] の整数。デフォルト:5。

  • wan2.6-i2v-us: 有効値:5、10、15。デフォルト:5。

  • wan2.5-i2v-preview: 有効値:5、10。デフォルト:5。

  • wan2.2-i2v-plus: 固定 5 秒で変更できません。

  • wan2.2-i2v-flash: 固定 5 秒で変更できません。

  • wan2.1-i2v-plus: 固定 5 秒で変更できません。

  • wan2.1-i2v-turbo: 有効値:3、4、または 5。デフォルト:5。

例:5。

prompt_extend boolean (任意)

プロンプトリライトを有効にするかどうかを指定します。有効にすると、LLM が入力プロンプトを書き換えます。これにより、短いプロンプトの生成品質が向上しますが、処理時間が長くなります。

  • true(デフォルト)

  • false

例:true。

shot_type string (任意)

サポートモデル:Wan2.6 シリーズモデル。

生成される動画のショットタイプ(単一の連続ショットか複数ショットのシーケンスか)を指定します。

このパラメーターは、"prompt_extend": true の場合にのみ有効です。

パラメーターの優先度:shot_type > prompt。たとえば、shot_type が "single" に設定されている場合、プロンプトに「マルチショット動画を生成する」と記述されていても、モデルは単一ショット動画を出力します。

有効値:

  • single:デフォルト値。単一ショット動画を生成します。

  • multi:マルチショット動画を生成します。

例:single。

説明

製品デモ用の単一ショットやショートフィルム用の複数ショットなど、ナラティブ構造を厳密に制御する必要がある場合にこのパラメーターを使用します。

audio boolean (任意)

重要

これはコストに影響します。音声付き動画と無音動画では料金が異なります。Model Studio コンソールで料金をご確認ください。

サポートモデル:wan2.6-i2v-flash。

音声付き動画を生成するかどうかを指定します。

パラメーターの優先度:audio > audio_urlaudio=false の場合、audio_url が指定されていても出力は無音動画となり、課金も無音動画に基づいて行われます。

有効値:

  • true:デフォルト値。音声付き動画を生成します。

  • false:無音動画を生成します。

例:true。

watermark boolean (任意)

動画の右下隅に「AI 生成」ウォーターマークを追加するかどうかを指定します。

  • false:デフォルト値。ウォーターマークは追加されません。

  • true:ウォーターマークを追加します。

例:false。

seed integer (任意)

乱数シードです。値の範囲:[0、2147483647]

指定しない場合、システムが自動的に生成します。再現性を高めるには、固定シードを使用してください。

生成は確率的です。同じシードを使用しても、結果が異なる場合があります。

例:12345。

レスポンスパラメーター

成功レスポンス

task_id を保存して、タスクのステータスと結果を照会します。

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

エラーレスポンス

タスクの作成に失敗しました。「エラーコード」をご参照ください。

{
    "code": "InvalidApiKey",
    "message": "No API-key provided.",
    "request_id": "7438d53d-6eb8-4596-8835-xxxxxx"
}

output object

タスク出力に関する情報です。

プロパティ

task_id string

タスク ID です。24 時間のクエリに有効です。

task_status string

タスクのステータスです。

列挙値

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN:タスクが存在しない、またはステータスが不明です。

request_id string

トレースおよびトラブルシューティング用の一意のリクエスト識別子です。

code string

エラーコードです。失敗したリクエストでのみ返されます。「エラーコード」をご参照ください。

message string

詳細なエラーメッセージです。失敗したリクエストでのみ返されます。「エラーコード」をご参照ください。

ステップ 2:タスク結果を照会

シンガポール

GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

WorkspaceId は、実際のワークスペース IDに置き換えてください。

バージニア州

GET https://dashscope-us.aliyuncs.com/api/v1/tasks/{task_id}

中国 (北京)

GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}

フランクフルト

GET https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/tasks/{task_id}

WorkspaceId は、実際のワークスペース IDに置き換えてください。

説明
  • ポーリングの推奨事項: 動画生成には数分かかります。15 秒などの適切な間隔でポーリングメカニズムを使用してください。

  • タスクステータストランジション: PENDING → RUNNING → SUCCEEDED または FAILED。

  • 結果リンク: タスクが成功すると、24 時間有効な動画 URL が返されます。動画をダウンロードして、OSS などの永続ストレージに保存してください。

  • task_id の有効期間24 時間。この期間を過ぎると、クエリはタスクステータスを UNKNOWN として返します。

リクエストパラメーター

タスク結果の照会

{task_id} は、前の API 呼び出しで返された task_id の値に置き換えてください。task_id は 24 時間のクエリに有効です。

curl -X GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
ヘッダー

Authorization string (必須)

Model Studio API キーを使用してリクエストを認証します。例:Bearer sk-xxxx。

パスパラメーター

task_id string (必須)

タスクの ID です。

レスポンスパラメーター

タスク成功

動画 URL の有効期間は 24 時間のみで、その後自動的にパージされます。生成された動画は速やかに保存してください。

{
    "request_id": "2ca1c497-f9e0-449d-9a3f-xxxxxx",
    "output": {
        "task_id": "af6efbc0-4bef-4194-8246-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-09-25 11:07:28.590",
        "scheduled_time": "2025-09-25 11:07:35.349",
        "end_time": "2025-09-25 11:17:11.650",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "video_count": 1,
        "SR": 720
    }
}

タスク失敗

タスクが失敗した場合、task_status は FAILED となり、エラーコードとメッセージが返されます。「エラーコード」をご参照ください。

{
    "request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d",
    "output": {
        "task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010",
        "task_status": "FAILED",
        "code": "InvalidParameter",
        "message": "The size is not match xxxxxx"
    }
}

タスク照会の有効期限切れ

task_id の有効期間は 24 時間です。この期間を過ぎると、クエリは次のエラーを返します。

{
    "request_id": "a4de7c32-7057-9f82-8581-xxxxxx",
    "output": {
        "task_id": "502a00b1-19d9-4839-a82f-xxxxxx",
        "task_status": "UNKNOWN"
    }
}

output object

タスクの出力詳細です。

プロパティ

task_id string

タスク ID です。24 時間のクエリに有効です。

task_status string

タスクのステータスです。

列挙値

  • PENDING

  • RUNNING

  • SUCCEEDED

  • FAILED

  • CANCELED

  • UNKNOWN:タスクが存在しない、またはステータスが不明です。

ポーリング中のステータストランジション:

  • PENDING → RUNNING → SUCCEEDED または FAILED。

  • 初期クエリステータスは通常 PENDING または RUNNING です。

  • ステータスが SUCCEEDED に変化すると、レスポンスに生成された動画 URL が含まれます。

  • ステータスが FAILED の場合、エラーメッセージを確認してタスクを再試行してください。

submit_time string

タスクが送信された時刻です。時刻は UTC + 08:00 で、 形式は YYYY-MM-DD HH:mm:ss.SSS です。

scheduled_time string

タスクが実行された時刻です。時刻は UTC + 08:00 で、 形式は YYYY-MM-DD HH:mm:ss.SSS です。

end_time string

タスクが完了した時刻です。時刻は UTC + 08:00 で、 形式は YYYY-MM-DD HH:mm:ss.SSS です。

video_url string

生成された動画の URL です。task_status が SUCCEEDED の場合にのみ返されます。

24 時間有効です。動画は H.264 エンコーディングの MP4 形式です。

orig_prompt string

元の入力プロンプトで、リクエストパラメーター prompt に対応します。

actual_prompt string

prompt_extendtrue の場合、システムがプロンプトを書き換え、このフィールドに最適化されたバージョンが含まれます。

  • prompt_extend=false の場合、このフィールドは返されません。

  • 注:wan2.6 モデルは、prompt_extend の値に関係なく、このフィールドを返しません。

code string

エラーコードです。失敗したリクエストでのみ返されます。「エラーコード」をご参照ください。

message string

詳細なエラーメッセージです。失敗したリクエストでのみ返されます。「エラーコード」をご参照ください。

usage object

タスクの使用量統計です。成功したタスクでのみカウントされます。

プロパティ

Wan2.6 シリーズモデルが返すパラメーター

input_video_duration integer

入力動画の持続時間(秒単位)です。現在、動画入力はサポートされていないため、常に 0 です。

output_video_duration integer

Wan2.6 モデルを使用する場合にのみ返されます。

出力動画の持続時間(秒単位)です。この値は input.duration と一致します。

duration integer

課金に使用される合計動画持続時間です。

課金式:duration=input_video_duration+output_video_duration

SR integer

Wan2.6 モデルを使用する場合にのみ返されます。生成された動画の解像度階層です。例:720。

video_count integer

生成された動画の数です。これは常に 1 です。

audioboolean

Wan2.6-i2v-flash モデルを使用する場合にのみ返されます。出力が音声付き動画かどうかを示します。

Wan2.2 および Wan2.5 シリーズモデルが返すパラメーター

duration integer

生成された動画の持続時間(秒単位)です。有効値:5、10。

課金式:コスト = 動画持続時間(秒) × 単価。

SR integer

生成された動画の解像度です。有効値:480、720、1080。

video_count integer

生成された動画の数です。これは常に 1 です。

Wan2.1 シリーズモデルが返すパラメーター

video_duration integer

生成された動画の持続時間(秒単位)です。有効値:3、4、5。

課金式:コスト = 動画持続時間(秒) × 単価。

video_ratio string

生成された動画の縦横比です。この値は常に "standard" です。

video_count integer

生成された動画の数です。これは常に 1 です。

request_id string

トレースおよびトラブルシューティング用の一意のリクエスト識別子です。

DashScope SDK 呼び出し

SDK のパラメーター名はHTTP API とほぼ一致しており、各言語の規則に従っています。

画像から動画生成タスクには通常 1~5 分かかります。SDK は非同期 HTTP 呼び出しプロセスをラップし、同期および非同期の両方の呼び出しをサポートしています。

処理時間はタスクキューおよびサービスステータスに依存します。

Python SDK

重要

以下のコードを実行する前に、DashScope Python SDK のバージョンが少なくとも 1.25.8 であることを確認してください。

古いバージョンでは、「url error, please check url!」などのエラーが発生する可能性があります。更新方法については、「SDK のインストール」をご参照ください。

base_http_api_url は、モデルのリージョンに応じて設定します。

シンガポール

dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

WorkspaceId は、実際のワークスペース IDに置き換えてください。

米国 (バージニア)

dashscope.base_http_api_url = 'https://dashscope-us.aliyuncs.com/api/v1'

北京

dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'

フランクフルト

dashscope.base_http_api_url = 'https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1'

呼び出し時に、WorkspaceId を実際のワークスペース IDに置き換えてください。

サンプルコード

同期呼び出し

同期呼び出しは、動画生成が完了するまでブロッキングされます。この例では、パブリック URL、Base64 エンコーディング、ローカルファイルパスの 3 つの画像入力方法を示します。

リクエスト例
import base64
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import mimetypes
import dashscope

# 以下の URL はシンガポールリージョン用です。WorkspaceId を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'


# 環境変数が設定されていない場合は、次の行を Model Studio から取得した API キー(api_key="sk-xxx")に置き換えてください。
# API キーの取得方法:https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

# --- Base64 エンコーディング用のヘルパー関数 ---
# 形式:data:{MIME_type};base64,{base64_data}
def encode_file(file_path):
    mime_type, _ = mimetypes.guess_type(file_path)
    if not mime_type or not mime_type.startswith("image/"):
        raise ValueError("Unsupported or unrecognized image format")
    with open(file_path, "rb") as image_file:
        encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
    return f"data:{mime_type};base64,{encoded_string}"

"""
画像入力方法:
以下の 3 つの方法で画像を提供できます。いずれか 1 つを選択してください。

1. パブリック URL:すでに公開アクセス可能な画像に最適です。
2. ローカルファイル:ローカル開発およびテストに適しています。
3. Base64 エンコーディング:非公開画像またはデータを安全に送信する必要がある場合に最適です。
"""

# [方法 1] 公開アクセス可能な画像 URL を使用
# 例:パブリック画像 URL を使用
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"

# [方法 2] ローカルファイルを使用(絶対パスおよび相対パスをサポート)
# 形式:file:// + ファイルパス
# 例(絶対パス):
# img_url = "file://" + "/path/to/your/img.png"    # Linux/macOS
# img_url = "file://" + "C:/path/to/your/img.png"  # Windows
# 例(相対パス):
# img_url = "file://" + "./img.png"                # 現在のスクリプトディレクトリに対する相対パス

# [方法 3] Base64 エンコード画像を使用
# img_url = encode_file("./img.png")

# オーディオ URL を設定
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"

def sample_call_i2v():
    # 同期呼び出しは結果を直接返します。
    print('please wait...')
    rsp = VideoSynthesis.call(api_key=api_key,
                              model='wan2.6-i2v-flash',
                              prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
                              img_url=img_url,
                              audio_url=audio_url,
                              resolution="720P",
                              duration=10,
                              prompt_extend=True,
                              watermark=False,
                              negative_prompt="",
                              seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("video_url:", rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_call_i2v()
レスポンス例
video_url の有効期間は 24 時間です。期限切れになる前に動画をダウンロードしてください。
{
    "status_code": 200,
    "request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2026-01-22 23:24:46.527",
        "scheduled_time": "2026-01-22 23:24:46.565",
        "end_time": "2026-01-22 23:25:59.978",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
    },
    "usage": {
        "video_count": 1,
        "video_duration": 0,
        "video_ratio": "",
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "audio": true,
        "SR": 720
    }
}

非同期呼び出し

非同期呼び出しはすぐにタスク ID を返します。その後、結果をポーリングするか、完了を待機します。

リクエスト例
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 以下の URL はシンガポールリージョン用です。WorkspaceId を実際のワークスペース ID に置き換えてください。URL はリージョンによって異なります。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'


# 環境変数が設定されていない場合は、次の行を Model Studio から取得した API キー(api_key="sk-xxx")に置き換えてください。
# API キーの取得方法:https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")

# 公開アクセス可能な画像 URL を使用
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"

# オーディオ URL を設定
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"


def sample_async_call_i2v():
    # 非同期呼び出し、タスク ID を返します
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.6-i2v-flash',
                                    prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
                                    img_url=img_url,
                                    audio_url=audio_url,
                                    resolution="720P",
                                    duration=10,
                                    prompt_extend=True,
                                    watermark=False,
                                    negative_prompt="",
                                    seed=12345)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print("task_id: %s" % rsp.output.task_id)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))

    # 非同期タスクのステータスを取得
    status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
    if status.status_code == HTTPStatus.OK:
        print(status.output.task_status)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (status.status_code, status.code, status.message))

    # 非同期タスクの完了を待機
    rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
    print(rsp)
    if rsp.status_code == HTTPStatus.OK:
        print(rsp.output.video_url)
    else:
        print('Failed, status_code: %s, code: %s, message: %s' %
              (rsp.status_code, rsp.code, rsp.message))


if __name__ == '__main__':
    sample_async_call_i2v()
レスポンス例

1. タスク作成レスポンス

{
    "status_code": 200,
    "request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx",
    "code": "",
    "message": "",
    "output": {
        "task_id": "686391d9-7ecf-4290-a8e9-xxxxxx",
        "task_status": "PENDING",
        "video_url": ""
    },
    "usage": null
}

2. タスク照会レスポンス

video_url の有効期間は 24 時間です。期限切れになる前に動画をダウンロードしてください。
{
    "status_code": 200,
    "request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
    "code": null,
    "message": "",
    "output": {
        "task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "submit_time": "2026-01-22 23:24:46.527",
        "scheduled_time": "2026-01-22 23:24:46.565",
        "end_time": "2026-01-22 23:25:59.978",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
    },
    "usage": {
        "video_count": 1,
        "video_duration": 0,
        "video_ratio": "",
        "duration": 10,
        "input_video_duration": 0,
        "output_video_duration": 10,
        "audio": true,
        "SR": 720
    }
}

Java SDK

重要

以下のコードを実行する前に、DashScope Java SDK のバージョンが少なくとも 2.22.6 であることを確認してください。

古いバージョンでは、「url error, please check url!」などのエラーが発生する可能性があります。更新方法については、「SDK のインストール」をご参照ください。

baseHttpApiUrl は、モデルのリージョンに応じて設定します。

シンガポール

Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";

WorkspaceId は、実際のワークスペース IDに置き換えてください。

米国 (バージニア)

Constants.baseHttpApiUrl = "https://dashscope-us.aliyuncs.com/api/v1";

北京

Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";

フランクフルト

Constants.baseHttpApiUrl = "https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1";

呼び出し時に、WorkspaceId を実際のワークスペース IDに置き換えてください。

サンプルコード

同期呼び出し

同期呼び出しは、動画生成が完了するまでブロッキングされます。この例では、パブリック URL、Base64 エンコーディング、ローカルファイルパスの 3 つの画像入力方法を示します。

リクエスト例
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

 
public class Image2Video {

    static {
        // エンドポイントを設定します。この例ではシンガポールリージョンを使用しています。他のリージョンについては、https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数が設定されていない場合は、次の行を Model Studio から取得した API キー(apiKey="sk-xxx")に置き換えてください。
    // API キーの取得方法:https://www.alibabacloud.com/help/en/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");
    
    /**
     * 画像入力方法:以下の 3 つのうちいずれか 1 つを選択してください。
     *
     * 1. パブリック URL:すでに公開アクセス可能な画像に最適です。
     * 2. ローカルファイル:ローカル開発およびテストに適しています。
     * 3. Base64 エンコーディング:非公開画像またはデータを安全に送信する必要がある場合に最適です。
     */

    // [方法 1] パブリック URL
    static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";

    // [方法 2] ローカルファイルパス(file:// + 絶対パス)
    // static String imgUrl = "file://" + "/your/path/to/img.png";    // Linux/macOS
    // static String imgUrl = "file://" + "C:/your/path/to/img.png";  // Windows

    // [方法 3] Base64 エンコーディング
    // static String imgUrl = Image2Video.encodeFile("/your/path/to/img.png");
    
    // オーディオ URL を設定
    static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";

    public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
        // パラメーターを設定
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-i2v-flash")
                        .prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
                        .imgUrl(imgUrl)
                        .audioUrl(audioUrl)
                        .duration(10)
                        .parameters(parameters)
                        .resolution("720P")
                        .negativePrompt("")
                        .build();
        System.out.println("please wait...");
        VideoSynthesisResult result = vs.call(param);
        System.out.println(JsonUtils.toJson(result));
    }
    
     /**
     * ファイルを Base64 文字列にエンコードします。
     * @param filePath ファイルパス。
     * @return MIME_type};base64,{base64_data} 形式の Base64 文字列。
     */
    public static String encodeFile(String filePath) {
        Path path = Paths.get(filePath);
        if (!Files.exists(path)) {
            throw new IllegalArgumentException("File does not exist: " + filePath);
        }
        // MIME タイプを検出
        String mimeType = null;
        try {
            mimeType = Files.probeContentType(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Cannot detect file type: " + filePath);
        }
        if (mimeType == null || !mimeType.startsWith("image/")) {
            throw new IllegalArgumentException("Unsupported or unrecognized image format");
        }
        // ファイル内容を読み取り、エンコード
        byte[] fileBytes = null;
        try{
            fileBytes = Files.readAllBytes(path);
        } catch (IOException e) {
            throw new IllegalArgumentException("Cannot read file content: " + filePath);
        }
    
        String encodedString = Base64.getEncoder().encodeToString(fileBytes);
        return "data:" + mimeType + ";base64," + encodedString;
    }
    

    public static void main(String[] args) {
        try {
            image2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
レスポンス例
video_url の有効期間は 24 時間です。期限切れになる前に動画をダウンロードしてください。
{
    "request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
    "output": {
        "task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "submit_time": "2026-01-22 23:25:45.729",
        "scheduled_time": "2026-01-22 23:25:45.771",
        "end_time": "2026-01-22 23:26:44.942"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "input_video_duration": 0.0,
        "output_video_duration": 10.0,
        "SR": "720"
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

非同期呼び出し

非同期呼び出しはすぐにタスク ID を返します。その後、結果をポーリングするか、完了を待機します。

リクエスト例
// Copyright (c) Alibaba, Inc. and its affiliates.

import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

import java.util.HashMap;
import java.util.Map;

public class Image2Video {

    static {
        // エンドポイントを設定します。この例ではシンガポールリージョンを使用しています。他のリージョンについては、https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数が設定されていない場合は、次の行を Model Studio から取得した API キー(apiKey="sk-xxx")に置き換えてください。
    // API キーの取得方法:https://www.alibabacloud.com/help/en/model-studio/get-api-key
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");
    // 入力画像 URL を設定
    static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";

    // オーディオ URL を設定
    static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";

    public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
        // パラメーターを設定
        Map<String, Object> parameters = new HashMap<>();
        parameters.put("prompt_extend", true);
        parameters.put("watermark", false);
        parameters.put("seed", 12345);

        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-i2v-flash")
                        .prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
                        .imgUrl(imgUrl)
                        .audioUrl(audioUrl)
                        .duration(10)
                        .parameters(parameters)
                        .resolution("720P")
                        .negativePrompt("")
                        .build();
        // 非同期呼び出し
        VideoSynthesisResult task = vs.asyncCall(param);
        System.out.println(JsonUtils.toJson(task));
        System.out.println("please wait...");

        // 結果を取得
        VideoSynthesisResult result = vs.wait(task, apiKey);
        System.out.println(JsonUtils.toJson(result));
    }

    // タスクリストを取得
    public static void listTask() throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        AsyncTaskListParam param = AsyncTaskListParam.builder().build();
        param.setApiKey(apiKey);
        VideoSynthesisListResult result = is.list(param);
        System.out.println(result);
    }

    // 単一タスクの結果を取得
    public static void fetchTask(String taskId) throws ApiException, NoApiKeyException {
        VideoSynthesis is = new VideoSynthesis();
        // DASHSCOPE_API_KEY が環境変数として設定されている場合、apiKey は null にできます。
        VideoSynthesisResult result = is.fetch(taskId, apiKey);
        System.out.println(result.getOutput());
        System.out.println(result.getUsage());
    }

    public static void main(String[] args) {
        try {
            image2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}
レスポンス例

1. タスク作成レスポンス

{
    "request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
    "output": {
        "task_id": "7277e20e-aa01-4709-xxxxxxxx",
        "task_status": "PENDING"
    }
}

2. タスク照会レスポンス

video_url の有効期間は 24 時間です。期限切れになる前に動画をダウンロードしてください。
{
    "request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
    "output": {
        "task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
        "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
        "submit_time": "2026-01-22 23:25:45.729",
        "scheduled_time": "2026-01-22 23:25:45.771",
        "end_time": "2026-01-22 23:26:44.942"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "input_video_duration": 0.0,
        "output_video_duration": 10.0,
        "SR": "720"
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

制限事項

  • データ保持期間task_id および動画 URL は 24 時間保持されます。この期間を過ぎると、照会またはダウンロードができなくなります。

  • コンテンツモデレーション: すべての入力(プロンプト、画像)および出力動画はコンテンツモデレーションの対象となります。違反がある場合、IPInfringementSuspect または DataInspectionFailed エラーが発生します。「エラーコード」をご参照ください。

エラーコード

モデル呼び出しがエラーメッセージを返す場合、「エラーコード」をご参照ください。

よくある質問

Q:特定の縦横比を持つ動画を生成するにはどうすればよいですか?

A: 出力動画の縦横比は入力先頭フレーム画像(img_url)によって決まります。ただし、正確な比率(例:3:4)が保証されるわけではありません。わずかな偏差が生じる可能性があります。

  • なぜ偏差が生じるのですか?

    モデルは入力画像の縦横比をベースラインとして使用し、選択された解像度階層(resolution)の総ピクセル数と組み合わせて、最も近い有効な解像度を計算します。動画の幅と高さは 16 の倍数である必要があるため、モデルは最終的な解像度をそれに応じて調整します。その結果、出力の縦横比が正確に 3:4 になるとは限りませんが、非常に近い値になります。

    • 例:750×1000(縦横比 3:4 = 0.75)の入力画像で resolution を "720P"(目標総ピクセル数約 920,000)に設定すると、816×1104(縦横比 ≈ 0.739、総ピクセル数約 900,000)の出力が生成されます。

  • 推奨事項

    • 入力を制御: 最良の結果を得るには、目的の縦横比を持つ先頭フレーム画像を使用してください。

    • 後処理: 厳密な縦横比が必要な場合は、生成後に編集ツールを使用して動画をトリミングするか、黒枠を追加してください。

Q:動画ストレージドメインのホワイトリストを取得するにはどうすればよいですか?

A: モデルによって生成された動画は OSS に保存されます。API は一時的なパブリック URL を返します。このダウンロード URL のファイアウォールホワイトリストを設定するには、次の点にご注意ください。基盤となるストレージは動的に変更される可能性があります。このトピックでは、情報の古さによるアクセス障害を防ぐため、固定の OSS ドメイン名ホワイトリストを提供していません。セキュリティ制御の要件がある場合は、アカウントマネージャーに連絡して最新の OSS ドメイン名リストを取得してください。