Wan 2.5 Preview Texto para vídeo
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-t2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"audio_url": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-t2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"audio_url": "<string>"
},
"parameters": {
"size": "<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>', audio_url: '<string>'},
parameters: {size: '<string>', duration: 123, prompt_extend: true, audio: true, seed: 123}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-t2v-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-t2v-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>',
'audio_url' => '<string>'
],
'parameters' => [
'size' => '<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-t2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v-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 \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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 Texto para vídeo
POST
/
v3
/
async
/
wan-2.5-t2v-preview
Wan 2.5 Preview Texto para vídeo
curl --request POST \
--url https://api.highwayapi.ai/v3/async/wan-2.5-t2v-preview \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"audio_url": "<string>"
},
"parameters": {
"size": "<string>",
"duration": 123,
"prompt_extend": true,
"audio": true,
"seed": 123
}
}
'import requests
url = "https://api.highwayapi.ai/v3/async/wan-2.5-t2v-preview"
payload = {
"input": {
"prompt": "<string>",
"negative_prompt": "<string>",
"audio_url": "<string>"
},
"parameters": {
"size": "<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>', audio_url: '<string>'},
parameters: {size: '<string>', duration: 123, prompt_extend: true, audio: true, seed: 123}
})
};
fetch('https://api.highwayapi.ai/v3/async/wan-2.5-t2v-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-t2v-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>',
'audio_url' => '<string>'
],
'parameters' => [
'size' => '<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-t2v-preview"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v-preview")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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-t2v-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 \"audio_url\": \"<string>\"\n },\n \"parameters\": {\n \"size\": \"<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 de texto para vídeo Wan 2.5 Preview suporta a geração de conteúdo de vídeo de alta qualidade a partir de descrições em texto, podendo gerar vídeos de 5 ou 10 segundos. Novo recurso de áudio: oferece suporte a narração automática e também a arquivos de áudio personalizados.
Esta é uma API assíncrona e retornará apenas o task_id da tarefa assíncrona. Você deve usar esse task_id para solicitar a API de consulta do 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 etc.
Ocultar Descrição dos campos
Ocultar Descrição dos campos
string
obrigatório
Prompt positivo em texto. Suporta chinês e inglês, com no máximo 2000 caracteres; a parte excedente será truncada automaticamente.Valor de exemplo: um gatinho correndo sob a luz da lua.
string
Prompt negativo, usado para descrever conteúdos que devem ser evitados ao gerar o vídeo, permitindo evitar ou limitar elementos na imagem.Suporta chinês e inglês, com no máximo 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.
string
URL do arquivo de áudio personalizado usado para a geração do vídeo. Consulte a descrição das configurações de áudio para ver como usar.Requisitos do áudio:
- Formato: wav, mp3.
- Duração: 3~30 segundos.
- Tamanho do arquivo: no máximo 15 MB.
object
Parâmetros de processamento de vídeo.
Ocultar Descrição dos campos
Ocultar Descrição dos campos
string
Suporta resoluções 480P, 720P e 1080P. Valor padrão:
1920*1080 (ou seja, 1080P).
O parâmetro size é usado para especificar a resolução de saída do vídeo, no formato largura*altura. Os valores específicos compatíveis em cada faixa de resolução são:Faixa 480P: resoluções disponíveis832*480: 16:9480*832: 9:16624*624: 1:1
1280*720: 16:9720*1280: 9:16960*960: 1:11088*832: 4:3832*1088: 3:4
1920*1080: 16:91080*1920: 9:161440*1440: 1:11632*1248: 4:31248*1632: 3:4
Equívoco comum sobre o parâmetro size: é necessário preencher uma resolução específica (como
1280*720), não uma proporção (como 1:1) nem o nome de uma faixa (como 480P, 720P).integer
Duração do vídeo de saída. Valores disponíveis:
5 segundos, 10 segundos.O valor padrão é 5.bool
Define se a reescrita inteligente de prompt deve ser ativada. Quando ativada, um modelo grande será usado para reescrever automaticamente o prompt de entrada, melhorando o efeito de geração para prompts mais curtos, mas aumentando o tempo de processamento.
true: padrão, ativa a reescrita inteligentefalse: não reescreve
boolean
Define se áudio será adicionado.Prioridade dos parâmetros: audio_url > audio; este parâmetro só é válido quando audio_url estiver vazio.
true: padrão, adiciona narração automaticamente ao vídeofalse: não adiciona áudio; a saída será um vídeo sem som
integer
Semente 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 preenchida, o sistema gerará automaticamente uma semente aleatória. Se você quiser que o efeito gerado seja mais estável e consistente, especifique o mesmo valor de 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 do resultado da tarefa a fim de obter o resultado gerado
⌘I