Wan 2.5 Preview Imagem para Vídeo
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 Imagem para Vídeo
POST
/
v3
/
async
/
wan-2.5-i2v-preview
Wan 2.5 Preview Imagem para Vídeo
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>"
}O modelo Wan 2.5 Preview de imagem para vídeo oferece suporte à geração de vídeos de 5 ou 10 segundos com base em uma imagem de primeiro quadro e texto. Novo recurso de áudio: compatível com narração automática e também permite arquivos de áudio personalizados.
Esta é uma API assíncrona, que retorna apenas o task_id da tarefa assíncrona. Você deve usar esse task_id para chamar a API de consulta de resultado da tarefa para 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 etc.
Ocultar Descrição dos campos
Ocultar Descrição dos campos
string
Prompt positivo em texto. Compatível com chinês e inglês, com no máximo 2000 caracteres; o excedente será truncado automaticamente.Valor de exemplo: Um gatinho correndo na grama.
string
Prompt negativo, usado para descrever o conteúdo que deve ser evitado ao gerar o vídeo, podendo orientar restrições ou evitar elementos na imagem.Compatível com chinês e inglês, com no máximo 500 caracteres; o excedente será truncado automaticamente.Valor de exemplo: baixa resolução, erro, pior qualidade, baixa qualidade, incompleto, dedos extras, proporção ruim etc.
string
obrigatório
URL da imagem do quadro inicial usada para a geração do vídeo.A URL deve ser acessível publicamente e oferecer suporte aos protocolos HTTP ou HTTPS.Restrições da imagem:
- Formatos de imagem: JPEG, JPG, PNG (sem suporte a transparência), BMP, WEBP;
- Requisitos de dimensão: a largura e a altura da imagem devem estar no intervalo de [360, 2000] pixels;
- O tamanho do arquivo não deve exceder 10 MB.
string
URL do arquivo de áudio usado para a geração do vídeo. Para uso detalhado, consulte as instruções de configuração de áudio.Requisitos de áudio:
- Formatos: wav, mp3;
- Duração: 3-30 segundos;
- Tamanho do arquivo não superior a 15 MB.
object
Parâmetros de processamento de vídeo, por exemplo, para especificar a resolução e a duração do vídeo de saída.
Ocultar Descrição dos campos
Ocultar Descrição dos campos
string
Nível de resolução do vídeo gerado.
Opções:
Opções:
480P, 720P, 1080P. Valor padrão: 1080P.integer
Especifica a duração do vídeo gerado, com valores aceitos:
5 ou 10 (unidade: segundos).Valor padrão: 5.bool
Define se a reescrita inteligente do prompt será ativada. Quando ativada, um modelo grande será usado para reescrever inteligentemente o prompt de entrada, o que pode melhorar significativamente o resultado gerado para prompts mais curtos, mas também aumentará o tempo de processamento.
true: padrão, ativa a reescrita inteligente;false: não reescreve.
boolean
Define se o áudio será adicionado.Prioridade dos parâmetros: audio_url > audio; válido somente quando audio_url estiver vazio.
true: padrão, adiciona narração automaticamente ao vídeo;false: não adiciona áudio; a saída será um vídeo sem som.
integer
Semente aleatória, usada para controlar a aleatoriedade do conteúdo gerado pelo modelo, com intervalo de valores: [0, 2147483647].Se não for preenchida, um número aleatório será gerado automaticamente. Se desejar um resultado de geração mais estável, você pode informar o mesmo valor de seed.Valor de exemplo: 12345.
Informações da resposta
string
obrigatório
task_id da tarefa assíncrona. Você deve usar esse task_id para chamar a API de consulta de resultado da tarefa para obter o resultado gerado
⌘I