@aicopycoders/exodus 2026.11.1100-beta.8 → 2026.11.1100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/assets/docs/CLAUDE.md +2 -0
  2. package/assets/docs/PIPELINES.md +2 -0
  3. package/assets/skills/exodus/SKILL.md +2 -0
  4. package/assets/skills/exodus-video/SKILL.md +8 -6
  5. package/assets/skills/exodus-video/scripts/first-cut.d.mts +5 -0
  6. package/assets/skills/exodus-video/scripts/first-cut.mjs +27 -6
  7. package/assets/skills/swipe/SKILL.md +1 -1
  8. package/assets/skills/timeline-ad-factory/AGENTS.md +8 -0
  9. package/assets/skills/timeline-ad-factory/README.md +38 -0
  10. package/assets/skills/timeline-ad-factory/SKILL.md +132 -0
  11. package/assets/skills/timeline-ad-factory/reference/00_hook_elements.md +71 -0
  12. package/assets/skills/timeline-ad-factory/reference/01_elements.md +53 -0
  13. package/assets/skills/timeline-ad-factory/reference/02_openers.md +83 -0
  14. package/assets/skills/timeline-ad-factory/reference/03_script_rules.md +83 -0
  15. package/assets/skills/timeline-ad-factory/reference/04_storyboard.md +153 -0
  16. package/assets/skills/timeline-ad-factory/reference/05_generation.md +57 -0
  17. package/assets/skills/timeline-ad-factory/scripts/assemble.py +86 -0
  18. package/assets/skills/timeline-ad-factory/scripts/contact_sheet.py +76 -0
  19. package/assets/skills/timeline-ad-factory/scripts/cost_report.py +25 -0
  20. package/assets/skills/timeline-ad-factory/scripts/gen_images.py +76 -0
  21. package/assets/skills/timeline-ad-factory/scripts/gen_music.py +36 -0
  22. package/assets/skills/timeline-ad-factory/scripts/gen_video.py +167 -0
  23. package/assets/skills/timeline-ad-factory/scripts/gen_vo.py +180 -0
  24. package/assets/skills/timeline-ad-factory/scripts/kie.py +168 -0
  25. package/assets/skills/timeline-ad-factory/scripts/review_clips.py +39 -0
  26. package/assets/skills/timeline-ad-factory/scripts/setup_check.py +54 -0
  27. package/assets/skills/timeline-ad-factory/scripts/voices.py +2 -0
  28. package/assets/skills/timeline-ad-factory/templates/project.json +38 -0
  29. package/assets/skills/ugc-ads/SKILL.md +32 -0
  30. package/assets/skills/ugc-ads/scripts/run.py +83 -0
  31. package/assets/skills/ugc-preproduction/SKILL.md +56 -0
  32. package/assets/skills/ugc-swipe/SKILL.md +34 -0
  33. package/assets/skills/ugc-template/SKILL.md +40 -0
  34. package/assets/skills/ugc-write/SKILL.md +33 -0
  35. package/dist/commands/video-swipe.d.ts +6 -2
  36. package/dist/commands/video-swipe.js +82 -12
  37. package/dist/commands/video.js +10 -2
  38. package/package.json +1 -1
@@ -0,0 +1,83 @@
1
+ # 03: Script rules
2
+
3
+ ## Why timeline ads work (keep this in mind while writing)
4
+
5
+ - **Imagined ownership:** the prospect pictures USING the product as a daily ritual and feeling the payoff. They're remembering a routine they haven't started. That's Cialdini's Consistency principle, weaponized: buying becomes staying consistent with the version of themselves they already watched.
6
+ - **They're a witness, not a judge:** the claims don't feel like claims because the viewer watches them happen.
7
+ - **Gradualization:** start with almost-nothing claims and climb. Every checkpoint earns permission for a bigger promise.
8
+ - **The skeptic beat buys trust:** saying "nothing happened on Day 1" validates their inner skeptic. 38% of winning ads do it.
9
+ - **A timeline is a serial:** every checkpoint opens a new loop and ends on momentum.
10
+
11
+ ## The milestone ladder (order matters)
12
+
13
+ Data from 277 winning positive timeline ads (RYZE, IM8, Resilia). Average position where each benefit first appears, 0 = first word after the hook, 1 = the moment the ad starts selling:
14
+
15
+ gut 0.35 / cravings 0.37 / felt bloat 0.39 / focus 0.40 / energy 0.40 / clothes fit 0.43 / visible face or body 0.44 / sleep 0.45 / other people notice 0.47 / identity 0.80 / a weight or lab number 0.80
16
+
17
+ So climb:
18
+ 1. **Skeptic beat / invisible changes.** Nothing felt, or work happening where they can't feel it. (64% of winners open Day 1 on "nothing" or invisible work. Only claim a felt Day 1 win in categories where fast is already believable: cravings, calm, hydration.)
19
+ 2. **A small, tangible win tied to a real moment in their day.** "You weren't buzzing, but you felt steady... by noon you realized you were still on your first cup of coffee."
20
+ 3. **Self-observation (behavior).** Something they DID or STOPPED doing. They can't doubt their own behavior.
21
+ 4. **Visible wins + social observation, together, mid-ad.** Belt notch, jeans buttoning, the mirror, and right on their heels, someone else notices (kills the "placebo" doubt).
22
+ 5. **Big numbers (if any) and identity, at the END.** The scale, the lab result, the doctor's chart. Then the identity/lifestyle scene. Many winners skip the number entirely.
23
+
24
+ **The AOV trick (results that compound):** the hook can say 14 or 30 days, but carry the milestones out to Month 2 and Month 3, and make each one BUILD on the last ("by month two, it's not just the stairs..." / "month three is when the people around you start asking"). If the best results land after the first bottle runs out, the viewer wants the 3-bottle bundle, not the single. Tie the offer to it: "Most people grab the 3-month supply, because month three is where it really comes together." Only use offer details the user gives you.
25
+
26
+ Spacing: DENSE early (Day 1, 3, 5, 7), sparse late (14, 30). Most winners run 3-7 milestones; 4 is the most common. Each checkpoint ends on momentum ("then things got interesting"), never a plateau.
27
+
28
+ ## Two mechanism layers
29
+
30
+ - **Layer 1, ingredient credit:** a short tag naming what's doing the work, attached to something happening TO the person. "Turkey tail feeds the good bacteria in your gut. The bloat settles." 74% of winners put this INSIDE the milestones.
31
+ - **Layer 2, full explanation:** what was really wrong, why other fixes failed, why this product fixes it. Only 16% of winners do this inside a milestone. Most put it in the hook, on Day 1, or AFTER the timeline.
32
+
33
+ Pick one structure and say which:
34
+ - **Option 1, embedded:** Layer 1 credits in the milestones, Layer 2 after.
35
+ - **Option 2, results first:** milestones are pure results, then the full explanation after (Aurivita's cold-feet ad).
36
+
37
+ Never let it sound like the brand lecturing mid-timeline.
38
+
39
+ ## Beat order (default)
40
+
41
+ 0. Frame + tease (who, the ritual, the timeline; optionally name the last stage as the prize)
42
+ 1. Day 1 (taste/ease, skeptic beat)
43
+ 2. Small wins (often framed as things that STOP)
44
+ 3. Feelings (+ ingredient credits if Option 1)
45
+ 4. Visible + social
46
+ 5. Identity / life scene
47
+ 6. Bridge + differentiator (the villain is the cheap knockoff or the wrong fix, never the viewer)
48
+ 7. The seal (one line that locks the ritual: "One cup every morning.")
49
+ 8. Proof (only REAL proof the user gives you)
50
+ 9. Offer + guarantee + urgency (only what the user gives you)
51
+
52
+ The timeline is ~75% of the script. The sale is the last quarter.
53
+
54
+ ## Line craft
55
+
56
+ - One spoken line per line. Write for the ear. Median 7-9 words.
57
+ - Micro-moments from THEIR real day (the 3pm crash, the snooze button, the stairs).
58
+ - The pronoun trick: third-person frame, then slide into "you" for the body.
59
+ - Name the ritual in the tense they'd use once they own it: "two softgels with breakfast."
60
+ - Hedge the claims: "starting to", "a lot of people notice", "might".
61
+ - **Pronunciation check:** list every product/industry word a voice could misread (softgels, CoQ10, ashwagandha, brand names) in `project.json` -> `pronounce` with a phonetic spelling, e.g. `"softgels": "soft jells"`, `"CoQ10": "co Q ten"`. The voice says the spelling; captions still show the real word.
62
+ - Numbers in the script are written as they should be SPOKEN ("thirty days", "twelve-hour shift") so the voice reads them right.
63
+
64
+ ## Banned
65
+
66
+ - Identity catchphrases: "There he is", "There she is", "You look like you again", "feel like yourself again". Show the scene instead (his wife reaches for his hand on the couch; he's on the floor building Legos with his grandson).
67
+ - AI tells: "here's the kicker", "here's the thing", "it's not X, it's Y" balanced flips, "game-changer", "unlock", "elevate", recap tags ("that's the whole game").
68
+ - Em-dashes (use a period, a comma or "...").
69
+ - Invented proof: fake results, fake reviews, fake doctors or credentials, user counts the user didn't give you.
70
+ - Big medical claims (cures, reverses, replaces medication). Flag them to the user instead.
71
+
72
+ ## Self-check (run before showing the script; list results)
73
+
74
+ 1. Does Day 1 promise almost nothing (or only a believable fast win)?
75
+ 2. Do the milestones climb in ladder order, with identity and any number at the end?
76
+ 3. Is every milestone a specific MOMENT, not a benefit word?
77
+ 4. Is there a witness?
78
+ 5. Is the mechanism placed per Option 1 or 2, and never as a mid-timeline lecture?
79
+ 6. Is every claim hedged and supported by the user's inputs?
80
+ 7. Any banned phrase, catchphrase, em-dash or invented proof? (must be zero)
81
+ 8. Do the results keep going past the hook's timeline into Month 2 and Month 3 (the AOV trick)?
82
+ 9. Every tricky product word has a `pronounce` entry?
83
+ 10. Word count and estimated runtime (words / 2.6 = seconds, roughly).
@@ -0,0 +1,153 @@
1
+ # 04: Storyboard
2
+
3
+ ## Voice casting
4
+
5
+ **Provider:** `voice.provider` = `kie` (default; uses the Kie key, voices each line separately and joins them) or `elevenlabs` (uses the user's own ELEVENLABS_API_KEY; one continuous read with exact word timing, slightly smoother delivery). The voice IDs below work on both.
6
+
7
+ Pick the voice that fits THIS script and market. Ask: who would the viewer trust telling this story? Match narrator gender to the story's POV when it's first person (a woman's Diary needs a woman's voice). Match age and energy to the avatar (a 60-year-old market wants a warm, grounded voice; a bro ad wants a younger, cockier one).
8
+
9
+ Voices available on Kie's ElevenLabs model. Use the NAME in `project.json` (`voice.name`); the script converts it to Kie's voice ID. Preview any voice in a browser: `https://static.aiquickdraw.com/elevenlabs/voice/<ID>.mp3`.
10
+
11
+ | Name | ID (for the preview link) |
12
+ |---|---|
13
+ | James | EkK5I93UQWFDigLMpZcX |
14
+ | Arabella | Z3R5wn05IrDiVCyEkUrK |
15
+ | Bradford | NNl6r8mD7vthiJatiJt1 |
16
+ | Xavier | YOq2y2Up4RgXP2HyXjE5 |
17
+ | Kuon | B8gJV1IhpuegLxdpXFOE |
18
+ | Monika Sogam | 2zRM7PkgwBPiau2jvVXc |
19
+ | Mark | 1SM7GgM6IMuvQlz2BwM3 |
20
+ | Adeline | 5l5f8iK3YPeGga21rQIX |
21
+ | Sam | scOwDtmlUjD3prqpp97I |
22
+ | Spuds Oxley | NOpBlnGInO9m6vDvFkFC |
23
+ | Eve | BZgkqPqms7Kj9ulSkVzn |
24
+ | Northern Terry | wo6udizrrtpIxWGp2qJk |
25
+ | British Football Announcer | gU0LNdkMOQCOrPrwtbee |
26
+ | Brock | DGzg6RaUqxGRTHSBjfgF |
27
+ | Nathan | x70vRnQBMBu4FAYhjJbO |
28
+ | Anika | Sm1seazb4gs7RSlUVw7c |
29
+ | Viraj | P1bg08DkjqiVEzOn76yG |
30
+ | Taksh | qDuRKMlYmrm8trt5QyBn |
31
+ | Horatius | qXpMhyvQqiRxWQs4qSSB |
32
+ | Liam | TX3LPaxmHKxFdv7VOQHJ |
33
+ | Callum | N2lVS1w4EtoT3dr4eOWO |
34
+ | Laura | FGY2WhTYpPnrIDTdsKH5 |
35
+ | Brittney | kPzsL2i3teMYv0FxEYQ6 |
36
+ | Mark 2 | UgBBYS2sOqTuMpoF3BR0 |
37
+ | Bella | hpp4J3VqNfWAUOO0d1Us |
38
+ | Brian | nPczCjzI2devNBz1zQrb |
39
+ | Hope | uYXf8XasLslADfZ2MB4u |
40
+ | Jeff | gs0tAILXbY5DNrJrsM6F |
41
+ | Jamahal | DTKMou8ccj1ZaWGBiotd |
42
+ | Finn | vBKc2FfBKJfcZNyEt1n6 |
43
+ | Tom | DYkrAHD8iwork3YSUBbs |
44
+ | Cassidy | 56AoDkrOh6qfVPDXZ7Pt |
45
+ | Addison 2.0 | eR40ATw9ArzDf9h3v7t7 |
46
+ | Jessica Anne Bogart | g6xIsTj2HwM6VR4iXFCw |
47
+ | Lucy | lcMyyd2HUfFzxdCaC4Ta |
48
+ | Tiffany | 6aDn1KB0hjpdcocrUkmq |
49
+ | Felix | Sq93GQT4X1lKDXsQcixO |
50
+ | Jessica Anne Bogart Villain | flHkNRp1BlvT73UL6gyz |
51
+ | Lutz | 9yzdeviXkFddZ4Oz8Mok |
52
+ | Emma | pPdl9cQBQq4p6mRkZy2Z |
53
+ | Edward | zYcjlYFOd3taleS0gkk3 |
54
+ | Marshal | nzeAacJi50IvxcyDnMXa |
55
+ | John Morgan | ruirxsoakN0GWmGNIo04 |
56
+ | Aria | TC0Zp7WVFzhA8zpTlRqV |
57
+ | Viking Bjorn | ljo9gAlSqKOvF6D8sOsX |
58
+ | Pirate Marshal | PPzYpIqttlTYA83688JI |
59
+ | Johnny Kid | 8JVbfL6oEdmuxKn5DK2C |
60
+ | Hope 2 | iCrDUkL56s3C8sCRl7wb |
61
+ | Ana Rita | wJqPPQ618aTW29mptyoc |
62
+ | John Doe | EiNlNiXeDU1pqqOPrYMO |
63
+ | Burt Reynolds | 4YYIPFl9wE5c4L2eu2Gb |
64
+ | Hank | 6F5Zhi321D3Oq7v1oNT4 |
65
+ | Wyatt | YXpFCvM1S3JbWEJhoskW |
66
+ | Phil | LG95yZDEHg6fCZdQjLqj |
67
+ | Johnny Dynamite | CeNX9CMwmxDxUF5Q2Inm |
68
+ | Rachel M | aD6riP1btT197c6dACmy |
69
+ | Rex Thunder | mtrellq69YZsNwzUSyXh |
70
+ | Ed | dHd5gvgSOzSfduK4CvEg |
71
+ | Jean | eVItLK1UvXctxuaRV2Oq |
72
+ | Britney | esy0r39YPLQjOczyOib8 |
73
+ | Sven | Tsns2HvNFKfGiNjllgqo |
74
+ | Viraj 2 | 1U02n4nD6AdIZ9CjF053 |
75
+ | Nathaniel | AeRdCCKzvd23BpJoofzx |
76
+ | Benjamin | LruHrtVF6PSyGItzMNHS |
77
+ | Allison | 1wGbFxmAM3Fgw63G1zZJ |
78
+ | Theodore HQ | hqfrgApggtO1785R4Fsn |
79
+ | Leon | MJ0RnG71ty4LH3dvNfSd |
80
+
81
+ If in doubt, render one line first: `python <skill>/scripts/gen_vo.py <project> --test-voice NAME`.
82
+
83
+ Give your pick + one backup + why. Settings that sounded human on our builds: stability 0.38 (lower = more expressive), similarity 0.8, style 0.4, speed 1.0. Store them in `project.json` under `voice`.
84
+
85
+ ## Character sheet (one image, generated once)
86
+
87
+ The character sheet is why the character looks the same in every shot. Rules:
88
+ - **Costume = a short list of NAMEABLE pieces** ("backwards mustard-yellow baseball cap, open teal bowling shirt over the bare ribcage, amber eyes, small silver chain"). Every later prompt repeats this exact list (`character.lock`). A model can match named pieces; it can't match a vibe.
89
+ - **6 poses = the emotional range the script needs** (exhausted, focused, celebrating, cocky, relaxed, shocked; adjust to the script).
90
+ - **Skulls stay PLAIN:** smooth ivory bone, no face paint, no sugar-skull or Day of the Dead markings. Painted skulls read as Pixar's Coco and get the video blocked as "protected IP".
91
+ - **"Charming not scary"** for skeletons and monsters. **"EXACTLY ONE [character] per pose"** stops twins.
92
+ - **Give the character the avatar's role** ("works as an ER nurse") so the market sees itself.
93
+ - Every recurring side character (spouse, boss, doctor, grandkid) gets its own reference sheet in `extra_cast`. Side characters drift more than the hero.
94
+
95
+ Sheet prompt template (fill the braces):
96
+ ```
97
+ {STYLE} character model sheet of ONE original {CHARACTER TYPE} character, {ROLE}. {APPEARANCE + COSTUME LOCK}.
98
+ A clean 3x2 grid of SIX full-body poses on a neutral warm-grey studio background: (1) {POSE} (2) {POSE} (3) {POSE}
99
+ (4) {POSE} (5) {POSE} (6) {POSE}. Big expression range, squash-and-stretch friendly, cinematic three-point lighting,
100
+ {STYLE} production quality, charming not scary. EXACTLY ONE {CHARACTER TYPE} per pose.
101
+ NO text, NO labels, NO numbers, NO watermarks, NO letters anywhere.
102
+ ```
103
+
104
+ ## The set
105
+
106
+ ONE fixed set description (`set`) reused in every shot unless a panel says otherwise. It does for locations what the sheet does for the character. Keep monitors, TVs, phones and papers ABSTRACT ("glowing with colorful abstract shapes, pictures only") and UNBRANDED. Screens showing scenes got frames refused as "protected IP" on Omni, and leaked fake words like "BOOM" onto others.
107
+
108
+ ## Shot plan
109
+
110
+ Group consecutive script lines into shots. Omni clips are 4/6/8/10 seconds, so aim for shots of ~4-10 seconds of voiceover (the scripts split anything longer automatically). Each shot in `project.json`:
111
+
112
+ ```json
113
+ {"id": 3, "label": "DAY 1",
114
+ "lines": ["Day one, nothing.", "He still grabs the railing on the stairs."],
115
+ "panels": ["The skeleton swallows two red softgels with his coffee at the kitchen counter, unimpressed",
116
+ "The skeleton grips the stair railing and hauls himself up one step at a time, wincing"],
117
+ "beats": [["0-3s", "He swallows two softgels with his coffee and shrugs"],
118
+ ["3-7s", "He grips the railing and hauls himself up the stairs, wincing"]]}
119
+ ```
120
+
121
+ - `lines` must be the EXACT lines from `script.txt`, in order, covering the whole script with no gaps and no repeats. The scripts use them to time each shot from the voiceover.
122
+ - `panels`: 1-3 visual sentences, in order. Each must literally DO its line (abstract line, concrete picture).
123
+ - `beats`: the same actions with rough time ranges inside the shot.
124
+
125
+ ## The Director Test (every panel, every clip)
126
+
127
+ Every frame must pass a detail-obsessed director with final say. Each panel description answers these, in words:
128
+ 1. **FACING:** what is each character facing? (A character watching a screen faces the screen. A character climbing stairs faces UP the stairs.)
129
+ 2. **DIRECTION OF TRAVEL + CAMERA:** which way are they moving, and where is the camera so the motion reads right? ("Walt climbs UP the stairs toward the camera; the camera is at the top of the staircase looking down at his face.") Never leave a moving character's direction implied.
130
+ 3. **HANDS:** what is in each hand? (Mug, banister, book, the kid's legs on a piggyback.)
131
+ 4. **BODY MECHANICS:** is the pose physically possible and natural? Weight on the right foot, knees bending the right way, the kid's weight actually supported, nobody floating.
132
+ 5. **LIGHT:** where is the light coming from? (Matches the time of day of the beat.)
133
+ 6. **CONTINUITY:** same costume, same set, same props as the shots around it.
134
+
135
+ When a new failure shows up in a finished ad, add the director question that would have caught it here.
136
+
137
+ ## Panel rules
138
+
139
+ - **Literal visual metaphor for every claim.** "His editor butchered his vision" = his jaw falls off and clatters on the desk. "One winner into five" = one film reel splits into five.
140
+ - **Comedy carries the pain.** A cartoon can take brutal hits and stay watchable.
141
+ - **Show a witness** for every big win; the viewer believes it because someone in the scene reacts.
142
+ - **Screens and papers show pictures only.** Never ask for words in the image.
143
+ - **Color tells the story.** Warm gold for the good timeline, cold blue for the bad one.
144
+ - **End on direct address:** the character turns to camera / points at the viewer under the end card.
145
+ - **Any panel NOT in the default set starts with its location** ("In the moonlit bedroom...", "On the sunny soccer field...", "At his office desk in a grey cubicle..."). Without it, the image model drifts back to the default set.
146
+ - **Use `panel_cast`** when a shot's panels show different characters (e.g. `"panel_cast": [["wife"], ["dad", "wife"]]`), so nobody appears in a frame they shouldn't be in.
147
+ - **Every panel names the character with the costume lock**, and keeps EXACTLY ONE of each character.
148
+
149
+ ## Date stamps and end card
150
+
151
+ `stamps`: the spoken words that trigger each big on-screen stamp, e.g. `{"say": "Day one", "label": "DAY 1"}`. The `say` text must appear in `script.txt`. Stamps pop in the instant the narrator says them.
152
+
153
+ `end_card`: up to 3 short lines (offer, guarantee, "Tap the link below"). Only what the user gives you.
@@ -0,0 +1,57 @@
1
+ # 05: Generation (models, costs, gotchas)
2
+
3
+ Everything runs through Kie.ai with ONE key. 1 Kie credit = $0.005. Prices change, so the scripts read real costs back from Kie (`creditsConsumed`) after every run.
4
+
5
+ ## Models used
6
+
7
+ | Job | Kie model | Notes |
8
+ |---|---|---|
9
+ | Character sheet | `gpt-image-2-text-to-image` | 16:9 grid of 6 poses |
10
+ | Storyboard panels | `gpt-image-2-image-to-image` | Character sheet(s) as reference; one image per panel, at the ad's aspect ratio |
11
+ | Voiceover (default) | `elevenlabs/text-to-speech-multilingual-v2` on Kie | Voiced line by line, measured, joined (Kie returns no word timestamps). Voice = Kie voice ID, picked by name. |
12
+ | Voiceover (option) | ElevenLabs API directly (`eleven_multilingual_v2` /with-timestamps) | User's own `ELEVENLABS_API_KEY`. One continuous read with exact word timing. Same voice IDs. |
13
+ | Video (DEFAULT) | `gemini-omni-video` (Google Omni) | Clips of 4/6/8/10s only. Panels go in as ordered reference images. |
14
+ | Video (upgrade) | `bytedance/seedance-2-5` | 5-15s clips. Panels are stitched into one horizontal strip used as a "shot list". |
15
+ | Music | Suno via `api/v1/generate` | Instrumental bed, trimmed and faded to length |
16
+
17
+ ## Omni first, Seedance for winners
18
+
19
+ Real A/B on the same 1:52 ad (same script, voice and storyboards; only the video model changed):
20
+ - Seedance 2.5 at 1080p: **$92.43**
21
+ - Seedance 2.5 at 720p: ~$37 (list price)
22
+ - Omni at 1080p: **$7.98**
23
+
24
+ Seedance moves a little better. Not 11x better. Test every new concept in Omni. Re-render a proven winner in Seedance only if the user wants more motion.
25
+
26
+ Omni per-clip cost (1080p, measured): 4s = 63 credits ($0.32), 6s = 84 ($0.42), 8s = 105 ($0.53), 10s = 126 ($0.63).
27
+
28
+ ## Omni prompt dialect
29
+
30
+ - **Positive language only.** Say what IS on screen ("the frame stays purely visual; screens show only colorful pictures"). Negative lists ("NO text, NO captions") prime the very artifact on Omni.
31
+ - **Ordered references:** "Image 1 shows the opening moment of this shot. Image 2 shows the final moment." Then the scene and timed beats.
32
+ - **Motion rider:** energetic continuous motion, every second has visible action, camera movement or a transformation; squash-and-stretch, anticipation and follow-through, weighty comic impacts.
33
+ - Omni adds its own audio. The scripts strip it.
34
+ - **"Protected or restricted IP" blocks come from the IMAGE, not the prompt** (tested: the same frame blocked with a one-line harmless prompt; the same prompt passed with a different frame). The usual trigger is a Pixar-style skeleton with painted sugar-skull / Day of the Dead face markings, which reads as Pixar's Coco. `gen_images.py` now forces plain, unpainted skulls on every frame, and `gen_video.py` automatically redraws any blocked frame (plain skull, wider framing) and retries. Failed tasks aren't charged.
35
+
36
+ ## Seedance prompt (riders that each kill one failure)
37
+
38
+ - R1 no text: video models love burning in fake subtitles.
39
+ - R2 shot list: "The reference image is a SHOT LIST showing the N frames you must render in sequence as ONE continuous scene. Do NOT render the frame gaps."
40
+ - MOTION: no static held frames longer than 0.5s.
41
+ - PHYSICS: squash-and-stretch, anticipation, follow-through.
42
+ - BEATS: timed actions.
43
+ - GLOBAL: same character design every shot, exactly one of each character, no letters on screens or papers.
44
+ Settings: audio OFF, duration = the VO window rounded up, 5-15s.
45
+
46
+ ## Gotchas we already paid for
47
+
48
+ - **Kie's voice model returns NO word timestamps** even with `timestamps: true`, and the `voice` field needs Kie's voice ID, not the name. `gen_vo.py` handles both.
49
+ - **Kie's voice service can go down** ("Internal Error, Please try again later" on every request, even one line). Finished lines are kept on re-run; with an ElevenLabs key the ad switches to ElevenLabs.
50
+
51
+ - **TTS spells out ALL-CAPS words.** `gen_vo.py` lowercases everything except a short acronym whitelist. Write numbers as spoken words in the script.
52
+ - **Captions can split number lists** ("SEVEN, / EIGHT AND NINE-FIGURE"). Avoid comma-separated numbers in the script.
53
+ - **Side characters drift more than the hero.** Give every recurring side character a reference sheet.
54
+ - **Brand logos sneak onto devices** (an Apple logo on an iMac). Add "unbranded" to every device in the set description.
55
+ - **Don't fix it in the edit.** Fix the panel or beats and re-render that one shot (`--only 5`).
56
+ - **Render everything in parallel.** Total wait = the slowest single clip, not all of them back to back.
57
+ - **Log every task ID.** `cost_report.py` turns them into a real dollar figure.
@@ -0,0 +1,86 @@
1
+ """Final assembly: fit every shot to its voiceover window, burn in captions + date stamps + end card, mix voice and music.
2
+ python scripts/assemble.py <project> -> <project>/final/ad.mp4 (+ ad_preview.mp4, small enough to send to a phone)
3
+ """
4
+ import json, os, re, subprocess, sys
5
+ import kie
6
+
7
+ root, P = kie.project(sys.argv[1])
8
+ SIZES = {"9:16": (1080, 1920), "16:9": (1920, 1080), "1:1": (1080, 1080), "4:5": (1080, 1350)}
9
+ W, H = SIZES.get(P.get("aspect_ratio", "9:16"), (1080, 1920))
10
+ FIN = os.path.join(root, "final"); os.makedirs(FIN, exist_ok=True)
11
+ VID = os.path.join(root, "videos")
12
+
13
+ def dur(p):
14
+ return float(subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", p],
15
+ capture_output=True, text=True).stdout.strip())
16
+
17
+ # 1) fit each shot to its VO window
18
+ parts = []
19
+ for s in P["shots"]:
20
+ src = os.path.join(VID, f"shot_{s['id']:02d}.mp4")
21
+ if not os.path.exists(src): raise SystemExit(f"Missing video for shot {s['id']}. Run gen_video.py --only {s['id']}")
22
+ w = s["t1"] - s["t0"]; f = w / dur(src); out = os.path.join(VID, f"fit_{s['id']:02d}.mp4")
23
+ subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", src, "-an", "-vf",
24
+ f"setpts={f:.5f}*PTS,scale={W}:{H}:force_original_aspect_ratio=increase,crop={W}:{H},fps=30,format=yuv420p",
25
+ "-t", f"{w:.3f}", "-c:v", "libx264", "-preset", "fast", "-crf", "18", out], check=True)
26
+ parts.append(out); print(f"shot {s['id']}: fitted to {w:.2f}s (speed x{1/f:.2f})")
27
+ open(os.path.join(VID, "concat.txt"), "w").write("".join(f"file '{os.path.basename(p)}'\n" for p in parts))
28
+ pic = os.path.join(FIN, "_picture.mp4")
29
+ subprocess.run(["ffmpeg", "-y", "-v", "error", "-f", "concat", "-safe", "0", "-i", os.path.join(VID, "concat.txt"), "-c", "copy", pic], check=True)
30
+ total = dur(pic)
31
+
32
+ # 2) captions, stamps, end card (ASS subtitles; the AI never renders text)
33
+ def ts(t):
34
+ t = max(t, 0); return f"{int(t//3600)}:{int(t%3600//60):02d}:{t%60:05.2f}"
35
+ words = json.load(open(os.path.join(root, "audio", "words.json"), encoding="utf-8"))
36
+ chunks, cc = [], []
37
+ for k, wd in enumerate(words):
38
+ cc.append(wd)
39
+ gap = words[k + 1]["s"] - wd["e"] if k + 1 < len(words) else 9
40
+ if len(cc) >= 4 or gap > 0.4 or wd["w"].endswith((".", ",", "?", "!", "...")):
41
+ chunks.append(cc); cc = []
42
+ if cc: chunks.append(cc)
43
+ cap, stamp, cta = int(H * 0.04), int(H * 0.075), int(H * 0.045)
44
+ marg = int(H * 0.22) if H > W else int(H * 0.07) # keep vertical captions above the feed's UI
45
+ L = ["[Script Info]", f"PlayResX: {W}", f"PlayResY: {H}", "WrapStyle: 0", "", "[V4+ Styles]",
46
+ "Format: Name, Fontname, Fontsize, PrimaryColour, OutlineColour, BackColour, Bold, Outline, Shadow, Alignment, MarginL, MarginR, MarginV",
47
+ f"Style: Cap,Arial Black,{cap},&H00FFFFFF,&H00101010,&H96000000,-1,6,0,2,60,60,{marg}",
48
+ f"Style: Stamp,Arial Black,{stamp},&H0016C8F5,&H00101010,&H96000000,-1,9,3,8,60,60,{int(H*0.12)}",
49
+ f"Style: CTA,Arial Black,{cta},&H0016C8F5,&H00101010,&HC8000000,-1,6,0,5,70,70,0",
50
+ "", "[Events]", "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"]
51
+ end_lines = [x for x in P.get("end_card", []) if x]
52
+ end_t = total - 3.5 if end_lines else total + 1
53
+ for k, c in enumerate(chunks):
54
+ t0 = c[0]["s"]; t1 = c[-1]["e"] + 0.1
55
+ if k + 1 < len(chunks): t1 = min(t1, chunks[k + 1][0]["s"] - 0.01)
56
+ if t0 >= end_t: continue
57
+ txt = " ".join(w["w"] for w in c).upper().replace("{", "").replace("}", "")
58
+ for w, say in P.get("pronounce", {}).items(): # captions show the real word, not the phonetic spelling
59
+ txt = re.sub(r"(?i)" + re.escape(say) + r"", w.upper(), txt)
60
+ L.append(f"Dialogue: 0,{ts(t0)},{ts(min(t1, end_t))},Cap,,0,0,0,,{txt}")
61
+ for st in P.get("stamps", []):
62
+ if st.get("at") is None: continue
63
+ L.append(f"Dialogue: 1,{ts(st['at']-0.15)},{ts(st['at']+2.8)},Stamp,,0,0,0,,"
64
+ f"{{\\fad(120,300)\\t(0,180,\\fscx118\\fscy118)\\t(180,360,\\fscx100\\fscy100)}}{st['label']}")
65
+ if end_lines:
66
+ body = "\\N".join(x.upper() if i == 0 else "{\\c&HFFFFFF&}" + x for i, x in enumerate(end_lines))
67
+ L.append(f"Dialogue: 2,{ts(end_t)},{ts(total)},CTA,,0,0,0,,{{\\fad(300,0)}}{body}")
68
+ open(os.path.join(FIN, "captions.ass"), "w", encoding="utf-8").write("\n".join(L))
69
+
70
+ # 3) mix + burn (run inside the final folder so the subtitles path has no drive letters to escape)
71
+ music = os.path.join(root, "audio", "music.mp3")
72
+ inputs = ["-i", "_picture.mp4", "-i", os.path.join(root, "audio", "vo.mp3")]
73
+ fc = ["[1:a]volume=1.0[v]"]; labels = ["[v]"]
74
+ if os.path.exists(music):
75
+ inputs += ["-stream_loop", "-1", "-i", music]
76
+ fc.append(f"[2:a]volume=-17dB,afade=t=in:d=1,afade=t=out:st={max(total-3,0):.2f}:d=3[m]"); labels.append("[m]")
77
+ fc.append("[0:v]subtitles=captions.ass[vout]")
78
+ fc.append("".join(labels) + f"amix=inputs={len(labels)}:normalize=0,alimiter=limit=0.95[aout]")
79
+ subprocess.run(["ffmpeg", "-y", "-v", "error", *inputs, "-filter_complex", ";".join(fc), "-map", "[vout]", "-map", "[aout]",
80
+ "-c:v", "libx264", "-preset", "medium", "-crf", "19", "-c:a", "aac", "-b:a", "192k", "-t", f"{total:.2f}", "ad.mp4"],
81
+ check=True, cwd=FIN)
82
+ subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", "ad.mp4", "-vf", ("scale=720:-2" if H > W else "scale=1280:-2"), "-c:v", "libx264",
83
+ "-preset", "veryfast", "-crf", "27", "-c:a", "aac", "-b:a", "128k", "ad_preview.mp4"], check=True, cwd=FIN)
84
+ print(f"Final ad: {os.path.join(FIN, 'ad.mp4')} ({total:.1f}s)")
85
+ print(f"Phone preview: {os.path.join(FIN, 'ad_preview.mp4')}")
86
+ print("Next: python scripts/contact_sheet.py " + sys.argv[1] + " --final and python scripts/cost_report.py " + sys.argv[1])
@@ -0,0 +1,76 @@
1
+ """Storyboard review board for the approval gate: every frame next to the voiceover line it has to act out.
2
+ python scripts/contact_sheet.py <project> -> <project>/storyboard_board.jpg (+ storyboard_board.html)
3
+ python scripts/contact_sheet.py <project> --final -> frames from the finished ad, <project>/final_sheet.jpg
4
+ Show the board to the user BEFORE any video is generated. Judge each frame: does the picture literally DO its line?
5
+ """
6
+ import html, json, os, subprocess, sys, textwrap
7
+ from PIL import Image, ImageDraw, ImageFont
8
+
9
+ root = os.path.abspath(sys.argv[1]); final = "--final" in sys.argv
10
+ _cwd, _root = (os.path.normcase(os.path.realpath(x)) for x in (os.getcwd(), root))
11
+ try: _ok = os.path.commonpath([_cwd, _root]) == _cwd
12
+ except ValueError: _ok = False
13
+ if not _ok: raise SystemExit("The project folder has to be inside the folder you're working in, e.g. projects/<name>.")
14
+ if final:
15
+ src = os.path.join(root, "final", "ad.mp4"); out = os.path.join(root, "final_sheet.jpg")
16
+ subprocess.run(["ffmpeg", "-y", "-v", "error", "-i", src, "-vf", "fps=1/3,scale=320:-2,tile=6x6", "-frames:v", "1", out], check=True)
17
+ print(out); raise SystemExit
18
+
19
+ P = json.load(open(os.path.join(root, "project.json"), encoding="utf-8"))
20
+ def font(sz, bold=False):
21
+ for f in (("arialbd.ttf" if bold else "arial.ttf"), ("Arial Bold.ttf" if bold else "Arial.ttf"), "DejaVuSans-Bold.ttf" if bold else "DejaVuSans.ttf"):
22
+ try: return ImageFont.truetype(f, sz)
23
+ except Exception: pass
24
+ return ImageFont.load_default()
25
+ F_H, F_T, F_S = font(26, True), font(20), font(17)
26
+ TW = 240 # thumbnail width
27
+ rows = []
28
+ for s in P["shots"]:
29
+ ims = []
30
+ for i in range(len(s["panels"])):
31
+ p = os.path.join(root, "images", "panels", f"shot_{s['id']:02d}_p{i+1}.png")
32
+ if os.path.exists(p):
33
+ im = Image.open(p).convert("RGB"); im = im.resize((TW, int(im.height * TW / im.width))); ims.append((i + 1, im))
34
+ rows.append((s, ims))
35
+
36
+ W = 1500; pad = 20; text_x = pad + 3 * (TW + 12) + 10
37
+ blocks = []
38
+ for s, ims in rows:
39
+ h_img = max([im.height for _, im in ims] or [200]) + 30
40
+ lines = "\n".join(f"“{l}”" for l in s["lines"])
41
+ wrapped = []
42
+ for para in lines.split("\n"): wrapped += textwrap.wrap(para, 62) or [""]
43
+ pw = []
44
+ for k, ptxt in enumerate(s["panels"]): pw += textwrap.wrap(f"Panel {k+1}: {ptxt}", 80)
45
+ h_txt = 40 + 26 * len(wrapped) + 12 + 21 * len(pw)
46
+ blocks.append((s, ims, wrapped, pw, max(h_img, h_txt) + pad))
47
+ H = sum(b[-1] for b in blocks) + pad
48
+ S = Image.new("RGB", (W, H), (22, 18, 14)); d = ImageDraw.Draw(S); y = pad
49
+ for s, ims, wrapped, pw, h in blocks:
50
+ d.rectangle([pad // 2, y - 6, W - pad // 2, y + h - pad + 2], outline=(70, 60, 48))
51
+ x = pad
52
+ for k, im in ims:
53
+ S.paste(im, (x, y + 24)); d.text((x, y), f"panel {k}", font=F_S, fill=(246, 198, 82)); x += TW + 12
54
+ stamp = next((st["label"] for st in P.get("stamps", []) if st.get("say", "").lower() in " ".join(s["lines"]).lower()), "")
55
+ d.text((text_x, y), f"SHOT {s['id']} {s.get('label','')}" + (f" [stamp: {stamp}]" if stamp else ""), font=F_H, fill=(246, 198, 82))
56
+ ty = y + 40
57
+ for w in wrapped: d.text((text_x, ty), w, font=F_T, fill=(255, 255, 255)); ty += 26
58
+ ty += 12
59
+ for w in pw: d.text((text_x, ty), w, font=F_S, fill=(185, 173, 152)); ty += 21
60
+ y += h
61
+ out = os.path.join(root, "storyboard_board.jpg"); S.save(out, quality=85)
62
+
63
+ # Same board as a scrollable web page (bigger images, easy to review on any screen)
64
+ cards = []
65
+ for s, ims in rows:
66
+ imgs = "".join(f'<img src="images/panels/shot_{s["id"]:02d}_p{k}.png">' for k, _ in ims)
67
+ cards.append(f'<div class="c"><div class="im">{imgs}</div><div class="tx"><h3>Shot {s["id"]} &middot; {html.escape(s.get("label",""))}</h3>'
68
+ + "".join(f'<p class="vo">&ldquo;{html.escape(l)}&rdquo;</p>' for l in s["lines"])
69
+ + "".join(f'<p class="pn">Panel {k+1}: {html.escape(t)}</p>' for k, t in enumerate(s["panels"])) + "</div></div>")
70
+ open(os.path.join(root, "storyboard_board.html"), "w", encoding="utf-8").write(
71
+ "<!doctype html><meta charset='utf-8'><title>Storyboard</title><style>body{background:#16120e;color:#f4eede;font:16px Arial;margin:20px}"
72
+ ".c{display:flex;gap:18px;border:1px solid #463c30;padding:14px;margin:0 0 16px}.im{display:flex;gap:8px}.im img{height:340px;border-radius:4px}"
73
+ "h3{color:#f6c652;margin:0 0 8px}.vo{font-size:20px;font-weight:bold;margin:4px 0}.pn{color:#b9ad98;font-size:14px}</style>"
74
+ f"<h1>{html.escape(P.get('name','Storyboard'))}: storyboard</h1><p>Does every frame literally DO its line? Name any frame to redo as shot.panel (e.g. 3.1).</p>"
75
+ + "".join(cards))
76
+ print(out); print(os.path.join(root, "storyboard_board.html"))
@@ -0,0 +1,25 @@
1
+ """Real cost of everything this project generated, read back from Kie (creditsConsumed). 1 credit = $0.005.
2
+ python scripts/cost_report.py <project>
3
+ """
4
+ import collections, json, os, sys
5
+ import kie
6
+
7
+ root, P = kie.project(sys.argv[1])
8
+ log = os.path.join(root, "tasks.log")
9
+ if not os.path.exists(log): raise SystemExit("No tasks logged yet.")
10
+ rows = [json.loads(l) for l in open(log, encoding="utf-8") if l.strip()]
11
+ by = collections.defaultdict(float); unknown = 0
12
+ for r in rows:
13
+ if r["kind"] == "suno": unknown += 1; continue # Suno uses a different endpoint; ~$0.10 or less per song
14
+ try:
15
+ d = kie.record(r["task"]); c = float(d.get("creditsConsumed") or 0)
16
+ by[r["kind"]] += c
17
+ except Exception:
18
+ unknown += 1
19
+ total = sum(by.values())
20
+ print(f"{'model':<45} {'credits':>9} {'USD':>8}")
21
+ for k, c in sorted(by.items(), key=lambda x: -x[1]):
22
+ print(f"{k:<45} {c:9.0f} {c*0.005:8.2f}")
23
+ print(f"{'TOTAL':<45} {total:9.0f} {total*0.005:8.2f}")
24
+ if unknown: print(f"({unknown} task(s) not priced here, e.g. Suno music, which is a few cents.)")
25
+ P["cost_usd"] = round(total * 0.005, 2); kie.save(root, P)
@@ -0,0 +1,76 @@
1
+ """Character sheets and storyboard panels via GPT-Image-2 on Kie.
2
+ python scripts/gen_images.py <project> --sheet [--only hero,wife] (re-runs: delete the png to regenerate)
3
+ python scripts/gen_images.py <project> --panels [--only 3,7] (each panel = its own image at the ad's aspect ratio)
4
+ python scripts/gen_images.py <project> --panels --only 3.1,9.2 (redo single panels: shot.panel)
5
+ Per-panel cast: a shot can set "panel_cast": [["wife"], ["dad","wife"]] so only those characters appear in each panel.
6
+ """
7
+ import argparse, os, threading, time
8
+ import kie
9
+
10
+ ap = argparse.ArgumentParser(); ap.add_argument("project"); ap.add_argument("--sheet", action="store_true")
11
+ ap.add_argument("--panels", action="store_true"); ap.add_argument("--only", default=""); ap.add_argument("--wider", action="store_true", help="redraw as a medium-wide shot (used after a copyright block)")
12
+ a = ap.parse_args()
13
+ root, P = kie.project(a.project)
14
+ only = [x.strip() for x in a.only.split(",") if x.strip()]
15
+ os.makedirs(os.path.join(root, "images", "panels"), exist_ok=True)
16
+ lock = threading.Lock()
17
+ def log(*x):
18
+ with lock: print(*x, flush=True)
19
+
20
+ CLEAN = "NO text, NO labels, NO letters, NO numbers, NO watermarks, NO subtitles anywhere; screens and papers show only colorful abstract pictures."
21
+ # Omni's copyright filter blocks frames that look like Pixar's Coco (skeleton + painted sugar-skull face). Keep every skull plain.
22
+ ORIGINAL = ("An ORIGINAL character design: every skull is plain, smooth ivory bone with NO face paint, NO sugar-skull or Day of the Dead "
23
+ "markings, NO decorative patterns or flowers on the bones. ")
24
+
25
+ def cast_all():
26
+ return [P["character"]] + [c for c in P.get("extra_cast", []) if c.get("lock")]
27
+
28
+ def sheet_path(name):
29
+ if any(ch in name for ch in '/\\:*?"<>|'): raise SystemExit(f"Character name '{name}' can't contain / \\ : * ? \" < > | (it becomes a file name).")
30
+ return os.path.join(root, "images", f"sheet_{name}.png")
31
+
32
+ def make_sheet(c):
33
+ out = sheet_path(c["name"])
34
+ if os.path.exists(out): log(f"[sheet {c['name']}] exists, skipping (delete it to redo)"); return
35
+ prompt = ORIGINAL + (c.get("sheet_prompt") or (f"{P['style']} character model sheet of ONE original character: {c['lock']}. "
36
+ "A clean 3x2 grid of SIX full-body poses with a big expression range on a neutral warm-grey studio background. "
37
+ "Cinematic three-point lighting, charming not scary, EXACTLY ONE character per pose. " + CLEAN))
38
+ tid = kie.create("gpt-image-2-text-to-image", {"prompt": prompt, "aspect_ratio": "16:9"}, note=f"sheet {c['name']}")
39
+ kie.download(kie.first_url(kie.wait(tid, 600, 5)), out); log(f"[sheet {c['name']}] done -> {out}")
40
+
41
+ def make_panel(s, i, text, urls):
42
+ out = os.path.join(root, "images", "panels", f"shot_{s['id']:02d}_p{i+1}.png")
43
+ if only and str(s["id"]) not in only and f"{s['id']}.{i+1}" not in only: return
44
+ if os.path.exists(out) and not only: return
45
+ pc = s.get("panel_cast", [])
46
+ names = pc[i] if i < len(pc) and pc[i] else s.get("cast", [P["character"]["name"]])
47
+ who = " ".join(f"The {c['name']} is {c['lock']}, matching its reference sheet EXACTLY." for c in cast_all() if c["name"] in names)
48
+ who += " Only these characters appear in this frame."
49
+ prompt = (f"A single cinematic {P['style']} movie still. {ORIGINAL}{who} Unless described otherwise the setting is {P['set']}. "
50
+ f"SCENE (follow the location described here over the default setting): {text}. " + ("Frame it as a MEDIUM-WIDE shot with the characters smaller in frame. " if a.wider else "") + "Big readable cartoon acting, one clear moment. EXACTLY ONE of each character. Body mechanics are physically correct: every character faces the direction they are moving, weight is on the feet, knees and elbows bend naturally, nothing floats. {CLEAN}")
51
+ for t in range(3):
52
+ try:
53
+ tid = kie.create("gpt-image-2-image-to-image", {"prompt": prompt, "image_urls": urls, "aspect_ratio": P.get("aspect_ratio", "9:16")},
54
+ note=f"panel {s['id']}.{i+1}")
55
+ kie.download(kie.first_url(kie.wait(tid, 600, 5)), out); log(f"[shot {s['id']} panel {i+1}] done"); return
56
+ except Exception as e:
57
+ log(f"[shot {s['id']} panel {i+1}] retry {t}: {e}"); time.sleep(8)
58
+ log(f"[shot {s['id']} panel {i+1}] FAILED")
59
+
60
+ for c in cast_all(): sheet_path(c["name"]) # check every name before anything is bought
61
+ if a.sheet:
62
+ ths = [threading.Thread(target=make_sheet, args=(c,)) for c in cast_all() if not only or c["name"] in only]
63
+ [t.start() for t in ths]; [t.join() for t in ths]
64
+
65
+ if a.panels:
66
+ missing = [c["name"] for c in cast_all() if not os.path.exists(sheet_path(c["name"]))]
67
+ if missing: raise SystemExit(f"Make and approve the character sheet(s) first: {missing}")
68
+ sheet_urls = {c["name"]: kie.upload(sheet_path(c["name"])) for c in cast_all()}
69
+ ths = []
70
+ for s in P["shots"]:
71
+ if only and str(s["id"]) not in only and not any(o.startswith(f"{s['id']}.") for o in only): continue
72
+ urls = [sheet_urls[n] for n in s.get("cast", [P["character"]["name"]]) if n in sheet_urls] or [sheet_urls[P["character"]["name"]]]
73
+ for i, text in enumerate(s["panels"]):
74
+ t = threading.Thread(target=make_panel, args=(s, i, text, urls)); t.start(); ths.append(t); time.sleep(1)
75
+ [t.join() for t in ths]
76
+ log("panels done. Next: python scripts/contact_sheet.py " + a.project)
@@ -0,0 +1,36 @@
1
+ """Instrumental music bed through Suno on Kie. Optional, but it lifts the ad a lot.
2
+ python scripts/gen_music.py <project>
3
+ Reads project.json "music": {"style": "...", "title": "..."}. If missing, builds a default from the ad's style.
4
+ Write the style as an emotional ARC that follows the script, e.g.
5
+ "playful animated-film score, mischievous pizzicato intro, building bouncy momentum, triumphant brass swagger, warm tender moment near the end, bold final hit"
6
+ Saves two takes to audio/ and picks take 1 as audio/music.mp3 (swap it if take 2 is better).
7
+ """
8
+ import json, os, shutil, sys, time, urllib.request
9
+ import kie
10
+
11
+ root, P = kie.project(sys.argv[1])
12
+ if "--estimate" in sys.argv[2:]:
13
+ raise SystemExit("gen_music.py has no --estimate: it spends when run (Suno through Kie, about $0.10 or less per song).")
14
+ m = P.get("music") or {}
15
+ style = m.get("style") or ("upbeat playful animated-film score for a Pixar-style comedy ad, curious intro, building momentum, "
16
+ "triumphant swagger, short warm moment, bold final hit, instrumental only")
17
+ body = {"customMode": True, "instrumental": True, "style": style[:950], "title": (m.get("title") or P.get("name", "Timeline Ad"))[:80],
18
+ "model": "V5", "negativeTags": "vocals, singing, choir, rap", "callBackUrl": "https://example.com/callback"}
19
+ j = kie._req("https://api.kie.ai/api/v1/generate", body)
20
+ if j.get("code") != 200:
21
+ body["model"] = "V4_5PLUS"; j = kie._req("https://api.kie.ai/api/v1/generate", body)
22
+ if j.get("code") != 200: raise SystemExit(f"Suno request failed: {j}")
23
+ tid = j["data"]["taskId"]; kie._log("suno", tid, "music")
24
+ os.makedirs(os.path.join(root, "audio"), exist_ok=True)
25
+ for _ in range(90):
26
+ time.sleep(10)
27
+ d = kie._req(f"https://api.kie.ai/api/v1/generate/record-info?taskId={tid}")["data"]
28
+ st = d.get("status") or ""
29
+ print(st, flush=True)
30
+ if st == "SUCCESS":
31
+ outs = []
32
+ for i, s in enumerate(d["response"]["sunoData"]):
33
+ o = os.path.join(root, "audio", f"music_take{i+1}.mp3"); kie.download(s["audioUrl"], o); outs.append(o)
34
+ shutil.copy(outs[0], os.path.join(root, "audio", "music.mp3"))
35
+ print("Saved:", *outs, sep="\n "); print("Using take 1 as audio/music.mp3"); break
36
+ if "FAIL" in st or "ERROR" in st: raise SystemExit(f"Suno failed: {d}")