Wan 2.1 テキストから動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": true,
"fast_mode": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-t2v"
payload = {
"prompt": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": True,
"fast_mode": True
}
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({
prompt: '<string>',
negative_prompt: '<string>',
width: 123,
height: 123,
loras: [{path: '<string>', scale: 123}],
seed: 123,
steps: 123,
guidance_scale: 123,
flow_shift: 123,
enable_safety_checker: true,
fast_mode: true
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-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-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([
'prompt' => '<string>',
'negative_prompt' => '<string>',
'width' => 123,
'height' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'seed' => 123,
'steps' => 123,
'guidance_scale' => 123,
'flow_shift' => 123,
'enable_safety_checker' => true,
'fast_mode' => true
]),
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-t2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\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-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-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 \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}動画
Wan 2.1 テキストから動画生成
POST
/
v3
/
async
/
wan-t2v
Wan 2.1 テキストから動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": true,
"fast_mode": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-t2v"
payload = {
"prompt": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": True,
"fast_mode": True
}
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({
prompt: '<string>',
negative_prompt: '<string>',
width: 123,
height: 123,
loras: [{path: '<string>', scale: 123}],
seed: 123,
steps: 123,
guidance_scale: 123,
flow_shift: 123,
enable_safety_checker: true,
fast_mode: true
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-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-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([
'prompt' => '<string>',
'negative_prompt' => '<string>',
'width' => 123,
'height' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'seed' => 123,
'steps' => 123,
'guidance_scale' => 123,
'flow_shift' => 123,
'enable_safety_checker' => true,
'fast_mode' => true
]),
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-t2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\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-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-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 \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.1 14B テキストから動画生成モデルの高速推論です。これは包括的かつオープンな動画基盤モデルスイートであり、動画生成の可能性をさらに押し広げます。デフォルトでは、API は 5 秒の動画を生成します。
これは非同期APIであり、非同期タスクの task_id のみを返します。この task_id を使用して タスク結果照会 API にリクエストし、動画生成結果を取得してください。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
string
必須
生成を指示するためのプロンプトテキスト。値の範囲:
[1, 2000]。string
ネガティブプロンプトは、モデルが生成を避けるべき要素を指示します。値の範囲:
[0, 2000]。integer
出力動画の幅。列挙値:
480、720、832、1280。デフォルト:832。幅または高さが指定されていない場合、幅と高さは 832 と 480 に強制的に設定されます。integer
出力動画の高さ。対応:
- (480p) 幅が
480の場合、高さは832に設定 - (480p) 幅が
832の場合、高さは480に設定 - (720p) 幅が
720の場合、高さは1280に設定 - (720p) 幅が
1280の場合、高さは720に設定
480。幅または高さが指定されていない場合、幅と高さは 832 と 480 に強制的に設定されます。object[]
動画生成に適用する LoRA モデル。最大 3 つの LoRA モデルを指定できます。
表示 properties
表示 properties
string
必須
LoRA モデルのパス。Hugging Face の LoRA モデル名(例:
Remade-AI/Cyberpunk)または Civitai のモデルダウンロード URL(例:https://civitai.com/api/download/models/1572591?type=Model&format=SafeTensor)を指定できます。LoRA モデルは Wan2.1 14B T2V と互換性がある必要があります。互換性がない場合は動作しません。使用前に互換性を確認してください。
number
必須
LoRA のスケール値。値が大きいほど、LoRA の効果がより顕著になります。number(float32) 型で、値の範囲:
[0, 4.0]。integer
乱数シード。Stable Diffusion がノイズを生成するための数値で、値の範囲:
[-1, 9999999999]。デフォルト値は -1 です。integer
反復ステップ数。画像作成プロセスの反復回数で、値の範囲:
[1, 40]。デフォルト:30。float
ガイダンススケールパラメータは、生成内容がプロンプトにどの程度従うかを制御します。値の範囲:
[0, 10]。デフォルト:5.0。float
flow_shift パラメータは主に、動画内のオブジェクトの動きの速度と振幅に影響します。値が高いほど、より顕著で速い動きになり、値が低いほど、より遅く繊細な動きになります。値の範囲:
[1, 10]。デフォルト:5.0。boolean
enable_safety_checker パラメータは、生成されたコンテンツに安全フィルターを適用するかどうかを制御します。有効にすると、動画出力から潜在的に有害または不適切なコンテンツをフィルタリングするのに役立ちます。デフォルト:
true。boolean
高速モードを有効にするかどうか。より速く動画を生成できますが、品質と価格が低下する可能性があります。デフォルト:
false。レスポンス情報
string
必須
非同期タスクの task_id。この task_id を使用して タスク結果照会 API にリクエストし、生成結果を取得してください
⌘I