Crear Sprite V2
Propósito
Genera animaciones de sprite basadas en la imagen subida. Puedes crear hojas de sprite en estilo pixel art o estilo general.
Método y Ruta
POST /public/v1/sprite/make-sprite/v2
Autenticación
Consulta la página de autenticación. Se requiere un token Bearer.
Encabezados Requeridos:
Authorization: Bearer {your_api_key}
Campos de Solicitud
| Nombre del Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
| start_frame_image | file | Sí | Archivo de imagen base para el fotograma inicial |
| end_frame_image | file | No | Archivo de imagen opcional base para el fotograma final |
| text | string | Sí | Prompt de texto para la generación del sprite |
| frame | integer | Sí | Número de frames a generar. Debe ser uno de: 49, 81, 121 |
| is_pixel | boolean | Sí | Si la imagen es estilo pixel art. true o false |
Respuesta
Respuesta Exitosa (200 OK):
{
"job_id": "uuid-string"
}
| Campo | Tipo | Descripción |
|---|---|---|
| job_id | string | Identificador único del trabajo creado. Consulta los resultados con Get Job Status |
Reglas de Error / Validación
| Situación | Estado HTTP | Mensaje de Error |
|---|---|---|
| Invalid image file | 400 | "Invalid image file" |
| Valor de frame no permitido | 400 | "frame should be one of 49, 81, 121" |
| Fallo de autenticación | 401 | Clave de API inválida |
Valores de Frame Permitidos:
- 49, 81, 121
Comportamiento de Trabajos Asíncronos
Este endpoint crea un trabajo asíncrono. Devuelve inmediatamente un job_id, y la generación real del sprite ocurre en segundo plano.
Método de Polling:
- Guarda el
job_idrecibido en la respuesta - Haz polling a
GET /public/v1/job/{job_id}para verificar el estado - Cuando el estado sea
Succeed, consulta los resultados enimage_urls(GIF e imágenes de frames individuales)
Flujo de Estado: Pending → Succeed o Failed
Ejemplo de Solicitud
cURL (estilo pixel art):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/make-sprite/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "start_frame_image=@/path/to/character.png" \
-F "text=walking animation" \
-F "frame=49" \
-F "is_pixel=true"
cURL (estilo general):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/make-sprite/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "start_frame_image=@/path/to/character.png" \
-F "text=running animation cycle" \
-F "frame=81" \
-F "is_pixel=false"
cURL (estilo general + fotograma final):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/make-sprite/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "start_frame_image=@/path/to/character_start.png" \
-F "end_frame_image=@/path/to/character_end.png" \
-F "text=running animation cycle" \
-F "frame=81" \
-F "is_pixel=false"