Wan 2.6 Texto a video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.6-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"size": "<string>",
"audio": true,
"duration": 123,
"shot_type": "<string>",
"watermark": true,
"prompt_extend": true
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.6-t2v"
payload = {
"input": {
"prompt": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"size": "<string>",
"audio": True,
"duration": 123,
"shot_type": "<string>",
"watermark": True,
"prompt_extend": 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({
input: {prompt: '<string>', audio_url: '<string>', negative_prompt: '<string>'},
parameters: {
seed: 123,
size: '<string>',
audio: true,
duration: 123,
shot_type: '<string>',
watermark: true,
prompt_extend: true
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.6-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/wan2.6-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>',
'audio_url' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'seed' => 123,
'size' => '<string>',
'audio' => true,
'duration' => 123,
'shot_type' => '<string>',
'watermark' => true,
'prompt_extend' => 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/wan2.6-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\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/wan2.6-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.6-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 \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Vídeo
Wan 2.6 Texto a video
POST
/
v3
/
async
/
wan2.6-t2v
Wan 2.6 Texto a video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan2.6-t2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"size": "<string>",
"audio": true,
"duration": 123,
"shot_type": "<string>",
"watermark": true,
"prompt_extend": true
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan2.6-t2v"
payload = {
"input": {
"prompt": "<string>",
"audio_url": "<string>",
"negative_prompt": "<string>"
},
"parameters": {
"seed": 123,
"size": "<string>",
"audio": True,
"duration": 123,
"shot_type": "<string>",
"watermark": True,
"prompt_extend": 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({
input: {prompt: '<string>', audio_url: '<string>', negative_prompt: '<string>'},
parameters: {
seed: 123,
size: '<string>',
audio: true,
duration: 123,
shot_type: '<string>',
watermark: true,
prompt_extend: true
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan2.6-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/wan2.6-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>',
'audio_url' => '<string>',
'negative_prompt' => '<string>'
],
'parameters' => [
'seed' => 123,
'size' => '<string>',
'audio' => true,
'duration' => 123,
'shot_type' => '<string>',
'watermark' => true,
'prompt_extend' => 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/wan2.6-t2v"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\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/wan2.6-t2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan2.6-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 \"audio_url\": \"<string>\",\n \"negative_prompt\": \"<string>\"\n },\n \"parameters\": {\n \"seed\": 123,\n \"size\": \"<string>\",\n \"audio\": true,\n \"duration\": 123,\n \"shot_type\": \"<string>\",\n \"watermark\": true,\n \"prompt_extend\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Esta es una API asíncrona que solo devuelve un task_id asíncrono. Debe usar el task_id para llamar a la API de consulta de resultados de tareas y obtener el resultado de generación del video.
Esta es una API asíncrona que solo devolverá el task_id de la tarea asíncrona. Debe usar este task_id para solicitar la API de consulta de resultados de tareas y recuperar el resultado generado.
Encabezados de solicitud
string
requerido
Valores enumerados:
application/jsonstring
requerido
Formato de autenticación Bearer: Bearer {{API Key}}.
Cuerpo de la solicitud
object
requerido
Ocultar properties
Ocultar properties
string
requerido
Prompt de texto utilizado para describir los elementos y características visuales que se espera incluir en el video generado. Admite chino e inglés; cada carácter chino/letra ocupa un carácter, y la parte que exceda el límite se truncará automáticamente.Límite de longitud: 0 - 2000
string
URL del archivo de audio; el modelo usará este audio para generar el video. Admite los protocolos HTTP o HTTPS. Límites del audio: formatos wav y mp3; duración de 3 a 30 s; tamaño de archivo no superior a 15 MB. Manejo de exceso de límites: si la longitud del audio supera el valor de duration (5 segundos o 10 segundos), se recortarán automáticamente los primeros 5 segundos o 10 segundos y se descartará el resto. Si la longitud del audio es inferior a la duración del video, la parte que exceda la longitud del audio será un video sin sonido. Por ejemplo, si el audio dura 3 segundos y la duración del video es de 5 segundos, los primeros 3 segundos del video de salida tendrán sonido y los últimos 2 segundos no tendrán sonido.
string
Prompt negativo, utilizado para describir el contenido que no desea ver en las imágenes del video y para imponer restricciones a la imagen del video. Admite chino e inglés; la longitud no debe superar los 500 caracteres, y la parte que exceda el límite se truncará automáticamente.Límite de longitud: 0 - 500
object
Ocultar properties
Ocultar properties
integer
Semilla de número aleatorio. El rango de valores es [0, 2147483647]. Si no se especifica, el sistema genera automáticamente una semilla aleatoria. Si necesita mejorar la reproducibilidad de los resultados generados, se recomienda fijar el valor de seed. Tenga en cuenta que, debido a la naturaleza probabilística de la generación del modelo, incluso con el mismo seed no se puede garantizar que el resultado generado sea exactamente igual cada vez.Rango de valores: [0, 2147483647]
string
predeterminado:"1920*1080"
Especifica la resolución del video generado, con el formato anchoalto. Admite el nivel 720P (1280720/7201280/960960/1088832/8321088) y el nivel 1080P (19201080/10801920/14401440/16321248/1248*1632).Valores opcionales:
1280*720, 720*1280, 960*960, 1088*832, 832*1088, 1920*1080, 1080*1920, 1440*1440, 1632*1248, 1248*1632boolean
predeterminado:true
Indica si se añade audio. Prioridad de parámetros: audio_url > audio; solo surte efecto cuando audio_url está vacío. true: valor predeterminado, añade audio automáticamente al video; false: no añade audio y genera un video sin sonido.
integer
predeterminado:5
Duración del video generado, en segundos. Los valores opcionales son 5, 10 y 15; el valor predeterminado es 5. duration afecta directamente al coste: coste = precio unitario (según la resolución) × duración (segundos). Confirme el precio del modelo antes de llamar a la API.Valores opcionales:
5, 10, 15string
predeterminado:"multi"
Modo de generación de video. single: generación de una sola toma; multi: generación de múltiples tomas.Valores opcionales:
single, multiboolean
predeterminado:false
Indica si se añade una marca de agua. La marca de agua se ubica en la esquina inferior derecha del video y el texto fijo es “AI 生成”. false: valor predeterminado, no añade marca de agua; true: añade marca de agua.
boolean
predeterminado:true
Indica si se habilita la reescritura inteligente de prompt. Cuando está habilitada, se utiliza un modelo grande para reescribir inteligentemente el prompt de entrada. Para prompts más cortos, mejora notablemente el efecto de generación, pero aumenta el tiempo de procesamiento. true: valor predeterminado, habilita la reescritura inteligente; false: no habilita la reescritura inteligente.
Información de respuesta
string
requerido
Use el task_id para solicitar la API de consulta de resultados de tareas y recuperar la salida generada.
⌘I