YouTube
Short Films
A wordless animated film about a struggle and the day it turned
- From
- 245 crper ad
- Endpoint
POST /api/v1/studio/shortfilm/runs- Workflow id
shortfilm
Real outputs of this workflow.
The request
# 1. Price it. Free, nothing is charged.
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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'\''ll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can'\''t.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"}
}' | jq .credits)
echo "$PRICE"
# 2. Start it. max_credits refuses anything above that price; the Idempotency-Key stops a double charge.
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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'\''ll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can'\''t.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"},
"max_credits": '"$PRICE"'
}')
ID=$(echo "$START" | jq -r .id)
# 3. Wait until it finishes.
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. Download every file in one zip.
curl -s -L -o result.zip "https://staglight.ai/api/v1/studio/shortfilm/runs/$ID/outputs.zip" -H "Authorization: Bearer $STAGLIGHT_API_KEY" import os, time, uuid, requests
BASE = "https://staglight.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['STAGLIGHT_API_KEY']}"}
# 1. Price it. Free, nothing is charged.
estimate = {
"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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can't.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"}
}
price = requests.post(f"{BASE}/api/v1/studio/shortfilm/estimate", headers=HEADERS, json=estimate, timeout=60).json()["credits"]
print(price)
# 2. Start it. max_credits refuses anything above that price; the Idempotency-Key stops a double charge.
body = {
"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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can't.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"},
"max_credits": 485
}
body["max_credits"] = price
r = requests.post(f"{BASE}/api/v1/studio/shortfilm/runs", json=body, timeout=60,
headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())})
r.raise_for_status()
start = r.json()
# 3. Wait until it finishes.
while True:
run = requests.get(f"{BASE}/api/v1/studio/shortfilm/runs/{start['id']}", headers=HEADERS, timeout=60).json()
if run["status"] in ("succeeded", "partial", "failed"):
break
time.sleep(10)
# 4. Download every file in one zip.
with open("result.zip", "wb") as out:
out.write(requests.get(f"{BASE}/api/v1/studio/shortfilm/runs/{start['id']}/outputs.zip", headers=HEADERS, timeout=300).content) // Node 18 or newer. Save as run.mjs: top-level await needs a module.
const BASE = "https://staglight.ai";
const headers = { Authorization: `Bearer ${process.env.STAGLIGHT_API_KEY}` };
const json = { ...headers, "Content-Type": "application/json" };
// 1. Price it. Free, nothing is charged.
const estimate = {
"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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can't.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"}
};
const price = await (await fetch(`${BASE}/api/v1/studio/shortfilm/estimate`, { method: "POST", headers: json, body: JSON.stringify(estimate) })).json();
console.log(price.credits);
// 2. Start it. max_credits refuses anything above that price; the Idempotency-Key stops a double charge.
const body = {
"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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can't.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"},
"max_credits": 485
};
body.max_credits = price.credits;
const res = await fetch(`${BASE}/api/v1/studio/shortfilm/runs`, {
method: "POST", headers: { ...json, "Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify(body),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const start = await res.json();
// 3. Wait until it finishes.
let run = start;
while (!["succeeded", "partial", "failed"].includes(run.status)) {
await new Promise((r) => setTimeout(r, 10000));
run = await (await fetch(`${BASE}/api/v1/studio/shortfilm/runs/${start.id}`, { headers })).json();
}
// 4. Download every file in one zip.
console.log(`${BASE}/api/v1/studio/shortfilm/runs/${start.id}/outputs.zip`); Use the Staglight API to run the workflow "Short Films" from server code.
Docs: https://staglight.ai/llms.txt
This workflow: https://staglight.ai/en/api/workflows/shortfilm
Key: read it from the STAGLIGHT_API_KEY environment variable. Never put it in browser code.
1. Price it for free first: POST /api/v1/studio/shortfilm/estimate
2. Start it: POST /api/v1/studio/shortfilm/runs, with an Idempotency-Key header and max_credits.
Body: {"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\": \"Deep End\", \"closer\": \"Fear shrinks the day you swim toward it.\", \"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\": \"DAY 12\", \"line\": \"Every week he came. He never went past the rope.\", \"voice\": \"stay where you can stand.\"}, {\"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\": \"DAY 30\", \"line\": \"The deep end always answered first.\", \"voice\": \"you'll sink.\"}, {\"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\": \"DAY 58\", \"line\": \"Kids played in the water he feared.\", \"voice\": \"some people just can't.\"}, {\"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\": \"DAY 1\", \"line\": \"One morning he climbed down the ladder.\", \"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\": \"DAY 45\", \"line\": \"Coughing. Grabbing the wall. Again.\", \"voice\": \"go back.\"}, {\"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\": \"DAY 200\", \"line\": \"Now the middle of the pool is his favourite place.\", \"voice\": \"\"}]}"}, "max_credits": 485}
Files are media ids from POST /api/v1/uploads.
3. After a timeout, check the job list before you retry, and retry with the same Idempotency-Key.
4. Poll the run until it finishes, then download its outputs.zip. What it costs
| Template | Final, best text | Draft, fast and cheap |
|---|---|---|
| Short Film | 485 cr | 245 cr |
Prices from the server at the default settings. The estimate call gives the exact price for your inputs, for free.
Inputs
| Name | Type | Allowed |
|---|---|---|
cardThe template | string | film |
inputs.ideaYour idea | string | |
inputs.planThe plan | string | |
inputs.drawSurprise film | string | |
inputs.lengthLength | enum | 12, 30 |
inputs.shapeStory shape | enum | arc, unseen, split, fork, habit, any |
inputs.languageLanguage | enum | auto, en, es |
qualityQuality | enum | final, draft |
aspectShape | enum | 9:16, 16:9 |
Files are media ids from POST /api/v1/uploads. View documentation
Try it by hand
The same workflow runs in the studio, on the same balance. Use it to see the result before you write code.
More workflows
- Real output YouTube
Ranking Shorts
Five crazy levels, ranked #5 to #1, in one vertical Short
per ad, from190 cr
- Real output YouTube
Glow-up Series
An animated series in your language where your audience votes what changes each day
per ad, from216 cr
- Real output YouTube
Motion Math
Any idea becomes a neon maths Short, with the real number worked out and shown happening
per ad, from100 cr