Wan 2.2 Texto para Vídeo
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<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-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<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>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', 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-t2v",
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>'
],
'parameters' => [
'size' => '<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-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v")
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 },\n \"parameters\": {\n \"size\": \"<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>"
}Vídeo
Wan 2.2 Texto para Vídeo
POST
/
v3
/
async
/
wan-2.2-t2v
Wan 2.2 Texto para Vídeo
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.2-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<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-t2v"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"size": "<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>'},
parameters: {
size: '<string>',
duration: 123,
prompt_extend: true,
seed: 123,
loras: [{path: '<string>', scale: 123}]
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.2-t2v', 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-t2v",
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>'
],
'parameters' => [
'size' => '<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-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v")
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 },\n \"parameters\": {\n \"size\": \"<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>"
}O modelo Wan 2.2 (Wanxiang 2.2) Pro de texto para vídeo é capaz de gerar conteúdo de vídeo de alta qualidade com base em descrições de texto. Em comparação com os modelos anteriores, apresenta melhorias significativas nos detalhes da imagem e na estabilidade do movimento, com suporte à geração de vídeos de 5 e 8 segundos.
Esta é uma API assíncrona que retorna apenas o task_id da tarefa assíncrona. Você deve usar esse task_id para solicitar a API de consulta de resultado da tarefa e recuperar o resultado da geração do vídeo.
Cabeçalhos da requisição
string
obrigatório
Valores enumerados:
application/jsonstring
obrigatório
Formato de autenticação Bearer: Bearer {{API Key}}.
Corpo da requisição
object
obrigatório
Informações básicas de entrada, como prompts.
Ocultar properties
Ocultar properties
string
obrigatório
Prompt de texto. Suporta chinês e inglês, com comprimento máximo de 800 caracteres; cada caractere chinês/letra conta como um caractere, e a parte excedente será truncada automaticamente.Valor de exemplo: Um gatinho correndo sob a luz da lua.
string
Prompt negativo, usado para descrever o conteúdo que você não deseja ver na imagem do vídeo, podendo impor restrições à imagem do vídeo.Suporta chinês e inglês, com comprimento máximo de 500 caracteres; a parte excedente será truncada automaticamente.Valor de exemplo: baixa resolução, erro, pior qualidade, baixa qualidade, incompleto, dedos extras, proporções ruins etc.
object
obrigatório
Parâmetros de processamento de vídeo.
Ocultar properties
Ocultar properties
string
obrigatório
Suporta múltiplas resoluções 480P, 720P e 1080P; o valor padrão é
1920*1080 (1080P).
Usado para especificar a resolução do vídeo, no formato largura*altura. As resoluções compatíveis com diferentes modelos são as seguintes:Faixa 480P: as resoluções de vídeo opcionais e suas proporções correspondentes são:832*480: 16:9.480*832: 9:16.624*624: 1:1.
1280*720: 16:9.720*1280: 9:16.
1920*1080: 16:9.1080*1920: 9:16.1440*1440: 1:1.1632*1248: 4:3.1248*1632: 3:4.
Erro comum no parâmetro size: size deve ser definido como o valor específico da resolução de destino (por exemplo,
1280*720), e não como a proporção (por exemplo, 1:1) ou o nome da faixa de resolução (por exemplo, 480P ou 720P).integer
Duração do vídeo gerado.
- Nas resoluções
480Pe720P, as durações opcionais são5ou8segundos. - Na resolução
1080P, a duração é fixa em5segundos.
5.bool
Define se a reescrita inteligente de prompt será ativada. Quando ativada, um modelo grande é usado para reescrever inteligentemente o prompt de entrada. Para prompts mais curtos, a melhoria no resultado da geração é perceptível, mas isso aumenta o tempo de processamento.
true: valor padrão, ativa a reescrita inteligente.false: não ativa a reescrita inteligente.
integer
Seed de número aleatório, usada para controlar a aleatoriedade do conteúdo gerado pelo modelo. Intervalo de valores:
[0, 2147483647].Se não for fornecida, o algoritmo gerará automaticamente um número aleatório como seed. Se você quiser manter o conteúdo gerado relativamente estável, pode usar o mesmo valor do parâmetro seed.Informações da resposta
string
obrigatório
task_id da tarefa assíncrona. Você deve usar esse task_id para solicitar a API de consulta de resultado da tarefa a fim de obter o resultado gerado
⌘I