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

Alibaba Cloud Model Studio:テキスト動画生成

最終更新日:Sep 09, 2026

Wan テキスト動画生成モデルは、テキスト、画像、音声の入力から動画を生成します。wan3.0-video は、最大 30 秒、アダプティブアスペクト比、スマートデュレーション、480P/720P/1080P の解像度、オーディオ切り替え、参照オーディオ、参照ファイル、ウェブリンクをサポートしています。

クイックアクセス: オンラインで試す (シンガポール | 米国 (バージニア) | 中国 (北京)) | API リファレンス | プロンプトガイド

はじめに

入力プロンプト出力動画 (マルチショット、オーディオ対応)

ショット 1 超ロングショットでシーケンスが始まります。カメラは地面近くのローアングルからスタートし、草原を前進しながら上方にティルトします。カメラが地面レベルから少し高い位置に上昇するにつれて、チーターが左からフレームインします。このショットは、チーターと逃げるアンテロープを同じ経路上に配置することで、明確な空間関係を確立します。ショット 2 カメラは地面近くまで下降し、チーターと平行に右にトラッキングします。チーターは常に中央より左に保たれ、背景に連続的な横方向のシフトを生み出します。しばらくの間、カメラの動きは安定しており、スピード感と空間的な連続性を高めます。ショット 3 右への移動を続けながら、カメラはチーターの進路の内側に沿ってわずかな円弧を描きます。この動きは、カメラが被写体を追い続ける中で、フレーム内に微妙な周回効果を生み出します。ショット 4 カメラは横方向の動きを徐々に遅くし、比較的安定した位置に移行すると同時にズームインします。このアクションにより、チーターとアンテロープの間の縮まる距離に焦点が絞られます。ショット 5 カメラは再び前進し、わずかに下降して地面に近づき、2 頭の動物の間の距離を縮めます。ショットは、チーターの前足がアンテロープの後ろ足に届こうとするまさにその瞬間に停止し、強烈なプレッシャーと緊張感を生み出します。このアクションは、クレッシェンドする交響曲のスコア、密度を増すドラムビート、そしてリズムを刻む風と足音と同期しています。最後の瞬間、音楽のボリュームが下がり、環境音とリズミカルな音だけが残り、短い間を作り出します。

API を呼び出す前に、API キーを取得し、環境変数として設定してください。SDK を使用するには、DashScope SDK をインストールします。すべての例では、動画生成タスクを送信し、結果をポーリングする非同期呼び出しを使用しています。

Python SDK

重要次のコードを実行する前に、Python 用 DashScope SDK のバージョンが 1.25.16 以降であることを確認してください。

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

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY", "YOUR_API_KEY")

print('しばらくお待ちください...')
rsp = VideoSynthesis.call(api_key=api_key,
                          model='wan3.0-video',
                          prompt='ショット 1:ロングショットで開始。カメラは地面に近いローアングルからスタートし、草原を前進します。同時に、カメラは上方に移動し、視点を地面レベルからわずかに高い位置に徐々に上げます。チーターが左からフレームインし、前方を逃げるアンテロープと同じ追跡経路上にあり、明確な前景と背景の空間関係を確立します。ショット 2:カメラは下方に移動し、地面に近い位置に戻り、右にパンしてチーターの動きを追います。安定した平行なサイドビューで追跡します。被写体は常にフレームの中央よりわずかに左に配置され、背景に連続的な横方向の動きの効果を生み出します。カメラの動きはしばらく安定しており、スピード感と空間的な連続性を高めます。ショット 3:右への移動を維持しながら、カメラはチーターの進路の内側に沿ってわずかな円弧を描くように移動します。これにより、ショットに微妙な周回効果が生まれますが、カメラは常に被写体と同じ方向に移動します。ショット 4:横方向の動きを徐々に遅くし、比較的安定したカメラ位置に移行します。同時にズームインを実行し、チーターとアンテロープの間の縮まる距離に視覚的な焦点を徐々に絞り込みます。ショット 5:カメラは再び前進し、わずかに下方に移動し、地面近くで2頭の動物の間の空間に接近します。チーターの前足がアンテロープの後ろに届こうとするまさにその瞬間にショットを保持し、強烈なプレッシャーと緊張感を生み出します。これには、クレッシェンドする交響曲のスコア、ますます激しくなるドラムビート、そしてリズムを刻む風と足音が伴います。最後の瞬間、音楽のボリュームが下がり、環境音とリズミカルな音だけが残り、短い間を作り出します。',
                          resolution="720P",
                          ratio="16:9",
                          duration=15,
                          watermark=True)
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))

Java SDK

重要次のコードを実行する前に、Java 用 DashScope SDK のバージョンが 2.22.14 以降であることを確認してください。

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

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;

public class Text2Video {

    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行をご利用の Model Studio API キーに置き換えてください: apiKey="sk-xxx"
    // API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan3.0-video")
                        .prompt("ショット 1:ロングショットで開始。カメラは地面近くのローアングルからスタートし、草原をドリーフォワードしながら同時にクレーンアップします。視点は地面レベルから少し高い位置に持ち上がり、チーターが左からフレームインし、前方を逃げるアンテロープと同じ追跡経路上に配置され、明確な空間的な奥行きを確立します。ショット 2:カメラは地面近くまで下がり、右にトラッキングしてチーターの動きを追います。安定した平行なトラッキングショットを維持します。被写体はフレームの中央よりわずかに左に留まり、背景に連続的な横方向の動きを生み出します。カメラの動きはしばらく安定しており、スピード感と空間的な連続性を高めます。ショット 3:右へのトラッキングを維持しながら、カメラはチーターの進路の内側に沿ってわずかな円弧を描きます。これにより、ショットに微妙な周回効果が生まれますが、カメラは常に被写体と同じ方向を向いています。ショット 4:横方向の動きを徐々に遅くし、比較的安定したカメラ位置に移行します。同時にズームインを実行し、チーターとアンテロープの間の縮まる距離に視覚的な焦点を徐々に絞り込みます。ショット 5:カメラは再び前進し、わずかに下方に移動し、地面に近づいて2頭の間の空間に接近します。チーターの前足がアンテロープの後部に届こうとするまさにその瞬間に停止し、強烈なプレッシャーと緊張感を生み出します。これには、徐々に強まるオーケストラのスコア、ますます密度を増すドラムビート、そしてリズムを刻む風と足音が伴います。最終段階では、音楽のボリュームが下げられ、環境音とリズミカルな音だけが残り、短い間を作り出します。")
                        .duration(15)
                        .resolution("720P")
                        .ratio("16:9")
                        .watermark(true)
                        .build();
        System.out.println("しばらくお待ちください...");
        VideoSynthesisResult result = vs.call(param);
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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": "wan3.0-video",
    "input": {
        "prompt": "ショット 1:超ロングショットでシーンが始まります。カメラは地面近くのローアングルからスタートし、草原を前進します。同時に上にティルトし、視点を地面レベルから少し高い位置に上げます。これにより、チーターが左からフレームインし、前方を逃げるアンテロープと同じ追跡経路上に配置され、明確な空間関係が確立されます。ショット 2:カメラは下に移動し、地面近くに戻り、チーターの進行経路に沿って右にトラッキングします。安定した平行な側面からの追跡ショットを維持し、背景が水平にスクロールする間、被写体をフレームの中央左に保ちます。カメラの動きはしばらく安定しており、スピード感と空間的な連続性を高めます。ショット 3:右へのトラッキングを続けながら、カメラはチーターの進路の内側に沿ってわずかな円弧を描き、常に被写体と同じ方向に移動しながら微妙な周回効果を生み出します。ショット 4:カメラは横方向の動きを徐々に遅くし、ズームインしながら比較的安定した位置に移行します。これにより、チーターとアンテロープの間の縮まる距離に視覚的な焦点が徐々に圧縮されます。ショット 5:カメラは再び前進し、わずかに下に移動し、地面近くでそれらの間の空間に接近します。チーターの前足がアンテロープの後部に届こうとするまさにその瞬間に停止し、強烈なプレッシャーと緊張感を生み出します。これには、交響曲のクレッシェンド、加速するドラムビート、そしてリズムを刻む風と足音が伴います。最終段階では、音楽はフェードアウトし、環境音とリズミカルなビートだけが残り、短い間を作り出します。"
    },
    "parameters": {
        "resolution": "720P",
        "ratio": "16:9",
        "watermark": true,
        "duration": 15
    }
}'
ステップ 2:タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えます。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

サンプルコード:wan2.6 以前のモデル

Python SDK

重要次のコードを実行する前に、Python 用 DashScope SDK のバージョンが 1.25.16 以降であることを確認してください。

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

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY", "YOUR_API_KEY")

print('しばらくお待ちください...')
rsp = VideoSynthesis.call(api_key=api_key,
                          model='wan2.6-t2v',
                          prompt='映画的なストーリーテリングによるスリリングな探偵追跡劇。ショット 1 [0-3s]:夜の雨のニューヨークの通り、ネオンが点滅し、黒いトレンチコートの探偵が早足で歩いているワイドショット。ショット 2 [3-6s]:探偵が古い建物に入り、雨がコートを濡らし、ドアがゆっくりと後ろで閉まるミディアムショット。ショット 3 [6-9s]:遠くでサイレンが鳴り響く中、探偵の集中した決意の目にクローズアップし、彼は考え込んでわずかに眉をひそめる。ショット 4 [9-12s]:探偵が薄暗い廊下を慎重に進み、懐中電灯が前方の道を照らすミディアムショット。ショット 5 [12-15s]:探偵が重要な手がかりを発見し、突然のひらめきで顔が明るくなるクローズアップ。',
                          size="1280*720",
                          duration=15,
                          shot_type="multi",
                          watermark=True)
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))

Java SDK

重要次のコードを実行する前に、Java 用 DashScope SDK のバージョンが 2.22.14 以降であることを確認してください。

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

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;

public class Text2Video {

    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行を apiKey="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
    // API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-t2v")
                        .prompt("映画的なストーリーテリングによるスリリングな探偵追跡劇。ショット 1 [0-3s]:夜の雨のニューヨークの通り、ネオンが点滅し、黒いトレンチコートの探偵が早足で歩いているワイドショット。ショット 2 [3-6s]:探偵が古い建物に入り、雨がコートを濡らし、ドアがゆっくりと後ろで閉まるミディアムショット。ショット 3 [6-9s]:遠くでサイレンが鳴り響く中、探偵の集中した決意の目にクローズアップし、彼は考え込んでわずかに眉をひそめる。ショット 4 [9-12s]:探偵が薄暗い廊下を慎重に進み、懐中電灯が前方の道を照らすミディアムショット。ショット 5 [12-15s]:探偵が重要な手がかりを発見し、突然のひらめきで顔が明るくなるクローズアップ。")
                        .duration(15)
                        .size("1280*720")
                        .shotType("multi")
                        .watermark(true)
                        .build();
        System.out.println("しばらくお待ちください...");
        VideoSynthesisResult result = vs.call(param);
        System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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-t2v",
    "input": {
        "prompt": "映画的なストーリーテリングによるスリリングな探偵追跡劇。ショット 1 [0-3s]:夜の雨のニューヨークの通り、ネオンが点滅し、黒いトレンチコートの探偵が早足で歩いているワイドショット。ショット 2 [3-6s]:探偵が古い建物に入り、雨がコートを濡らし、ドアがゆっくりと後ろで閉まるミディアムショット。ショット 3 [6-9s]:遠くでサイレンが鳴り響く中、探偵の集中した決意の目にクローズアップし、彼は考え込んでわずかに眉をひそめる。ショット 4 [9-12s]:探偵が薄暗い廊下を慎重に進み、懐中電灯が前方の道を照らすミディアムショット。ショット 5 [12-15s]:探偵が重要な手がかりを発見し、突然のひらめきで顔が明るくなるクローズアップ。"
    },
    "parameters": {
        "size": "1280*720",
        "watermark": true,
        "duration": 15,
        "shot_type":"multi"
    }
}'
ステップ 2:タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えます。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

video_url の有効期間は 24 時間です。速やかに動画をダウンロードしてください。

{
    "request_id": "c1209113-8437-424f-a386-xxxxxx",
    "output": {
        "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
    }
}

利用可能状況

サポートされているモデルはリージョンによって異なります。リソースはリージョン間で分離されています。呼び出しを行う際は、モデル、エンドポイント URL、API キーがすべて同じリージョンに属していることを確認してください。リージョンをまたいだ呼び出しは失敗します。

サポートされているモデル

グローバル

グローバルのデプロイメント範囲を選択した場合、モデル推論の計算リソースは世界中で動的にスケジュールされます。静的データは選択したリージョンに保存されます。サポートされているリージョン:米国 (バージニア)、ドイツ (フランクフルト)、中国 (香港)。

モデル

機能

入力モダリティ

出力動画の仕様

wan2.6-t2v 推奨

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:5s、10s、15s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

インターナショナル

インターナショナルのデプロイメント範囲を選択した場合、モデル推論の計算リソースは中国本土を除き、世界中で動的にスケジュールされます。静的データは選択したリージョンに保存されます。サポートされているリージョン:シンガポール。

モデル機能入力モダリティ出力動画の仕様

wan2.7-t2v-2026-04-25 推奨

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.7-t2v

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.6-t2v

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.5-t2v-preview

オーディオ付き動画

音声と動画の同期

テキスト、オーディオ

解像度オプション:480P、720P、1080P

動画の持続時間:5s、10s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.2-t2v-plus

サイレント動画

2.1 モデルと比較して安定性と成功率が向上しました。

テキスト

解像度オプション:480P、1080P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.1-t2v-turbo

サイレント動画

テキスト

解像度オプション:480P、720P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.1-t2v-plus

サイレント動画

テキスト

解像度オプション:720P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

米国

米国のデプロイメント範囲を選択した場合、モデル推論の計算リソースは米国に制限されます。静的データは選択したリージョンに保存されます。サポートされているリージョン:米国 (バージニア)。

モデル

機能

入力モダリティ

出力動画の仕様

wan2.6-t2v-us 推奨

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:5s、10s、15s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

中国本土

中国本土のデプロイメント範囲を選択した場合、モデル推論の計算リソースは中国本土に制限されます。静的データは選択したリージョンに保存されます。サポートされているリージョン:中国 (北京)。

モデル機能入力モダリティ出力動画の仕様

wan2.7-t2v-2026-04-25 推奨

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.7-t2v

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.6-t2v

オーディオ付き動画

マルチショットナラティブ、音声と動画の同期

テキスト、オーディオ

解像度オプション:720P、1080P

動画の持続時間:[2s, 15s] (整数)

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.5-t2v-preview

オーディオ付き動画

音声と動画の同期

テキスト、オーディオ

解像度オプション:480P、720P、1080P

動画の持続時間:5s、10s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wan2.2-t2v-plus

サイレント動画

2.1 モデルと比較して安定性と成功率が向上しました。

テキスト

解像度オプション:480P、1080P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wanx2.1-t2v-turbo

サイレント動画

テキスト

解像度オプション:480P、720P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

wanx2.1-t2v-plus

サイレント動画

テキスト

解像度オプション:720P

動画の持続時間:5s

定義された仕様:30 fps、MP4 (H.264 エンコーディング)

注記このトピックのサンプルコードは、シンガポールリージョンに適用されます。

コア機能

マルチショット動画の作成

サポートされているモデルwan3.0、wan2.7、および wan2.6 シリーズ

説明:ワイドショットからクローズアップなど、ショットを自動的に切り替えます。ミュージックビデオや映画的なナラティブに最適です。

パラメーター

  • wan2.7shot_type パラメーターは不要です。prompt で、タイムスタンプなどの自然言語を使用してショット構造を記述します。prompt にショット構造の記述が含まれていない場合、モデルはセマンティクスを分析し、シングルショットまたはマルチショットの動画を生成するかどうかを自動的に決定します。
  • wan2.6shot_type パラメーターを "multi" に設定し、prompt_extend パラメーターを true に設定して、ショット記述を最適化するためのインテリジェントな書き換えを有効にする必要があります。
入力プロンプト出力動画 (wan3.0)

未来のテクノロジーと自然の調和のビジョン。ショット 1 [0-2s]:未来都市の空中庭園のワイドショット、浮遊する植物がそよ風に優しく揺れる。ショット 2 [2-4s]:ロボット庭師が正確で優雅な動きで植物を慎重にトリミングする。ショット 3 [4-7s]:透明なドームから太陽光が差し込み、庭園全体を照らし、テクノロジーと自然の完璧な融合を示す。ショット 4 [7-10s]:カメラが引き、未来都市全体の壮大なスケールを明らかにし、空中庭園はその一部にすぎない。

これは、ハードコアな決闘を中心とした武術映画のクリップです。真昼の太陽の下、石の広場で二人の男が互いに突進します。一人が掌で攻撃しますが、相手は回転して腕でブロックし、その衝撃で地面から埃が舞い上がります。その後、狭い空間で素早いパンチと掌打を交換します。一人が空中に跳び上がり、一連の重いキックを繰り出し、相手は腕を交差させてブロックし、数メートル後退させられ、石の表面に明確な白い跡を残します。最後に、彼らは離れて立ち、荒い息をしながら互いを見つめ合います。このシーンは、鋭い照明でリアルなアクションの質感を表現し、力強い爆発から緊張感のある対峙へと変化するトーンを作り出します。

Python SDK

Python 用 DashScope SDK のバージョンが 1.25.16 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を api_key="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
# API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # task_id を返す非同期呼び出し。
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan3.0-video',
                                    prompt='未来のテクノロジーと自然の調和のビジョン。ショット 1 [0-2s]:未来都市の空中庭園のワイドショット、浮遊する植物がそよ風に優しく揺れる。ショット 2 [2-4s]:ロボット庭師が正確で優雅な動きで植物を慎重にトリミングする。ショット 3 [4-7s]:透明なドームから太陽光が差し込み、庭園全体を照らし、テクノロジーと自然の完璧な融合を示す。ショット 4 [7-10s]:カメラが引き、未来都市全体の壮大なスケールを明らかにし、空中庭園はその一部にすぎない。',
                                    resolution='720P',
                                    ratio='16:9',
                                    duration=10,
                                    watermark=True,
                                    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))

    # 非同期タスクが完了するのを待ちます。
    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_t2v()

Java SDK

Java 用 DashScope SDK のバージョンが 2.22.14 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

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;

public class Text2Video {
    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行を apiKey="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
    // API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
       VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan3.0-video")
                        .prompt("未来のテクノロジーと自然の調和のビジョン。ショット 1 [0-2s]:未来都市の空中庭園のワイドショット、浮遊する植物がそよ風に優しく揺れる。ショット 2 [2-4s]:ロボット庭師が正確で優雅な動きで植物を慎重にトリミングする。ショット 3 [4-7s]:透明なドームから太陽光が差し込み、庭園全体を照らし、テクノロジーと自然の完璧な融合を示す。ショット 4 [7-10s]:カメラが引き、未来都市全体の壮大なスケールを明らかにし、空中庭園はその一部にすぎない。")
                        .resolution("720P")
                        .ratio("16:9")
                        .duration(10)
                        .watermark(true)
                        .seed(12345)
                        .build();
        // 非同期呼び出し
        VideoSynthesisResult task = vs.asyncCall(param);
        System.out.println(JsonUtils.toJson(task));
        System.out.println("しばらくお待ちください...");

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

    public static void main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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": "wan3.0-video",
    "input": {
        "prompt": "ローアングルからのショット、ミディアムクローズアップ、暖色系のトーン、混合照明(デスクランプからの実用光と窓からの曇り空の光が混ざり合う)、サイドライティング、中央構図。クラシックな探偵事務所で、木製の本棚には古い事件ファイルと灰皿が詰まっている。緑色のデスクランプが、机の中央に広げられた事件ファイルを照らしている。ダークブラウンのトレンチコートとライトグレーのフェドーラ帽をかぶったキツネが革張りの椅子に座り、その毛皮は深紅色で、尾は軽く端にかかり、指は黄ばんだページをゆっくりとめくっている。外では、青空の下で霧雨が降り続き、ガラスに曲がりくねった筋を残している。彼はゆっくりと頭を上げ、耳をわずかにぴくぴくさせ、琥珀色の目でカメラをまっすぐに見つめ、口をはっきりと動かしながら、滑らかで皮肉な声で話す:「事件は冷え切っていた、冬の魚よりも冷たく。しかし、どんな鶏にも秘密がある。そして私は、それを見つけ出すつもりだった」。",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
    },
    "parameters": {
        "resolution": "720P",
        "ratio": "16:9",
        "duration": 10
    }
}'
ステップ 2:タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えます。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

サンプルコード:wan2.6

Python SDK

お使いの DashScope SDK for Python のバージョンが 1.25.16 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を実際の Model Studio API キーに置き換えてください: api_key="sk-xxx"
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # 非同期呼び出しを行い、task_id を返します。
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.6-t2v',
                                    prompt='Show a beautiful vision of the future where technology and nature coexist in harmony. Shot 1 [0-2s]: A panoramic view of a hanging garden in a futuristic city, with floating plants swaying in the breeze. Shot 2 [2-4s]: A robot gardener meticulously prunes the plants with precise and elegant movements. Shot 3 [4-7s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing the perfect fusion of technology and nature. Shot 4 [7-10s]: The camera pulls back to reveal the magnificent view of the entire futuristic city, of which the hanging garden is just one part.',
                                    size='1280*720',
                                    duration=10,
                                    shot_type='multi',
                                              watermark=True,
                                    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))

    # 非同期タスクが完了するのを待ちます。
    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_t2v()

Java SDK

お使いの DashScope Java SDK のバージョンが 2.22.14 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

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;

public class Text2Video {
    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行を実際の Model Studio API キーに置き換えてください: apiKey="sk-xxx"
    // API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
       VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-t2v")
                        .prompt("Show a beautiful vision of the future where technology and nature coexist in harmony. Shot 1 [0-2s]: A panoramic view of a hanging garden in a futuristic city, with floating plants swaying in the breeze. Shot 2 [2-4s]: A robot gardener meticulously prunes the plants with precise and elegant movements. Shot 3 [4-7s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing the perfect fusion of technology and nature. Shot 4 [7-10s]: The camera pulls back to reveal the magnificent view of the entire futuristic city, of which the hanging garden is just one part.")
                        .negativePrompt("")
                        .size("1280*720")
                        .duration(10)
                        .shotType("multi")
                        .watermark(true)
                        .seed(12345)
                        .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 main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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-t2v",
    "input": {
        "prompt": "Show a beautiful vision of the future where technology and nature coexist in harmony. Shot 1 [0-2s]: A panoramic view of a hanging garden in a futuristic city, with floating plants swaying in the breeze. Shot 2 [2-4s]: A robot gardener meticulously prunes the plants with precise and elegant movements. Shot 3 [4-7s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing the perfect fusion of technology and nature. Shot 4 [7-10s]: The camera pulls back to reveal the magnificent view of the entire futuristic city, of which the hanging garden is just one part."
    },
    "parameters": {
        "size": "1280*720",
        "watermark": true,
        "duration": 10,
        "shot_type": "multi"
    }
}'
ステップ 2:タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えてください。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

音声と映像の同期

サポート対象モデル: wan3.0、wan2.7、wan2.6、wan2.5 シリーズ

説明: ビデオ内のキャラクターが「話す」または歌うことができ、口の動きが音声と一致します。その他の例については、「ビデオ音声生成」をご参照ください。

パラメーター:

  • 音声ファイルの提供: audio_url を設定します。モデルは、音声ファイルに合わせて口の動きを同期させます。
  • 自動吹き替え: audio_url がない場合、モデルはデフォルトで自動的に音声付きビデオを生成します。映像コンテンツに基づいて、背景効果音、音楽、または音声が追加されます。
入力例出力ビデオ (音声付きビデオ)

入力プロンプト: ローアングルからの中間クローズアップで撮影され、暖色系のトーン、混合照明 (デスクランプの実用的な光が窓からの曇り空の光と混ざり合う)、サイドライティング、中央構図です。クラシックな探偵事務所で、木製の本棚には古い事件ファイルと灰皿が並んでいます。緑色のデスクランプが、机の中央に広げられた事件ファイルを照らしています。暗褐色のトレンチコートと薄灰色のフェドーラ帽をかぶったキツネが革張りの椅子に座っており、その毛皮は深紅色で、尾は端に軽く置かれ、指は黄ばんだページをゆっくりとめくっています。外では、青空の下で霧雨が降り続き、ガラスに曲がりくねった筋を残しています。彼はゆっくりと頭を上げ、耳をわずかにひくつかせ、琥珀色の目でカメラをまっすぐに見つめ、滑らかで皮肉な声で話すとき、口がはっきりと動いています: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '

入力音声:

Python SDK

お使いの DashScope SDK for Python のバージョンが 1.25.16 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を api_key="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
# API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # task_id を返す非同期呼び出し。
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan3.0-video',
                                    prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
                                    audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                                    resolution='720P',
                                    ratio='16:9',
                                    duration=10,
                                    watermark=True,
                                    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))

    # 非同期タスクの完了を待ちます。
    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_t2v()

Java SDK

お使いの DashScope SDK for Java のバージョンが 2.22.14 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

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;

public class Text2Video {
    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行を apiKey="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
    // API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
       VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan3.0-video")
                        .prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
                        .audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
                        .resolution("720P")
                        .ratio("16:9")
                        .duration(10)
                        .watermark(true)
                        .seed(12345)
                        .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 main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1: タスクを作成してタスク ID を取得
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": "wan3.0-video",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \". ",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
    },
    "parameters": {
        "resolution": "720P",
        "ratio": "16:9",
        "watermark": true,
        "duration": 10
    }
}'
ステップ 2: タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えてください。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

サンプルコード:wan2.6

Python SDK

お使いの DashScope SDK for Python のバージョンが 1.25.16 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を Model Studio API キーに置き換えてください:api_key="sk-xxx"
# API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # 非同期呼び出しを行い、task_id を返します。
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.6-t2v',
                                    prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
                                    audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                                    size='1280*720',
                                    duration=10,
                                    watermark=True,
                                    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))

    # 非同期タスクが完了するのを待ちます。
    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_t2v()

Java SDK

お使いの DashScope SDK for Java のバージョンが 2.22.14 以降であることを確認してください。SDK を更新するには、「SDK のインストール」をご参照ください。

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;

public class Text2Video {
    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数が設定されていない場合は、次の行を Model Studio API キーに置き換えてください:apiKey="sk-xxx"
    // API キーはリージョンによって異なります。API キーを取得するには、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
       VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.6-t2v")
                        .prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
                        .audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
                        .negativePrompt("")
                        .size("1280*720")
                        .duration(10)
                        .watermark(true)
                        .seed(12345)
                        .build();
        // 非同期呼び出しを行います。
        VideoSynthesisResult task = vs.asyncCall(param);
        System.out.println(JsonUtils.toJson(task));
        System.out.println("お待ちください...");

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

    public static void main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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-t2v",
    "input": {
        "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \".",
        "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
    },
    "parameters": {
        "size": "1280*720",
        "duration": 10
    }
}'
ステップ 2:タスク ID を使用して結果を取得

{task_id} を、前の API 呼び出しで返された task_id の値に置き換えてください。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際のワークスペース ID に置き換えてください。

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

無音動画の生成

サポートされているモデルwan2.2 serieswan2.1 series

説明:動的ポスターや無音のショート動画など、視覚的なコンテンツのみを必要とするシナリオに最適です。

パラメーター:wan2.2 およびそれ以前のモデルでは、デフォルトで無音動画が生成されます。追加の構成は不要です。

入力プロンプト出力動画 (無音動画)

Rim light, low contrast, medium close-up, daylight, left-heavy composition, clean single-person shot, warm tones, soft light, sunny day light, side light, daytime. A young girl sits in a field of tall grass with two fluffy donkeys standing behind her. The girl, about eleven or twelve, wears a simple floral dress, her hair in two braids, and has an innocent smile. She sits cross-legged, gently touching the wildflowers beside her. The donkeys are sturdy, their ears pricked up, curiously looking toward the camera. Sunlight bathes the field, creating a warm and natural scene.

Python SDK

お使いの DashScope SDK for Python のバージョンが 1.25.16 以降であることを確認してください。SDK をアップデートするには、「SDK のインストール」をご参照ください。

import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

# 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

# 環境変数を設定していない場合は、次の行を api_key="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
# API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
    # task_id を返す非同期呼び出し。
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                    model='wan2.2-t2v-plus',
                                    prompt='Rim light, low contrast, medium close-up, daylight, left-heavy composition, clean single-person shot, warm tones, soft light, sunny day light, side light, daytime. A young girl sits in a field of tall grass with two fluffy donkeys standing behind her. The girl, about eleven or twelve, wears a simple floral dress, her hair in two braids, and has an innocent smile. She sits cross-legged, gently touching the wildflowers beside her. The donkeys are sturdy, their ears pricked up, curiously looking toward the camera. Sunlight bathes the field, creating a warm and natural scene.',
                                              size='832*480',
                                    watermark=True,
                                    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))

    # 非同期タスクの完了を待ちます。
    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_t2v()

Java SDK

お使いの DashScope SDK for Java のバージョンが 2.22.14 以降であることを確認してください。SDK をアップデートするには、「SDK のインストール」をご参照ください。

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;

public class Text2Video {
    static {
        // 次の URL はシンガポールリージョン用です。URL はリージョンによって異なります。ご利用のリージョンの URL を取得するには、https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference をご参照ください。
        Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // 環境変数を設定していない場合は、次の行を apiKey="sk-xxx" に置き換えてください。ご利用の Model Studio API キーを使用してください。
    // API キーはリージョンによって異なります。API キーの取得方法の詳細については、https://www.alibabacloud.com/help/model-studio/get-api-key をご参照ください。
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
        VideoSynthesis vs = new VideoSynthesis();
        VideoSynthesisParam param =
                VideoSynthesisParam.builder()
                        .apiKey(apiKey)
                        .model("wan2.2-t2v-plus")
                        .prompt("Rim light, low contrast, medium close-up, daylight, left-heavy composition, clean single-person shot, warm tones, soft light, sunny day light, side light, daytime. A young girl sits in a field of tall grass with two fluffy donkeys standing behind her. The girl, about eleven or twelve, wears a simple floral dress, her hair in two braids, and has an innocent smile. She sits cross-legged, gently touching the wildflowers beside her. The donkeys are sturdy, their ears pricked up, curiously looking toward the camera. Sunlight bathes the field, creating a warm and natural scene.")
                        .size("832*480")
                        .watermark(true)
                        .seed(12345)
                        .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 main(String[] args) {
        try {
            text2video();
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.out.println(e.getMessage());
        }
        System.exit(0);
    }
}

curl

ステップ 1:タスクを作成してタスク ID を取得
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-t2v-plus",
    "input": {
        "prompt": "Rim light, low contrast, medium close-up, daylight, left-heavy composition, clean single-person shot, warm tones, soft light, sunny day light, side light, daytime. A young girl sits in a field of tall grass with two fluffy donkeys standing behind her. The girl, about eleven or twelve, wears a simple floral dress, her hair in two braids, and has an innocent smile. She sits cross-legged, gently touching the wildflowers beside her. The donkeys are sturdy, their ears pricked up, curiously looking toward the camera. Sunlight bathes the field, creating a warm and natural scene."
    },
    "parameters": {
        "size": "832*480",
        "watermark": true
    }
}'
ステップ 2:タスク ID を使用して結果を取得

前の API 呼び出しで返された {task_id}task_id の値に置き換えます。task_id は 24 時間クエリに対して有効です。{WorkspaceId} を実際の ワークスペース ID に置き換えてください。

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

入力音声

  • ファイル数: 1 つ。

  • 入力方法

    • パブリック URL: HTTP または HTTPS。

出力ビデオ

  • ビデオ数:1つ。

  • フォーマット:MP4。詳細については、「ビデオ仕様」をご参照ください。

  • URL の有効期限24 時間

  • ビデオのディメンション

    • wan3.0 および wan2.7 モデルでは、resolution パラメーターと ratio パラメーターを使用します。
    • wan2.6 以前のモデルでは、size パラメーターを使用します。

課金とレート制限

  • 無料クォータと料金詳細については、「Wanx-Text-to-Video」をご参照ください。

  • モデルのレート制限については、「Wanxiang シリーズ」をご参照ください。

  • 課金の詳細:

    • 入力は無料です。出力は、正常に生成された ビデオ秒 ごとに課金されます。
    • モデル呼び出しの失敗や処理エラーが発生した場合、料金は発生せず、無料クォータも消費されません。
    • Text-to-video は 節約プラン にも対応しています。

API リファレンス

テキスト動画変換 API リファレンス

よくある質問

Q: wan2.7 から wan3.0 にアップグレードするには、どのようなコード変更が必要ですか?

  • モデル名modelwan2.7-t2v-* から wan3.0-video に変更します。
  • prompt_extend の削除: wan3.0 は prompt_extend パラメーターをサポートしていません。このフィールドを削除してください。
  • 持続時間の延長: wan3.0 は最大 30 秒までサポートします (wan2.7 は最大 15 秒)。duration には 2 から 30 までの整数を設定してください。
  • 新しいファイルとウェブ入力: wan3.0 は input.mediatype: "file" (docx、ppt、pdf など) または type: "link" (公開ウェブ URL) を渡すことをサポートしています。モデルはコンテンツを自動的に理解し、動画を生成します。これら 2 つのタイプは同時に使用できません。

Q: コンソールで生成された動画にウォーターマークが入っています。どうすれば削除できますか?

  • Model Studio コンソールの動画生成ページにはウォーターマークのスイッチがないため、コンソールでウォーターマークを無効にすることはできません。
  • API を介してモデルを呼び出す際に、watermarkfalse に設定すると、ウォーターマークなしの動画を生成できます。
  • watermark パラメーターを省略した場合、API はデフォルトでウォーターマークを追加します。このトピックのサンプルコードでは watermark=true が渡されていますが、これを false に変更するとウォーターマークが削除されます。

Q: AI 汎用節約プランを購入しましたが、生成された動画にウォーターマークが表示されるのはなぜですか?

  • AI 汎用節約プランはコストをオフセットするためのものであり、モデルの出力を変更するものではありません。動画にウォーターマークが付くかどうかとは無関係です。
  • ウォーターマークは API の watermark パラメーターによってのみコントロールされます。false に設定するとウォーターマークが削除され、省略するとデフォルトのウォーターマークが保持されます。