Wan 2.1 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image_url": "<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-i2v"
payload = {
"prompt": "<string>",
"image_url": "<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>',
image_url: '<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-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/wan-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([
'prompt' => '<string>',
'image_url' => '<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-i2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<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-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<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-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 \"prompt\": \"<string>\",\n \"image_url\": \"<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-i2v
Wan 2.1 画像から動画
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image_url": "<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-i2v"
payload = {
"prompt": "<string>",
"image_url": "<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>',
image_url: '<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-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/wan-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([
'prompt' => '<string>',
'image_url' => '<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-i2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<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-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<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-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 \"prompt\": \"<string>\",\n \"image_url\": \"<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
必須
動画生成に使用する画像 URL。
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 に設定されます。出力動画は入力画像のアスペクト比を維持し、
幅 x 高さ の設定は出力動画の解像度のみを決定します。たとえば、720p 動画は 480p 動画よりも鮮明になります。object[]
動画生成に適用する LoRA モデル。最大 3 つの LoRA モデルを指定できます。
表示 プロパティ
表示 プロパティ
string
必須
LoRA モデルのパス。Hugging Face の LoRA モデル名(例:
Remade-AI/Painting)または Civitai のモデルダウンロード URL(例:https://civitai.com/api/download/models/1513385?type=Model&format=SafeTensor)を指定できます。LoRA モデルは Wan2.1 14B I2V と互換性がある必要があります。互換性がない場合は動作しません。使用前に互換性を確認してください。
number
必須
LoRA のスケール値。値が大きいほど、LoRA の効果がより顕著になります。number(float32) 型、取値範囲:
[0, 4.0]。integer
乱数シード。拡散生成でノイズを生成するための数値です。取値範囲:
[-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