Wan 2.2 texto a video
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 a video
POST
/
v3
/
async
/
wan-2.2-t2v
Wan 2.2 texto a video
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>"
}Wan 2.2(Wanxiang 2.2)es un modelo profesional de texto a video capaz de generar contenido de video de alta calidad a partir de descripciones de texto. En comparación con los modelos anteriores, mejora significativamente tanto los detalles de imagen como la estabilidad del movimiento, y admite la generación de videos de 5 y 8 segundos.
Esta es una API asíncrona y solo devolverá el task_id de la tarea asíncrona. Debe usar este task_id para solicitar la API de consulta de resultados de tarea y recuperar el resultado de generación del video.
Encabezados de solicitud
Valores enumerados:
application/jsonFormato de autenticación Bearer: Bearer {{API Key}}.
Cuerpo de la solicitud
Información básica de entrada, como el prompt, etc.
Ocultar properties
Ocultar properties
Prompt de texto. Admite chino e inglés, con una longitud máxima de 800 caracteres. Cada carácter chino/letra cuenta como un carácter; el contenido que exceda el límite se truncará automáticamente.Valor de ejemplo: Un gatito corre bajo la luz de la luna.
Prompt negativo, utilizado para describir el contenido que no se desea ver en la imagen del video y para aplicar restricciones a la imagen del video.Admite chino e inglés, con una longitud máxima de 500 caracteres; el contenido que exceda el límite se truncará automáticamente.Valor de ejemplo: baja resolución, errores, peor calidad, baja calidad, incompleto, dedos extra, proporciones deficientes, etc.
Parámetros de procesamiento de video.
Ocultar properties
Ocultar properties
Admite varios niveles de resolución: 480P, 720P y 1080P. El valor predeterminado es
1920*1080(1080P)。
Se utiliza para especificar la resolución del video, en formato ancho*alto. Las resoluciones admitidas por los distintos modelos son las siguientes:Nivel 480P: las resoluciones de video disponibles y sus relaciones de aspecto correspondientes son: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.
Error común con el parámetro size: size debe establecerse en el valor concreto de la resolución objetivo (por ejemplo,
1280*720), no en la relación de aspecto (por ejemplo, 1:1) ni en el nombre del nivel de resolución (por ejemplo, 480P o 720P).Duración del video generado.
- Con resoluciones
480Py720P, las duraciones disponibles son5u8segundos. - Con resolución
1080P, la duración está fijada en5segundos.
5.Indica si se activa la reescritura inteligente del prompt. Al activarla, se usa un modelo grande para reescribir inteligentemente el prompt de entrada. Mejora significativamente el resultado de generación para prompts más cortos, pero aumenta el tiempo de procesamiento.
true: valor predeterminado; activa la reescritura inteligente.false: no activa la reescritura inteligente.
Semilla de número aleatorio, utilizada para controlar la aleatoriedad del contenido generado por el modelo. Rango de valores:
[0, 2147483647].Si no se proporciona, el algoritmo generará automáticamente un número aleatorio como semilla. Si desea que el contenido generado se mantenga relativamente estable, puede usar el mismo valor del parámetro seed.Información de respuesta
task_id de la tarea asíncrona. Debe usar este task_id para solicitar la API de consulta de resultados de tarea y obtener el resultado generado
⌘I