API Crear clave

YouTube

Cortos animados

Un corto animado sin palabras sobre un problema que superar y el día que todo cambió

Desde
245 crpor anuncio
Endpoint
POST /api/v1/studio/shortfilm/runs
Id del flujo
shortfilm

Resultados reales de este flujo.

La solicitud

# 1. Pide el precio. Gratis, no se cobra nada.
PRICE=$(curl -s -X POST https://staglight.ai/api/v1/studio/shortfilm/estimate \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "card": "film",
    "inputs": {"plan": "{\"hero\": \"a simple pale cream cartoon figure with a smooth round bald head, two small dot eyes, a small mouth and a soft rounded body with thin arms and legs, no clothes details\", \"theme\": \"Lo hondo\", \"closer\": \"El miedo se encoge cuando nadas hacia él.\", \"shadow\": \"the fear of deep water\", \"shots\": [{\"shows\": \"An indoor pool at night with blue-green light rippling on the walls. The figure sits on the edge of the shallow end, feet in the water, staring at the dark deep end across the pool.\", \"day\": \"DÍA 12\", \"line\": \"Venía cada semana. Nunca pasaba de la cuerda.\", \"voice\": \"quédate donde haces pie.\"}, {\"shows\": \"The red-outlined shadow rises out of the deep end, dripping, and leans over the lane rope toward the figure, who pulls its feet out of the water.\", \"day\": \"DÍA 30\", \"line\": \"Lo hondo siempre contestaba primero.\", \"voice\": \"te vas a hundir.\"}, {\"shows\": \"The figure walks out past children splashing happily in the deep end, wrapped in a towel, head down, and sits alone on a bench in the dim changing room.\", \"day\": \"DÍA 58\", \"line\": \"Los niños jugaban en el agua que él temía.\", \"voice\": \"hay quien no puede.\"}, {\"shows\": \"Early morning, the pool empty and still. The figure stands at the edge of the deep end, breathes in, holds the ladder and lowers itself into the water up to the chin.\", \"day\": \"DÍA 1\", \"line\": \"Una mañana bajó por la escalerilla.\", \"voice\": \"\"}, {\"shows\": \"The figure kicks along the wall holding a float, sinks, splutters, grabs the edge, then lets go and tries again while the red shadow at the bottom of the pool grows smaller.\", \"day\": \"DÍA 45\", \"line\": \"Toser. Agarrarse al borde. Otra vez.\", \"voice\": \"vuelve atrás.\"}, {\"shows\": \"Sunlight pours through high windows. The figure swims slowly across the deep end, past the rope, and floats on its back in the middle of the pool, arms open, while the faint red shadow fades away below\", \"day\": \"DÍA 200\", \"line\": \"Ahora el centro de la piscina es su lugar favorito.\", \"voice\": \"\"}]}"}
  }' | jq .credits)
echo "$PRICE"

# 2. Inícialo. max_credits rechaza lo que pase de ese precio; el Idempotency-Key evita un cobro doble.
START=$(curl -s -X POST https://staglight.ai/api/v1/studio/shortfilm/runs \
  -H "Authorization: Bearer $STAGLIGHT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "card": "film",
    "inputs": {"plan": "{\"hero\": \"a simple pale cream cartoon figure with a smooth round bald head, two small dot eyes, a small mouth and a soft rounded body with thin arms and legs, no clothes details\", \"theme\": \"Lo hondo\", \"closer\": \"El miedo se encoge cuando nadas hacia él.\", \"shadow\": \"the fear of deep water\", \"shots\": [{\"shows\": \"An indoor pool at night with blue-green light rippling on the walls. The figure sits on the edge of the shallow end, feet in the water, staring at the dark deep end across the pool.\", \"day\": \"DÍA 12\", \"line\": \"Venía cada semana. Nunca pasaba de la cuerda.\", \"voice\": \"quédate donde haces pie.\"}, {\"shows\": \"The red-outlined shadow rises out of the deep end, dripping, and leans over the lane rope toward the figure, who pulls its feet out of the water.\", \"day\": \"DÍA 30\", \"line\": \"Lo hondo siempre contestaba primero.\", \"voice\": \"te vas a hundir.\"}, {\"shows\": \"The figure walks out past children splashing happily in the deep end, wrapped in a towel, head down, and sits alone on a bench in the dim changing room.\", \"day\": \"DÍA 58\", \"line\": \"Los niños jugaban en el agua que él temía.\", \"voice\": \"hay quien no puede.\"}, {\"shows\": \"Early morning, the pool empty and still. The figure stands at the edge of the deep end, breathes in, holds the ladder and lowers itself into the water up to the chin.\", \"day\": \"DÍA 1\", \"line\": \"Una mañana bajó por la escalerilla.\", \"voice\": \"\"}, {\"shows\": \"The figure kicks along the wall holding a float, sinks, splutters, grabs the edge, then lets go and tries again while the red shadow at the bottom of the pool grows smaller.\", \"day\": \"DÍA 45\", \"line\": \"Toser. Agarrarse al borde. Otra vez.\", \"voice\": \"vuelve atrás.\"}, {\"shows\": \"Sunlight pours through high windows. The figure swims slowly across the deep end, past the rope, and floats on its back in the middle of the pool, arms open, while the faint red shadow fades away below\", \"day\": \"DÍA 200\", \"line\": \"Ahora el centro de la piscina es su lugar favorito.\", \"voice\": \"\"}]}"},
    "max_credits": '"$PRICE"'
  }')

ID=$(echo "$START" | jq -r .id)

# 3. Espera a que termine.
while :; do
  STATUS=$(curl -s "https://staglight.ai/api/v1/studio/shortfilm/runs/$ID" -H "Authorization: Bearer $STAGLIGHT_API_KEY" | jq -r .status)
  case "$STATUS" in succeeded|partial|failed) break ;; esac; sleep 10
done

# 4. Descarga todos los archivos en un zip.
curl -s -L -o result.zip "https://staglight.ai/api/v1/studio/shortfilm/runs/$ID/outputs.zip" -H "Authorization: Bearer $STAGLIGHT_API_KEY"

Cuánto cuesta

PlantillaFinal, mejor textoBorrador, rápido y barato
Corto animado485 cr245 cr

Precios del servidor con los ajustes por defecto. La llamada de estimación da el precio exacto para tus entradas, gratis.

Entradas

NombreTipoValores
cardLa plantilla string film
inputs.ideaTu idea string
inputs.planEl plan string
inputs.drawCorto sorpresa string
inputs.lengthDuración enum 12, 30
inputs.shapeTipo de historia enum arc, unseen, split, fork, habit, any
inputs.languageIdioma enum auto, en, es
qualityCalidad enum final, draft
aspectFormato enum 9:16, 16:9

Los archivos son ids de POST /api/v1/uploads. Ver la documentación

Pruébalo a mano

El mismo flujo funciona en el estudio, con el mismo saldo. Úsalo para ver el resultado antes de escribir código.

Regístrate para probarlo

Más flujos