curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
HappyHorse
Generación de Video HappyHorse 1.1
- Modelo de generación de video HappyHorse 1.1 de Alibaba Cloud Bailian (entrada unificada, enrutamiento automático de modelo único)
- Enrutamiento automático por parámetros: T2V (solo prompt) / I2V (first_frame_image) / R2V (image_urls)
- Soporta resoluciones 720P/1080P y cualquier duración entera de 3 a 15 segundos
- Facturado únicamente por resolución × duración (segundos), independientemente de la capacidad
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.apimart.ai/v1/videos/generations";
String payload = """
{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = "https://api.apimart.ai/v1/videos/generations";
$payload = [
"model" => "happyhorse-1.1",
"prompt" => "A little girl walking down the road, cinematic feel",
"resolution" => "1080P",
"size" => "16:9",
"duration" => 5,
"seed" => 42
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.apimart.ai/v1/videos/generations")
payload = {
model: "happyhorse-1.1",
prompt: "A little girl walking down the road, cinematic feel",
resolution: "1080P",
size: "16:9",
duration: 5,
seed: 42
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
puts response.body
import Foundation
let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!
let payload: [String: Any] = [
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 5,
"seed": 42
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try? JSONSerialization.data(withJSONObject: payload)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var url = "https://api.apimart.ai/v1/videos/generations";
var payload = @"{
""model"": ""happyhorse-1.1"",
""prompt"": ""A little girl walking down the road, cinematic feel"",
""resolution"": ""1080P"",
""size"": ""16:9"",
""duration"": 5,
""seed"": 42
}";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Invalid authentication credentials",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance. Please top up your account",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error. Please try again later",
"type": "server_error"
}
}
Autorización
string
requerido
Todos los endpoints de la API requieren autenticación mediante Bearer TokenObtenga su API Key:Visite la página de gestión de API Keys para obtener su API KeyAñádala al encabezado de la solicitud:
Authorization: Bearer YOUR_API_KEY
Enrutamiento de modos
happyhorse-1.1 es la entrada unificada para Text-to-Video / Image-to-Video / Reference-Image-to-Video. El backend determina automáticamente el modo según los parámetros entrantes. Todos los modos se facturan con la misma regla (solo resolución × segundos):
| Campos que envía | Se enruta a | Descripción del modo |
|---|---|---|
Solo prompt | Text-to-Video (T2V) | Genera video únicamente a partir de texto |
prompt + first_frame_image | Image-to-Video (I2V) | Anima desde una imagen del primer fotograma |
prompt + image_urls (1–9 imágenes) | Reference-Image-to-Video (R2V) | Genera una nueva escena a partir de imágenes de referencia |
first_frame_image > image_urls > solo prompt.
Reglas de exclusión mutua: los dos campos de medios (first_frame_image / image_urls) son mutuamente excluyentes. Pasar ambos campos mutuamente excluyentes a la vez devuelve 400 mixed_media_not_allowed.
Parámetros de la solicitud
string
requerido
Nombre del modelo de generación de video, fijado como
happyhorse-1.1boolean
predeterminado:"false"
Indica si se debe moderar el contenido antes de enviar la tarea de vídeo.
true: revisar los prompts y las imágenes de entrada conomni-moderation-latestfalseu omitido: no enviar una solicitud de moderación, sin coste ni latencia de moderación adicionales (predeterminado)
string
Descripción del contenido del video, hasta 2500 caracteres; no puede contener tokens especialesEjemplo:
"A little girl walking down the road, cinematic feel"string
Imagen del primer fotograma, activa I2V (Image-to-Video). Admite URL o base64 (
data:image/<mime>;base64,<payload>, el gateway la sube automáticamente a OSS)Mutuamente excluyente con image_urlsRequisitos de la imagen del primer fotograma:
- Formato: JPEG / JPG / PNG / BMP / WEBP
- Lado corto: ≥ 300px
- Proporción de aspecto:
1:2.5a2.5:1 - Tamaño del archivo: ≤ 10MB
array<string>
Array de imágenes (Modo R2V): 1–9 imágenes, usadas como referencias de sujeto/estilo para generar una nueva escenaAdmite URL o base64Mutuamente excluyente con
first_frame_imageRequisitos de las imágenes de referencia:
- Formato: JPEG / JPG / PNG / BMP / WEBP
- Lado corto: ≥ 720p recomendado
- Proporción de aspecto: corto / largo ≥ 0.4
- Tamaño del archivo: ≤ 10MB
- Cantidad: 1–9 imágenes
string
predeterminado:"1080P"
Resolución del video (afecta a la facturación)Opciones:
720P- Estándar1080P- Alta definición (por defecto)
integer
predeterminado:"5"
Duración del video en segundos (afecta a la facturación)Rango soportado: cualquier entero de
3 a 15Por defecto: 5string
predeterminado:"16:9"
Proporción de aspectoFormatos soportados:
16:9- Paisaje panorámico (por defecto)9:16- Retrato1:1- Cuadrado4:3- Paisaje3:4- Retrato
Ignorado en modo I2V — la proporción de aspecto de salida se determina automáticamente por el medio de entrada (imagen del primer fotograma)
boolean
predeterminado:"false"
Si se debe añadir una marca de agua al video generado
true: añadir marca de aguafalse: no añadir marca de agua (por defecto)
integer
Semilla aleatoria usada para controlar la aleatoriedad del contenido generadoRango de valores:
[0, 2147483647]. Si se omite, se usa una semilla aleatoria.- Para solicitudes idénticas, el modelo genera resultados diferentes al recibir valores de seed diferentes (por ejemplo, al omitir el seed)
- Para solicitudes idénticas, el modelo genera resultados similares al recibir el mismo valor de seed, pero no se garantiza consistencia exacta
Respuesta
integer
Código de estado de la respuesta, 200 en caso de éxito
array
Casos de uso
Caso 1: Texto a video T2V (Solicitud más simple)
{
"model": "happyhorse-1.1",
"prompt": "A little girl walking down the road, cinematic feel"
}
Caso 2: Texto a video T2V (Parámetros completos)
{
"model": "happyhorse-1.1",
"prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel",
"resolution": "1080P",
"size": "16:9",
"duration": 8,
"seed": 42
}
Caso 3: Imagen a video I2V (first_frame_image)
{
"model": "happyhorse-1.1",
"prompt": "Bring the scene in the image to life",
"first_frame_image": "https://example.com/first_frame.png",
"resolution": "1080P",
"duration": 5
}
Caso 4: Referencia-Imagen a video R2V (múltiples referencias)
{
"model": "happyhorse-1.1",
"prompt": "The protagonist from image 1 runs through the scene from image 2, then picks up the prop from image 3. Keep a 3D cartoon style with smooth motion.",
"image_urls": [
"https://example.com/img_01.jpg",
"https://example.com/img_02.png",
"https://example.com/img_03.jpeg"
],
"resolution": "1080P",
"size": "16:9",
"duration": 5
}
Caso 5: 720P para ahorrar costos
{
"model": "happyhorse-1.1",
"prompt": "Waves crashing on the beach at sunset",
"resolution": "720P",
"size": "16:9",
"duration": 5
}
Guía de selección de modo
| Requisito | Enfoque recomendado |
|---|---|
| Generar video solo a partir de texto | Pasar solo prompt (T2V) |
| Hacer que una imagen “cobre vida” (usarla como primer fotograma) | Pasar first_frame_image (I2V) |
| Generar una nueva escena a partir de un conjunto de imágenes de referencia | Pasar image_urls (1–9, R2V) |
| Ahorrar costos | Usar resolution: "720P" |
Consejos de uso
- Lógica de entrada unificada: los campos de entrada determinan el modo. Tenga en cuenta que los dos campos de medios (
first_frame_image/image_urls) son mutuamente excluyentes sizesolo efectivo en T2V/R2V: en el modo I2V,sizese ignora — la proporción de aspecto de salida está determinada por el medio de entrada- Duración: de 5 a 10 segundos es el punto óptimo. Demasiado corta causa movimiento entrecortado; demasiado larga aumenta significativamente el tiempo de procesamiento upstream
- Calidad de la imagen del primer fotograma: clara, bien compuesta, sujeto centrado — mejora significativamente la salida I2V
- Redacción del prompt: describa movimiento / cámara / atmósfera (por ejemplo, “slow push-in, cinematic, warm tones”) para obtener mejores resultados que con descripciones puramente estáticas de la escena
Consultar resultados de la tareaLa generación de video es una tarea asíncrona que devuelve un
task_id al enviarse. Use el endpoint Obtener estado de la tarea para consultar el progreso y los resultados de la generación.