Wan 2.2 Bild-zu-Video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-i2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 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>'},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-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-2.2-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>',
'negative_prompt' => '<string>',
'img_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 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.2-i2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\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.2-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-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 \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Video
Wan 2.2 Bild-zu-Video
POST
/
v3
/
async
/
wan-2.2-i2v
Wan 2.2 Bild-zu-Video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
]
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.2-i2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"seed": 123,
"loras": [
{
"path": "<string>",
"scale": 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>'},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-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-2.2-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>',
'negative_prompt' => '<string>',
'img_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'seed' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 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.2-i2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\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.2-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.2-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 \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"seed\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.2(万相 2.2)Professional Bild-zu-Video-Modell generiert Videos anhand eines ersten Frame-Bildes und eines Textes. Es bietet deutliche Verbesserungen bei der Darstellung von Bilddetails und der Bewegungsstabilität.
Dies ist eine asynchrone API, die nur die task_id der asynchronen Aufgabe zurückgibt. Verwenden Sie diese task_id, um über die API zum Abfragen des Aufgabenergebnisses das Ergebnis der Videogenerierung abzurufen.
Anfrage-Header
string
erforderlich
Aufzählungswert:
application/jsonstring
erforderlich
Bearer-Authentifizierungsformat: Bearer {{API Key}}。
Anfragekörper
object
erforderlich
Grundlegende Eingabeinformationen, z. B. Prompts.
Ausblenden properties
Ausblenden properties
string
Text-Prompt. Unterstützt Chinesisch und Englisch, Länge maximal 800 Zeichen. Jedes chinesische Zeichen bzw. jeder Buchstabe zählt als ein Zeichen; darüber hinausgehende Inhalte werden automatisch abgeschnitten.Beispielwert: Eine kleine Katze rennt über eine Wiese.
string
Negativer Prompt, der beschreibt, welche Inhalte nicht im Videobild zu sehen sein sollen, und zur Einschränkung des Videobildes verwendet werden kann.Unterstützt Chinesisch und Englisch, Länge maximal 500 Zeichen; darüber hinausgehende Inhalte werden automatisch abgeschnitten.Beispielwert: niedrige Auflösung, Fehler, schlechteste Qualität, niedrige Qualität, unvollständig, zusätzliche Finger, schlechte Proportionen usw.
string
erforderlich
URL des ersten Frame-Bildes, das bei der Videogenerierung verwendet wird.Die URL muss öffentlich zugänglich sein und das HTTP- oder HTTPS-Protokoll unterstützen.Bildbeschränkungen:
- Bildformat: JPEG, JPG, PNG (transparente Kanäle werden nicht unterstützt), BMP, WEBP.
- Bildauflösung: Breite und Höhe des Bildes im Bereich [360, 2000], Einheit: Pixel.
- Dateigröße: maximal 10 MB.
object
erforderlich
Parameter für die Videoverarbeitung, z. B. zur Angabe der Auflösung und Dauer des Ausgabevideos.
Ausblenden properties
Ausblenden properties
string
erforderlich
Auflösungsstufe des generierten Videos. Standardwert ist
Zulässige Werte:
1080P.Zulässige Werte:
480P, 720P, 1080Pinteger
Dauer des generierten Videos.
- Bei den Auflösungen
480Pund720Pwerden Dauern von5oder8Sekunden unterstützt. - Bei der Auflösung
1080Pist die Dauer fest auf 5 Sekunden eingestellt.
5.bool
Gibt an, ob intelligentes Umschreiben des prompt aktiviert wird. Nach der Aktivierung wird ein großes Modell verwendet, um den eingegebenen prompt intelligent umzuschreiben. Bei kürzeren prompts verbessert dies die Generierung deutlich, erhöht jedoch die Verarbeitungszeit.
true: Standardwert, intelligentes Umschreiben aktivieren.false: Intelligentes Umschreiben nicht aktivieren.
integer
Zufallszahlen-Seed zur Steuerung der Zufälligkeit der vom Modell generierten Inhalte. Wertebereich:
[0, 2147483647].Wenn nicht angegeben, generiert der Algorithmus automatisch eine Zufallszahl als Seed. Wenn die generierten Inhalte relativ stabil bleiben sollen, können Sie denselben seed-Parameterwert verwenden.Beispielwert: 12345.Antwortinformationen
string
erforderlich
task_id der asynchronen Aufgabe. Verwenden Sie diese task_id, um über die API zum Abfragen des Aufgabenergebnisses das Generierungsergebnis abzurufen
⌘I