Pixverse C1: video a partir de imagen de referencia
curl --request POST \
--url https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"images": [
{
"type": "<string>",
"ref_name": "<string>",
"image_url": "<string>"
}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"generate_audio_switch": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video"
payload = {
"images": [
{
"type": "<string>",
"ref_name": "<string>",
"image_url": "<string>"
}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"generate_audio_switch": 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({
images: [{type: '<string>', ref_name: '<string>', image_url: '<string>'}],
prompt: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
generate_audio_switch: true
})
};
fetch('https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video', 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/pixverse-pixverse-c1-reference-to-video",
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([
'images' => [
[
'type' => '<string>',
'ref_name' => '<string>',
'image_url' => '<string>'
]
],
'prompt' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'generate_audio_switch' => 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/pixverse-pixverse-c1-reference-to-video"
payload := strings.NewReader("{\n \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\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/pixverse-pixverse-c1-reference-to-video")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video")
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 \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Vídeo
Pixverse C1: video a partir de imagen de referencia
POST
/
v3
/
async
/
pixverse-pixverse-c1-reference-to-video
Pixverse C1: video a partir de imagen de referencia
curl --request POST \
--url https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"images": [
{
"type": "<string>",
"ref_name": "<string>",
"image_url": "<string>"
}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"generate_audio_switch": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video"
payload = {
"images": [
{
"type": "<string>",
"ref_name": "<string>",
"image_url": "<string>"
}
],
"prompt": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"generate_audio_switch": 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({
images: [{type: '<string>', ref_name: '<string>', image_url: '<string>'}],
prompt: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
generate_audio_switch: true
})
};
fetch('https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video', 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/pixverse-pixverse-c1-reference-to-video",
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([
'images' => [
[
'type' => '<string>',
'ref_name' => '<string>',
'image_url' => '<string>'
]
],
'prompt' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'generate_audio_switch' => 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/pixverse-pixverse-c1-reference-to-video"
payload := strings.NewReader("{\n \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\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/pixverse-pixverse-c1-reference-to-video")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/pixverse-pixverse-c1-reference-to-video")
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 \"images\": [\n {\n \"type\": \"<string>\",\n \"ref_name\": \"<string>\",\n \"image_url\": \"<string>\"\n }\n ],\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"generate_audio_switch\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}La herramienta Pixverse C1 de video a partir de imagen de referencia puede generar videos de calidad cinematográfica a partir de 1-7 imágenes de referencia. Permite citar imágenes de referencia en el prompt mediante la sintaxis @ref_name, y admite coherencia de múltiples personajes/objetos, múltiples resoluciones (360p-1080p), duración variable (1-15 segundos) y generación de audio.
Esta es una API asíncrona y solo devolverá 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 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
Lista de imágenes de referencia (1-7)Longitud del array: 1 - 7
Ocultar propiedades
Ocultar propiedades
string
requerido
Tipo de imagen de referencia: subject indica que la generación de video se realiza tomando como sujeto a la persona/objeto de la imagen de referencia; background indica que la generación de video se realiza tomando como fondo la escena/entorno de la imagen de referenciaValores opcionales:
subject, backgroundstring
requerido
Nombre identificador corto de la imagen de referencia, usado para citar esta imagen de referencia en el prompt mediante la sintaxis @ref_name; @ref_name debe ir seguido de un espacio
string
requerido
Dirección URL de la imagen de referencia
string
requerido
Texto de descripción de la escena. Use la sintaxis @ref_name para citar las imágenes de referencia cargadas (por ejemplo, «@hero corre en @city»); @ref_name debe ir seguido de un espacio y el nombre citado debe coincidir con el ref_name en images
integer
predeterminado:5
Duración del video generado (segundos), en el rango 1-15Rango de valores: [1, 15]
string
predeterminado:"720p"
Resolución del video de salidaValores opcionales:
360p, 540p, 720p, 1080pstring
predeterminado:"16:9"
Relación de aspecto del video de salidaValores opcionales:
16:9, 4:3, 1:1, 3:4, 9:16, 2:3, 3:2, 21:9boolean
predeterminado:false
Indica si se debe generar también audio nativo del video
Información de respuesta
string
requerido
Use task_id para solicitar la API de consulta de resultado de tarea y recuperar la salida generada.