万相 Wan 2.7 画像から動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.7-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"prompt": "<string>",
"duration": 123,
"image_url": "<string>",
"watermark": true,
"resolution": "<string>",
"prompt_extend": true,
"first_clip_url": "<string>",
"last_frame_url": "<string>",
"negative_prompt": "<string>",
"driving_audio_url": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.7-i2v"
payload = {
"seed": 123,
"prompt": "<string>",
"duration": 123,
"image_url": "<string>",
"watermark": True,
"resolution": "<string>",
"prompt_extend": True,
"first_clip_url": "<string>",
"last_frame_url": "<string>",
"negative_prompt": "<string>",
"driving_audio_url": "<string>"
}
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({
seed: 123,
prompt: '<string>',
duration: 123,
image_url: '<string>',
watermark: true,
resolution: '<string>',
prompt_extend: true,
first_clip_url: '<string>',
last_frame_url: '<string>',
negative_prompt: '<string>',
driving_audio_url: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.7-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.7-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([
'seed' => 123,
'prompt' => '<string>',
'duration' => 123,
'image_url' => '<string>',
'watermark' => true,
'resolution' => '<string>',
'prompt_extend' => true,
'first_clip_url' => '<string>',
'last_frame_url' => '<string>',
'negative_prompt' => '<string>',
'driving_audio_url' => '<string>'
]),
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.7-i2v"
payload := strings.NewReader("{\n \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\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.7-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.7-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 \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}動画
万相 Wan 2.7 画像から動画生成
POST
/
v3
/
async
/
wan2.7-i2v
万相 Wan 2.7 画像から動画生成
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.7-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"prompt": "<string>",
"duration": 123,
"image_url": "<string>",
"watermark": true,
"resolution": "<string>",
"prompt_extend": true,
"first_clip_url": "<string>",
"last_frame_url": "<string>",
"negative_prompt": "<string>",
"driving_audio_url": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.7-i2v"
payload = {
"seed": 123,
"prompt": "<string>",
"duration": 123,
"image_url": "<string>",
"watermark": True,
"resolution": "<string>",
"prompt_extend": True,
"first_clip_url": "<string>",
"last_frame_url": "<string>",
"negative_prompt": "<string>",
"driving_audio_url": "<string>"
}
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({
seed: 123,
prompt: '<string>',
duration: 123,
image_url: '<string>',
watermark: true,
resolution: '<string>',
prompt_extend: true,
first_clip_url: '<string>',
last_frame_url: '<string>',
negative_prompt: '<string>',
driving_audio_url: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.7-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.7-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([
'seed' => 123,
'prompt' => '<string>',
'duration' => 123,
'image_url' => '<string>',
'watermark' => true,
'resolution' => '<string>',
'prompt_extend' => true,
'first_clip_url' => '<string>',
'last_frame_url' => '<string>',
'negative_prompt' => '<string>',
'driving_audio_url' => '<string>'
]),
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.7-i2v"
payload := strings.NewReader("{\n \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\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.7-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.7-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 \"seed\": 123,\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"image_url\": \"<string>\",\n \"watermark\": true,\n \"resolution\": \"<string>\",\n \"prompt_extend\": true,\n \"first_clip_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"driving_audio_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}万相 Wan 2.7 画像から動画生成モデルは、マルチモーダル入力(テキスト/画像/音声/動画)に対応し、先頭フレームからの動画生成、先頭・末尾フレームからの動画生成、動画の続きを生成する3つのタスクを実行できます。720Pおよび1080P解像度に対応し、長さは2〜15秒、秒単位で課金されます。出力にはデフォルトで音声が含まれます。
これは非同期APIであり、非同期タスクの task_id のみを返します。この task_id を使用して タスク結果照会 API にリクエストし、生成結果を取得してください。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
integer
生成結果の再現性を高めるための乱数シードです。値の範囲は[0, 2147483647]です。値の範囲:[0, 2147483647]
string
生成動画に含めたい要素や視覚的特徴を記述するテキストプロンプトです。中国語と英語に対応し、最大5000文字です。長さ制限:0 - 5000
integer
デフォルト:5
生成動画の長さです。単位は秒で、秒単位で課金されます。値の範囲は[2, 15]の整数です。値の範囲:[2, 15]
string
必須
先頭フレーム画像のURLです。形式はJPEG、JPG、PNG(透明チャンネル非対応)、BMP、WEBPに対応しています。解像度の幅と高さの範囲は[240, 8000]ピクセル、アスペクト比は1:8〜8:1、ファイルサイズは20MB以下です。first_clip_urlとのいずれか一方を選択し、少なくとも1つを指定してください。
boolean
デフォルト:false
ウォーターマーク識別子を追加するかどうかです。ウォーターマークは動画の右下に配置されます。
string
デフォルト:"1080P"
出力動画の解像度グレードで、料金に影響します。動画のアスペクト比は入力素材と一致します。指定可能な値:
720P, 1080Pboolean
デフォルト:true
prompt のインテリジェントリライトを有効にするかどうかです。有効にすると、大規模モデルを使用して入力 prompt をインテリジェントにリライトします。短い prompt では生成効果が大きく向上しますが、処理時間が増加します。
string
動画の続きを生成するための先頭動画クリップURLです。モデルはこの動画内容に基づいて続きを生成します。形式はmp4、movに対応し、長さは2〜10秒、解像度の幅と高さの範囲は[240, 4096]ピクセル、アスペクト比は1:8〜8:1、ファイルサイズは100MB以下です。image_urlとのいずれか一方を選択します。
string
末尾フレーム画像のURLです。先頭フレームと組み合わせることで、先頭・末尾フレーム動画を生成できます。形式の制限は先頭フレームと同じです。
string
動画画面に表示したくない内容を記述するネガティブプロンプトです。中国語と英語に対応し、最大500文字です。長さ制限:0 - 500
string
駆動音声URLです。指定すると、モデルはこの音声を駆動ソースとして動画を生成します(口形同期、動作のビート合わせなど)。指定しない場合、モデルは一致するBGMまたは効果音を自動生成します。形式はwav、mp3に対応し、長さは2〜30秒、ファイルサイズは15MB以下です。
レスポンス情報
string
task_id を使用して タスク結果照会 API にリクエストし、生成された出力を取得します。
⌘I