Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
224 lines
14 KiB
Python
224 lines
14 KiB
Python
"""Seed genre presets + registry (mirror of ``src/presets.ts``).
|
|
|
|
Each preset is the **blueprint projection** of a system template seeded by the
|
|
backend ``templates`` domain (``apps/api/app/domains/templates/presets/``): same
|
|
slug, genre, aspect, and slot role-sequence, with each slot's fractional timing
|
|
expanded against the template's ``default_duration_s`` into the integer-ms slots
|
|
this schema pins. The frontends render these in the ``/blueprints`` picker; the
|
|
backend enforces at registry load that every seeded template projects **exactly**
|
|
onto the preset here (byte-identical ``content_hash``) — so the picker and the
|
|
seeded templates cannot drift out of sync. One definition, no drift.
|
|
|
|
To change a blueprint, edit the backend ``ShotTemplateDef`` and regenerate this
|
|
file + ``src/presets.ts`` + the golden fixture with the same projection rule
|
|
(``round(frac * default_duration_s * 1000)``); the parity guard fails otherwise.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from .template import make_slot, make_template
|
|
|
|
_PRESETS: dict[str, dict[str, Any]] = {
|
|
"product-demo-ad": make_template(
|
|
"product-demo-ad", "marketing", "9:16", [
|
|
make_slot("hook", 0, 3600, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 3600, 9000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("rising", 9000, 21600, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("payoff", 21600, 26400, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 26400, 30000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"testimonial-ad": make_template(
|
|
"testimonial-ad", "marketing", "9:16", [
|
|
make_slot("hook", 0, 3500, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("setup", 3500, 10000, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("payoff", 10000, 20500, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("cta", 20500, 25000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"before-after": make_template(
|
|
"before-after", "marketing", "9:16", [
|
|
make_slot("hook", 0, 3500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 3500, 9500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("rising", 9500, 18500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("climax", 18500, 22500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 22500, 25000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"listicle": make_template(
|
|
"listicle", "edutainment", "9:16", [
|
|
make_slot("hook", 0, 2800, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("rising", 2800, 21840, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("payoff", 21840, 25200, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("cta", 25200, 28000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
"greenscreen-react": make_template(
|
|
"greenscreen-react", "commentary", "9:16", [
|
|
make_slot("hook", 0, 3900, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("body", 3900, 18600, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("payoff", 18600, 25800, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("cta", 25800, 30000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"minecraft-reddit-split": make_template(
|
|
"minecraft-reddit-split", "brainrot-split", "9:16", [
|
|
make_slot("hook", 0, 2025, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 2025, 9900, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("rising", 9900, 31500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("climax", 31500, 39600, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 39600, 45000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"quiz-engagement": make_template(
|
|
"quiz-engagement", "engagement", "9:16", [
|
|
make_slot("hook", 0, 2200, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("rising", 2200, 15400, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("climax", 15400, 18920, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("cta", 18920, 20900, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("loop", 20900, 22000, caption_preset="karaoke_green", transition_out="cut"),
|
|
]),
|
|
"split-screen-gameplay-story": make_template(
|
|
"split-screen-gameplay-story", "brainrot-split", "9:16", [
|
|
make_slot("hook", 0, 2250, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("body", 2250, 40500, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("cta", 40500, 45000, caption_preset="karaoke_green", transition_out="cut"),
|
|
]),
|
|
"movie-recap": make_template(
|
|
"movie-recap", "recap", "9:16", [
|
|
make_slot("hook", 0, 4800, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 4800, 15000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("body", 15000, 49200, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("payoff", 49200, 56400, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 56400, 60000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"fake-ai-podcast": make_template(
|
|
"fake-ai-podcast", "podcast", "9:16", [
|
|
make_slot("hook", 0, 3000, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("exchange", 3000, 45000, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("button", 45000, 50000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
"asmr-satisfying-loop": make_template(
|
|
"asmr-satisfying-loop", "asmr", "9:16", [
|
|
make_slot("hook", 0, 1000, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("body", 1000, 4500, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("seam", 4500, 5000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"anime-beat-edit": make_template(
|
|
"anime-beat-edit", "edit", "9:16", [
|
|
make_slot("hook", 0, 1600, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("body", 1600, 18400, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("payoff", 18400, 20000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"brainrot-ai-meme": make_template(
|
|
"brainrot-ai-meme", "meme", "9:16", [
|
|
make_slot("hook", 0, 1440, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("escalation", 1440, 9000, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("payoff", 9000, 12000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
"platform-hook-open": make_template(
|
|
"platform-hook-open", "opener", "9:16", [
|
|
make_slot("hook", 0, 500, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 500, 3000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("payoff", 3000, 5000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"talking-head-explainer": make_template(
|
|
"talking-head-explainer", "talking-head", "9:16", [
|
|
make_slot("hook", 0, 4000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 4000, 10000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("body", 10000, 32800, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("payoff", 32800, 36800, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 36800, 40000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"faceless-facts": make_template(
|
|
"faceless-facts", "faceless", "9:16", [
|
|
make_slot("hook", 0, 3060, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("rising", 3060, 27200, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("payoff", 27200, 30600, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("cta", 30600, 34000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
"tutorial-howto": make_template(
|
|
"tutorial-howto", "tutorial", "9:16", [
|
|
make_slot("hook", 0, 4000, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("setup", 4000, 10000, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("rising", 10000, 42500, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("payoff", 42500, 46500, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("cta", 46500, 50000, caption_preset="karaoke_green", transition_out="cut"),
|
|
]),
|
|
"news-brief": make_template(
|
|
"news-brief", "news", "9:16", [
|
|
make_slot("hook", 0, 3500, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("setup", 3500, 9800, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("body", 9800, 28000, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("payoff", 28000, 32200, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("cta", 32200, 35000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"story-time": make_template(
|
|
"story-time", "story", "9:16", [
|
|
make_slot("hook", 0, 3600, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 3600, 11250, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("rising", 11250, 27000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("climax", 27000, 36000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("payoff", 36000, 41400, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 41400, 45000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"quote-motivation": make_template(
|
|
"quote-motivation", "motivation", "9:16", [
|
|
make_slot("hook", 0, 3300, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("rising", 3300, 14960, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("climax", 14960, 19360, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("cta", 19360, 22000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"countdown-ranking": make_template(
|
|
"countdown-ranking", "ranking", "9:16", [
|
|
make_slot("hook", 0, 3300, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("rising", 3300, 23760, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("climax", 23760, 29040, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 29040, 33000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"recipe-quick": make_template(
|
|
"recipe-quick", "food", "9:16", [
|
|
make_slot("hook", 0, 3000, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("setup", 3000, 7200, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("rising", 7200, 24600, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("payoff", 24600, 27600, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("cta", 27600, 30000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
"get-ready-with-me": make_template(
|
|
"get-ready-with-me", "lifestyle", "9:16", [
|
|
make_slot("hook", 0, 3600, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("setup", 3600, 10000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("body", 10000, 34000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
make_slot("cta", 34000, 40000, caption_preset="karaoke_yellow", transition_out="cut"),
|
|
]),
|
|
"day-in-the-life": make_template(
|
|
"day-in-the-life", "vlog", "9:16", [
|
|
make_slot("hook", 0, 3600, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("setup", 3600, 9900, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("body", 9900, 38700, caption_preset="clean_white", transition_out="cut"),
|
|
make_slot("cta", 38700, 45000, caption_preset="clean_white", transition_out="cut"),
|
|
]),
|
|
"street-interview": make_template(
|
|
"street-interview", "interview", "9:16", [
|
|
make_slot("hook", 0, 3800, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("rising", 3800, 30400, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("climax", 30400, 34200, caption_preset="karaoke_green", transition_out="cut"),
|
|
make_slot("cta", 34200, 38000, caption_preset="karaoke_green", transition_out="cut"),
|
|
]),
|
|
"meme-explainer": make_template(
|
|
"meme-explainer", "explainer", "9:16", [
|
|
make_slot("hook", 0, 2600, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("setup", 2600, 7280, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("body", 7280, 19500, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("payoff", 19500, 23400, caption_preset="bold_violet", transition_out="cut"),
|
|
make_slot("cta", 23400, 26000, caption_preset="bold_violet", transition_out="cut"),
|
|
]),
|
|
}
|
|
|
|
|
|
def get_preset(slug: str) -> dict[str, Any]:
|
|
if slug not in _PRESETS:
|
|
raise KeyError(f"unknown template preset {slug!r}")
|
|
return _PRESETS[slug]
|
|
|
|
|
|
def list_presets(genre: str | None = None) -> list[str]:
|
|
slugs = [s for s, t in _PRESETS.items() if genre is None or t["genre"] == genre]
|
|
return sorted(slugs)
|