Wan 2.5 Preview imagen a video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"audio": True,
"seed": 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>',
audio_url: '<string>'
},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
audio: true,
seed: 123
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview', 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.5-i2v-preview",
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>',
'audio_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'audio' => true,
'seed' => 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.5-i2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\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.5-i2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview")
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 \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Vídeo
Wan 2.5 Preview imagen a video
POST
/
v3
/
async
/
wan-2.5-i2v-preview
Wan 2.5 Preview imagen a video
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"img_url": "<string>",
"audio_url": "<string>"
},
"parameters": {
"resolution": "<string>",
"duration": 123,
"prompt_extend": True,
"audio": True,
"seed": 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>',
audio_url: '<string>'
},
parameters: {
resolution: '<string>',
duration: 123,
prompt_extend: true,
audio: true,
seed: 123
}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview', 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.5-i2v-preview",
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>',
'audio_url' => '<string>'
],
'parameters' => [
'resolution' => '<string>',
'duration' => 123,
'prompt_extend' => true,
'audio' => true,
'seed' => 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.5-i2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\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.5-i2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"img_url\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/wan-2.5-i2v-preview")
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 \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"resolution\": \"<string>\",\n \"duration\": 123,\n \"prompt_extend\": true,\n \"audio\": true,\n \"seed\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}El modelo de imagen a video Wan 2.5 Preview admite la generación de videos de 5 o 10 segundos a partir de una imagen de primer fotograma y texto. Nueva capacidad de audio: admite doblaje automático y también archivos de audio personalizados.
Esta es una API asíncrona que solo devuelve el task_id de la tarea asíncrona. Debe usar ese task_id para solicitar la API de consulta de resultado de tarea y recuperar el resultado de generación del video.
Encabezados de solicitud
string
requerido
Valores enumerados:
application/jsonstring
requerido
Formato de autenticación Bearer: Bearer {{API Key}}.
Cuerpo de la solicitud
object
requerido
Información de entrada básica, como el prompt.
Ocultar Descripción de campos
Ocultar Descripción de campos
string
Prompt positivo de texto. Admite chino e inglés, con un máximo de 2000 caracteres; la parte excedente se truncará automáticamente.Valor de ejemplo: un gatito corriendo sobre el césped.
string
Prompt negativo, utilizado para describir el contenido que debe evitarse al generar el video; permite evitar o limitar elementos de la imagen.Admite chino e inglés, con un máximo de 500 caracteres; la parte excedente se truncará automáticamente.Valor de ejemplo: baja resolución, errores, peor calidad, baja calidad, incompleto, dedos adicionales, malas proporciones, etc.
string
requerido
URL de la imagen del fotograma inicial utilizada para la generación del video.La URL debe ser accesible públicamente y admitir el protocolo HTTP o HTTPS.Restricciones de la imagen:
- Formatos de imagen: JPEG, JPG, PNG (sin transparencia), BMP, WEBP;
- Requisitos de tamaño: el ancho y la altura de la imagen deben estar dentro del rango de [360, 2000] píxeles;
- El tamaño del archivo no debe superar los 10 MB.
string
URL del archivo de audio utilizado para la generación del video. Para obtener el uso detallado, consulte la explicación de la configuración de audio.Requisitos del audio:
- Formatos: wav, mp3;
- Duración: 3-30 segundos;
- El tamaño del archivo no debe superar los 15 MB.
object
Parámetros de procesamiento de video, como especificar la resolución y la duración del video de salida.
Ocultar Descripción de campos
Ocultar Descripción de campos
string
Nivel de resolución del video generado.
Opciones:
Opciones:
480P, 720P, 1080P. Valor predeterminado: 1080P.integer
Especifica la duración del video generado. Valores admitidos:
5 o 10 (unidad: segundos).Valor predeterminado: 5.bool
Indica si se activa la reescritura inteligente del prompt. Una vez activada, se utilizará un modelo grande para reescribir de forma inteligente el prompt de entrada, lo que puede mejorar significativamente el resultado de generación para prompts más cortos, aunque también aumentará el tiempo de procesamiento.
true: predeterminado, activa la reescritura inteligente;false: no reescribir.
boolean
Indica si se añade audio.Prioridad de parámetros: audio_url > audio; solo es efectivo cuando audio_url está vacío.
true: predeterminado, añade automáticamente doblaje al video;false: no añade audio; la salida será un video silencioso.
integer
Semilla aleatoria, utilizada para controlar la aleatoriedad del contenido generado por el modelo. Rango de valores: [0, 2147483647].Si no se proporciona, se generará automáticamente un número aleatorio. Si se espera que el resultado generado sea más estable, puede pasar el mismo valor de seed.Valor de ejemplo: 12345.
Información de respuesta
string
requerido
task_id de la tarea asíncrona. Debe usar ese task_id para solicitar la API de consulta de resultado de tarea y obtener el resultado generado
⌘I