Wan 2.6 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.6-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"img_url": "<string>",
"template": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"audio": true,
"duration": 123,
"shot_type": "<string>",
"watermark": true,
"resolution": "<string>",
"prompt_extend": true
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.6-i2v"
payload = {
"input": {
"prompt": "<string>",
"img_url": "<string>",
"template": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"audio": True,
"duration": 123,
"shot_type": "<string>",
"watermark": True,
"resolution": "<string>",
"prompt_extend": 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({
input: {
prompt: '<string>',
img_url: '<string>',
template: '<string>',
audio_url: '<string>',
negative_prompt: '<string>'
},
parameters: {
seed: 123,
audio: true,
duration: 123,
shot_type: '<string>',
watermark: true,
resolution: '<string>',
prompt_extend: true
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.6-i2v', 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/wan2.6-i2v",
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>',
'img_url' => '<string>',
'template' => '<string>',
'audio_url' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'seed' => 123,
'audio' => true,
'duration' => 123,
'shot_type' => '<string>',
'watermark' => true,
'resolution' => '<string>',
'prompt_extend' => 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/wan2.6-i2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\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/wan2.6-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.6-i2v")
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 \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}動画
Wan 2.6 画像から動画
POST
/
v3
/
async
/
wan2.6-i2v
Wan 2.6 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.6-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"img_url": "<string>",
"template": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"audio": true,
"duration": 123,
"shot_type": "<string>",
"watermark": true,
"resolution": "<string>",
"prompt_extend": true
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.6-i2v"
payload = {
"input": {
"prompt": "<string>",
"img_url": "<string>",
"template": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"audio": True,
"duration": 123,
"shot_type": "<string>",
"watermark": True,
"resolution": "<string>",
"prompt_extend": 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({
input: {
prompt: '<string>',
img_url: '<string>',
template: '<string>',
audio_url: '<string>',
negative_prompt: '<string>'
},
parameters: {
seed: 123,
audio: true,
duration: 123,
shot_type: '<string>',
watermark: true,
resolution: '<string>',
prompt_extend: true
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.6-i2v', 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/wan2.6-i2v",
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>',
'img_url' => '<string>',
'template' => '<string>',
'audio_url' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'seed' => 123,
'audio' => true,
'duration' => 123,
'shot_type' => '<string>',
'watermark' => true,
'resolution' => '<string>',
'prompt_extend' => 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/wan2.6-i2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\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/wan2.6-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.6-i2v")
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 \"img_url\": \"<string>\",\n \"template\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}これは非同期 API であり、非同期の task_id のみを返します。task_id を使用してタスク結果取得 API を呼び出し、動画生成結果を取得する必要があります。
これは非同期API であり、非同期タスクの task_id のみを返します。この task_id を使用して タスク結果取得 API にリクエストし、生成結果を取得してください。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
object
必須
非表示 properties
非表示 properties
string
生成動画に含めたい要素や視覚的特徴を説明するテキストプロンプトです。中国語と英語に対応しており、各漢字/文字は 1 文字としてカウントされ、超過した部分は自動的に切り捨てられます。長さ制限:0 - 2000
string
必須
入力画像の URL または Base64 エンコードデータです。HTTP または HTTPS プロトコルに対応しており、ローカルファイルはファイルアップロードにより一時 URL を取得できます。画像の制限:画像形式:JPEG、JPG、PNG(透明チャンネルは非対応)、BMP、WEBP;画像解像度:画像の幅と高さの範囲は[360, 2000]、単位はピクセル;ファイルサイズ:10MB 以下。入力画像の説明:1. パブリックアクセス可能な URL を使用 - HTTP または HTTPS プロトコルに対応しており、ローカルファイルはファイルアップロードにより一時 URL を取得できます;例:https://cdn.translate.alibaba.com/r/wanx-demo-1.png。2. Base64 エンコード画像の文字列を渡す - データ形式:data:;base64,;例:data:image/png;base64,GDU7MtCZEbTbmRZ…(エンコード文字列が長すぎるため、一部のみ表示)。詳細については、入力画像を参照してください。
string
動画エフェクトテンプレートの名前です。未入力の場合、動画エフェクトは使用されません。テンプレートごとに対応するエフェクトテンプレートが異なるため、呼び出し失敗を避けるために、呼び出し前に動画エフェクト一覧を確認してください。
string
音声ファイルのURLです。モデルはこの音声を使用して動画を生成します。HTTPまたはHTTPSプロトコルに対応しています。音声の制限:形式はwav、mp3;長さは3~30s;ファイルサイズは15MB以下。上限超過時の処理:音声の長さがduration値(5秒または10秒)を超える場合、先頭の5秒または10秒が自動的に切り出され、残りの部分は破棄されます。音声の長さが動画の長さに満たない場合、音声の長さを超えた部分は無音動画になります。たとえば、音声が3秒、動画の長さが5秒の場合、出力動画の先頭3秒は音声付き、後半2秒は無音になります。
string
ネガティブプロンプトです。動画画面に表示したくない内容を記述するために使用し、動画画面に制約を加えることができます。中国語と英語に対応しており、長さは500文字以下です。超過した部分は自動的に切り捨てられます。長さ制限:0 - 500
object
非表示 properties
非表示 properties
integer
乱数シードです。値の範囲は[0, 2147483647]です。指定しない場合、システムがランダムシードを自動生成します。生成結果の再現性を高める必要がある場合は、seed値を固定することを推奨します。なお、モデル生成には確率性があるため、同じseedを使用しても、毎回の生成結果が完全に一致することは保証できません。値の範囲:[0, 2147483647]
boolean
デフォルト:true
音声を追加するかどうかを制御します。パラメータ優先順位:audio_url > audio。audio_urlが空の場合にのみ有効です。使用方法については音声設定を参照してください。true:デフォルト値。動画に音声を自動追加します;false:音声を追加せず、無音動画を出力します。
integer
デフォルト:5
生成動画の長さです。単位は秒です。durationは料金に直接影響するため、呼び出し前にモデル価格を確認してください。生成動画の長さです。単位は秒です。選択可能な値:
5, 10, 15string
デフォルト:"multi"
動画生成モードです。single:単一ショット生成;multi:マルチショット生成。選択可能な値:
single, multiboolean
デフォルト:false
透かし表示を追加するかどうかです。透かしは動画の右下に表示され、文言は”AI 生成”で固定です。false:デフォルト値。透かしを追加しません;true:透かしを追加します。
string
デフォルト:"1080P"
生成動画の解像度ランクを指定します。720P、1080Pの3つのランクに対応しています。選択可能な値:
720P, 1080Pboolean
デフォルト:true
promptのスマートリライトを有効にするかどうかです。有効にすると、大規模モデルを使用して入力promptをスマートにリライトします。短いpromptでは生成効果の向上が明確ですが、所要時間が増加します。true:デフォルト値。スマートリライトを有効にします;false:スマートリライトを有効にしません。
レスポンス情報
string
必須
task_id を使用して タスク結果取得 API にリクエストし、生成された出力を取得します。
⌘I