%F0%9F%A6%A1">
AI Media Production Pipeline · Case Study

The lofi studio,
fully automated.

A one-command, human-supervised AI pipeline that produces hour-long lofi YouTube videos end to end — artwork, motion, music, render, metadata and upload — governed by a strict $2.00-per-run cost ceiling, with a zero-dependency Studio dashboard for full observability.

0
Sessions produced
0
Upload success
$2.00
Per-run cost cap
0
Pipeline steps
Overview

One command. A finished video.

Run python orchestrator.py --theme "rainy night" --season autumn and a complete lofi video is generated, rendered and (optionally) published — all under human supervision and a hard spend ceiling. Its mascot is Porsuk, a headphone-wearing night-owl cat.

3-phase parallel pipeline

Image+motion and music generation run concurrently, then merge, metadata and upload. Coordinated by a single orchestrator with checkpointed state.

📊

Read-only Studio dashboard

A premium, zero-dependency (stdlib only) observability panel: sessions, cost analytics, live pipeline state, artwork gallery and logs.

💰

Cost governance

Every run is bounded by a $2.00 ceiling. Spend is tracked per asset (image / video / music) and the pipeline halts before it can exceed the cap.

🎵

AI music & visuals

fal.ai MiniMax Music v2 for instrumental lofi tracks, AI image + motion generation for the Porsuk cover loop. All curated by a human.

🔐

Safety by design

Uploads default to private. Secrets are git-ignored. The dashboard redacts private local paths and never reads credential files.

🔁

Resume & dedupe

Each step is saved to state.json. Interrupted runs continue where they left off, and completed steps are never re-run.

The control room

A dashboard built like a product.

Cinematic dark interface, glassmorphism panels, animated metric cards and premium charts — running locally on the Python standard library, with no external dependencies.

127.0.0.1:8765 · Studio dashboard
Badger Tape Studio dashboard — overview

Overview tab — hero, animated KPIs, cost-per-run chart, upload-success ring and seasonal distribution. Real data from the deployed pipeline.

The state machine

Seven steps, fully observable.

Every run advances through a 7-step state machine. Click a step to see what happens at each stage — the same rail is animated live inside the dashboard.

orchestrator.py · pipeline state
Variation
📷
Artwork
🎥
Motion
🎵
Music
🔀
Render
📄
Metadata
📺
Upload

Phase 1 (image+motion ‖ music) runs in parallel, then merge, metadata and upload run in sequence.

Cost governance

Spend, on a leash.

Each run is capped at $2.00. Spend is recorded per asset and surfaced live. Drag the slider to see how the governance bar reacts as a run accumulates cost.

Cost governance$0.78 / $2.00
$0$1.00$2.00 cap
$1.22 remaining under the $2.00 cap
Image $0.08 Video $0.35 Music ×10 $0.35
  • A per-run ceiling of $2.00, enforced before any paid call.
  • Spend tracked per asset and rolled up in cost_tracker.
  • Bar turns amber at 70% and red at 90%.
  • Real fleet: $4.61 total across 6 sessions (~$0.77/run).
The surfaces

Five views, one source of truth.

The dashboard reads only local session files and logs — nothing is generated, uploaded or deleted. Switch between the surfaces below.

127.0.0.1:8765 · overview
Overview
Sessions table
Artwork gallery
Live pipeline
Logs

Animated metrics, cost-per-run chart and upload-success ring.

Generation

AI assets, curated by a human.

  • fal.ai MiniMax Music v2 renders ten instrumental lofi tracks per run.
  • AI image + motion generation creates the Porsuk cover and its looping video.
  • ffmpeg merges loop + tracks into an hour-long final at a fixed target length.
  • Titles, description and tags follow a lofi-native format (lowercase, "beats to ___ to").
  • Original brand, mascot and voice — informed by genre benchmark analysis, not copied.
Safety

Guardrails, everywhere.

  • $2.00 per-run spend ceiling, enforced before paid generation.
  • Uploads default to private — nothing goes public without action.
  • Resume / checkpoint per step; duplicate protection on completed steps.
  • Secrets git-ignored; the dashboard never reads .env or token files.
  • Private local paths are redacted before anything reaches the browser.
Under the hood

Architecture.

A small, type-aware Python codebase: one orchestrator, five specialised agents, shared utilities, and a stdlib-only dashboard.

Coordinator
orchestrator.py
3-phase · parallel · checkpointed
common.py
cost tracking · state · ffmpeg
monitor.py
terminal live monitor
Agents
image_agent
Porsuk cover art
video_agent
looping motion
music_agent
10× MiniMax tracks
merge_agent
ffmpeg merge · QA
upload_agent
YouTube Data API
dashboard.py
read-only · stdlib
Proof, not mockups

Straight from the live system.

Real, unedited captures from the running dashboard on actual session data — click any to enlarge.

Sessions
Sessions

Filterable table · status badges · CSV/JSON export

Live
Live pipeline

Animated 7-step rail · cost-cap bar · activity log

Gallery
Gallery

Porsuk artwork · YouTube / loop / 1h ribbons

Session detail
Session detail

YouTube embed · artwork · tracks · timeline

Logs
Logs

Level badges · session markers · redacted paths

Start pipeline modal
Start pipeline

Launcher modal · theme / season / atmosphere · $2.00 cap up front

Stack

Built with.

Python 3.10+asyncio · parallel phasesfal.ai MiniMax Music v2ffmpeg / ffprobeYouTube Data API Google OAuthpython-dotenvstdlib http.server vanilla JS dashboardJSON state machine
0
Sessions produced
0
Lofi tracks rendered
0
Upload success
0
Pipeline steps
enlarged×