Wan 2.2 テキスト動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
input: {prompt: '<string>', negative_prompt: '<string>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/wan-2.2-t2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'prompt' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'size' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}動画
Wan 2.2 テキスト動画生成
POST
/
v3
/
async
/
wan-2.2-t2v
Wan 2.2 テキスト動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
input: {prompt: '<string>', negative_prompt: '<string>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/wan-2.2-t2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'prompt' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'size' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/wan-2.2-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-t2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.2(万相 2.2)プロ版テキスト動画生成モデルは、テキスト説明に基づいて高品質な動画コンテンツを生成できます。前世代のモデルと比較して、画面ディテールとモーション安定性の両面で大幅に向上しており、長さ 5 秒および 8 秒の動画生成に対応しています。
これは非同期APIであり、非同期タスクの task_id のみを返します。この task_id を使用して タスク結果照会 API をリクエストし、動画生成結果を取得してください。
リクエストヘッダー
列挙値:
application/jsonBearer 認証形式: Bearer {{API Key}}。
リクエストボディ
動画処理パラメータ。
非表示 properties
非表示 properties
480P、720P、1080P の複数の解像度に対応し、デフォルト値は
1920*1080(1080P)です。
動画解像度を指定するために使用し、形式は幅*高さです。各モデルで対応する解像度は以下のとおりです。480P レベル:選択可能な動画解像度と対応する動画アスペクト比は以下のとおりです。832*480:16:9。480*832:9:16。624*624:1:1。
1280*720:16:9。720*1280:9:16。
1920*1080: 16:9。1080*1920: 9:16。1440*1440: 1:1。1632*1248: 4:3。1248*1632: 3:4。
size パラメータのよくある誤解:size は対象解像度の具体的な値(例:
1280*720)に設定する必要があり、アスペクト比(例:1:1)や解像度レベル名(例:480P または 720P)ではありません。生成動画の長さ。
480Pおよび720P解像度では、選択可能な長さは5または8秒です。1080P解像度では、長さは5秒に固定されます。
5。prompt のスマート書き換えを有効にするかどうか。有効にすると、大規模モデルを使用して入力 prompt をスマートに書き換えます。短い prompt では生成効果の向上が顕著ですが、処理時間が増加します。
true:デフォルト値。スマート書き換えを有効にします。false:スマート書き換えを有効にしません。
乱数シード。モデル生成内容のランダム性を制御するために使用します。値の範囲は
[0, 2147483647] です。指定しない場合、アルゴリズムが自動的に乱数を生成してシードとして使用します。生成内容を比較的安定させたい場合は、同じ seed パラメータ値を使用できます。レスポンス情報
非同期タスクの task_id。この task_id を使用して タスク結果照会 API をリクエストし、生成結果を取得してください
⌘I