Wan 2.5 Preview 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"audio": True,
"seed": 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>',
img_url: '<string>',
audio_url: '<string>'
},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
audio: true,
seed: 123
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview', 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.5-i2v-preview",
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>',
'img_url' => '<string>',
'audio_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'audio' => true,
'seed' => 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.5-i2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\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.5-i2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview")
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 \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}動画
Wan 2.5 Preview 画像から動画
POST
/
v3
/
async
/
wan-2.5-i2v-preview
Wan 2.5 Preview 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"audio": True,
"seed": 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>',
img_url: '<string>',
audio_url: '<string>'
},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
audio: true,
seed: 123
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview', 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.5-i2v-preview",
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>',
'img_url' => '<string>',
'audio_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'audio' => true,
'seed' => 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.5-i2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\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.5-i2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview")
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 \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.5 Preview 画像から動画モデルは、先頭フレーム画像とテキストに基づいて 5 秒または 10 秒の動画を生成できます。音声機能が新たに追加され、自動ナレーションに対応するほか、音声ファイルをカスタマイズすることもできます。
これは非同期API であり、非同期タスクの task_id のみを返します。この task_id を使用して タスク結果照会 API にリクエストし、動画生成結果を取得してください。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
object
必須
プロンプトなどの基本入力情報。
非表示 フィールド説明
非表示 フィールド説明
string
テキストのポジティブプロンプト。中国語と英語に対応し、最大 2000 文字です。超過した部分は自動的に切り捨てられます。サンプル値:一只小猫在草地上奔跑。
string
ネガティブプロンプト。動画生成時に避けたい内容を記述するために使用し、画面内容の回避や制限を行えます。中国語と英語に対応し、最大 500 文字です。超過した部分は自動的に切り捨てられます。サンプル値:低解像度、エラー、最低品質、低品質、欠損、余分な指、比率不良など。
string
必須
動画生成に使用する開始フレーム画像のURL。URL は公開アクセス可能で、HTTP または HTTPS プロトコルに対応している必要があります。画像の制限:
- 画像形式:JPEG、JPG、PNG(透明は非対応)、BMP、WEBP;
- サイズ要件:画像の幅と高さは [360, 2000] ピクセルの範囲内である必要があります;
- ファイルサイズは 10MB を超えてはいけません。
string
動画生成に使用する音声ファイルURL。詳細な使用方法は、音声設定の説明を参照してください。音声要件:
- 形式:wav、mp3;
- 長さ:3〜30 秒;
- ファイルサイズは 15MB を超えないこと。
object
動画処理パラメータ。出力動画の解像度や長さなどを指定します。
非表示 フィールド説明
非表示 フィールド説明
string
生成動画の解像度ランク。
選択肢:
選択肢:
480P、720P、1080P。デフォルト値:1080P。integer
生成動画の長さを指定します。対応値:
5 または 10(単位:秒)。デフォルト値:5。bool
prompt のスマートリライトを有効にするかどうか。有効にすると、大規模モデルを使用して入力 prompt をスマートにリライトします。短いプロンプトの場合、生成効果を大幅に向上できますが、処理時間も長くなります。
true:デフォルト。スマートリライトを有効化;false:リライトしない。
boolean
音声を追加するかどうか。パラメータの優先順位:audio_url > audio。audio_url が空の場合にのみ有効です。
true:デフォルト。動画に自動でナレーションを追加;false:音声を追加せず、出力は無音動画になります。
integer
ランダムシード。モデルが生成する内容のランダム性を制御するために使用します。値の範囲:[0, 2147483647]。未入力の場合はランダム数が自動生成されます。生成結果を比較的安定させたい場合は、同じ seed 値を渡すことができます。サンプル値:12345。
レスポンス情報
string
必須
非同期タスクの task_id。この task_id を使用して タスク結果照会 API にリクエストし、生成結果を取得してください
⌘I