File size: 3,186 Bytes
b12e499
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""
Legacy promptkit module for EceMotion Pictures.
Maintained for backward compatibility.
"""

from dataclasses import dataclass
from typing import Dict, List
import random

TAGLINES = [
    "So retro, it's the future.",
    "Pixels you can trust.",
    "VHS vibes. Modern results.",
    "Old-school cool. New-school sales.",
    "EceMotion Pictures - Bringing the '80s back to life.",
    "Your story, our vision, timeless memories.",
]

VOICE_STYLES = {
    "Announcer '80s": "A confident, upbeat 1980s TV announcer with warm AM-radio tone.",
    "Mall PA": "Casual, slightly echoey mall public-address vibe.",
    "Late Night": "Low energy, sly late-night infomercial style.",
    "News Anchor": "Professional, authoritative news anchor delivery.",
    "Infomercial": "Enthusiastic, persuasive infomercial host style.",
    "Radio DJ": "Smooth, charismatic radio disc jockey voice.",
}

STRUCTURE_TEMPLATES = [
    "Montage → Close-up → Logo stinger",
    "Before/After → Feature highlight → CTA",
    "Testimonial → B-roll → Price tag reveal",
    "Unboxing → Demo → Deal countdown",
    "Retro news bulletin → Product shot → Tagline",
    "Opening hook → Problem/Solution → Call to action",
    "Brand story → Product showcase → Final tagline",
]

@dataclass
class AdPlan:
    brand: str
    structure: str
    script_prompt: str
    duration: int
    voice_style: str
    seed: int

    def script(self) -> Dict[str, str]:
        random.seed(self.seed)
        tl = random.choice(TAGLINES)
        structure = self.structure.strip() or random.choice(STRUCTURE_TEMPLATES)
        # 4-beat VO using structure + script prompt
        beats = [
            f"HOOK: {self.brand}{self.script_prompt}",
            f"FLOW: {structure}",
            "BENEFIT: Faster, simpler, cooler — like your favorite retro tech.",
            f"CTA: Try {self.brand} today. {tl}",
        ]
        vo = " ".join([b.split(': ',1)[1] for b in beats])
        return {"lines": beats, "voiceover": vo, "tagline": tl}

def suggest_scripts(structure_prompt: str, n: int = 6, seed: int = 0) -> List[str]:
    """Return n short script ideas correlated with the structure prompt."""
    random.seed(seed)
    base = (structure_prompt or "").lower().strip()
    ideas = []
    for _ in range(n):
        style = random.choice(["infomercial", "mall ad", "late-night", "newsflash", "arcade bumper"])
        shot = random.choice(["neon grid", "CRT scanlines", "vaporwave sunset", "shopping mall", "boombox close-up"])
        hook = random.choice([
            "Remember this sound?", "Back to '87.", "Deal of the decade.", "We paused time.", "Be kind, rewind your brand.",
        ])
        idea = f"{hook} {style} with {shot}."
        # Light correlation: echo key words from structure prompt
        for kw in ["montage","testimonial","news","unboxing","before","after","countdown","logo","cta"]:
            if kw in base and kw not in idea:
                idea += f" Includes {kw}."
        ideas.append(idea)
    return ideas

def roll_script(structure_prompt: str, seed: int = 0) -> str:
    return random.choice(suggest_scripts(structure_prompt, n=6, seed=seed))