Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.
TypeScript ai-photo-editorcomfyui-alternativegenerative-fillimage-editingimage-generationinpaintinglinuxlocal-aimacosmcpmcp-servernano-banana-alternativeofflinephoto-editorprivacyqwen-imageqwen-image-2-1stable-diffusion-cppvulkanwindows
Video: "use cases" (UseCases, UseCasesHouse4), work in progress
Gabriele Lozuponeb2720e92d61e
diff --git a/marketing/README.md b/marketing/README.mdindex b70a59b..f7ceff0 100644--- a/marketing/README.md+++ b/marketing/README.md@@ -50,6 +50,34 @@ D:/AI/tts/.venv/Scripts/python audio/gen_voice.py build --from audio/voice/updatnpx remotion render Update010 out/kokon-0.10-update.mp4 # in video/, 1920×1080```+**"Use cases" video** (`UseCases`, ~87 s, English, narrated, for the site and YouTube): it opens+on why Kokon (private, unlimited), then thirteen everyday edits (photobombers removed, a blink+fixed, an old photo restored and coloured, a missing person added, a haircut and a jacket tried on,+a room tidied, a home redone, a headshot, an invitation with text), each shown as the before photo,+the prompt typed into the prompt box (the app's `.composer` markup and styles), a wipe to the after+landing on the spoken word, and a caption. Every image was made with Kokon (`public/img/usecases/`,+web copies of `%USERPROFILE%\Pictures\Kokon\use-cases-2k`); the video says so on screen. No camera+moves: hard cuts on the beat, wipes and type. Its clock is `src/app/timelineUseCases.ts` (beat+lengths, moods, where each voice line starts, the word each wipe lands on), its scene+`src/scenes/UseCases.tsx`, its script `audio/voiceover-usecases.md`: one narrator with a tone per+section, the launch voice on Chatterbox, and Chatterbox Turbo cloned from it for the playful lines+(with its `[chuckle]` and `[happy]` tags). The music is one ACE-Step track with a calm piano part,+cut on bar lines so that part covers the serious beats and the groove returns on the flamingo. The+YouTube thumbnail is `UseCasesThumb`.++```powershell+D:/AI/tts/.venv/Scripts/python audio/gen_voice.py audition-usecases --seeds 4 # voice/usecases/audition-<stamp>+D:/AI/tts/.venv/Scripts/python audio/gen_voice.py build-usecases --from audio/voice/usecases/audition-<stamp> --pick 1.0:14,...+python audio/gen_music.py usecases # takes/usecases-<stamp>-N.wav (ACE-Step API running)+D:/AI/tts/.venv/Scripts/python audio/make_update_music.py usecases # video/public/music-usecases.m4a+python audio/make_sfx.py pop swipe deep # only this video's effects+npx remotion render UseCases out/usecases-1.mp4 # in video/, 1920×1080+npx remotion still UseCasesThumb out/usecases-thumb.png # 1280×720+```++The word each wipe lands on comes from `src/app/voice-usecases-words.json` (Whisper word times of+the built lines, whisper-small.en): regenerate it after a new build.+`src/app/timeline.ts` is the film's clock: scene lengths, the frame where each voice-over sentenceplays, the frames of the actions the voice names (Remove, Add, the montage cuts) and the music'sbeat grid. Retime there and pictures, voice and music move together.diff --git a/marketing/audio/gen_music.py b/marketing/audio/gen_music.pyindex 8b31766..5c5786a 100644--- a/marketing/audio/gen_music.py+++ b/marketing/audio/gen_music.py@@ -49,8 +49,40 @@ STYLES = {118,"A Minor",),+ # The "use cases" video (~88 s, with voice): one track whose sections follow the video, playful+ # at the start, a quiet piano part in the middle (grandparents, privacy, kids), the groove back+ # for the second half, a clean ending. The sections come from structure tags (STRUCTURE).+ "usecases": (+ "instrumental, no vocals, feel-good upbeat indie pop, warm electric piano, clean funky guitar, "+ "bouncy bass, crisp claps and tight drums, playful and bright; a soft heartfelt solo piano "+ "breakdown in the middle with the drums out; then the full groove returns; clean definite "+ "ending, modern clean mix, sits under a voice-over",+ 116,+ "D Major",+ ),+}+# Lyrics as a map of the sections (no words): ACE-Step plans energy and dynamics from the tags.+STRUCTURE = {+ "usecases": "\n\n".join([+ "[Intro - upbeat, drums from the first bar]",+ "[Verse - playful groove, full band]",+ "[Breakdown - soft solo piano and warm pads, no drums, tender]",+ "[Piano Interlude - gentle, emotional]",+ "[Build - drums come back]",+ "[Chorus - full playful groove, bright]",+ "[Chorus - full playful groove, bright]",+ "[Outro - clean definite ending]",+ ]),+}+DURATIONS = {"update": 44, "usecases": 94}+# New versions of an existing take (ACE-Step "cover": same tempo, harmony and form, new notes and+# sounds). name: (style whose prompt describes it, source take, cover strength: near 1 stays close).+# The source is the launch film's house-4, which lives in the main clone's takes/ folder.+LAUNCH_TAKES = Path("C:/AI/qwen-local-studio/marketing/audio/takes")+COVERS = {+ "house4-cover": ("house", LAUNCH_TAKES / "house-4.wav", 0.9),+ "house4-cover-loose": ("house", LAUNCH_TAKES / "house-4.wav", 0.75),}-DURATIONS = {"update": 44}def call(path: str, body: dict | None = None) -> dict:@@ -62,11 +94,29 @@ def call(path: str, body: dict | None = None) -> dict:return resp["data"]+def call_with_file(path: str, fields: dict, field: str, file: Path) -> dict:+ """A multipart request: the API takes source audio only as an upload, never as a local path."""+ boundary = f"----kokon{int(time.time() * 1000)}"+ parts = []+ for k, v in fields.items():+ v = json.dumps(v) if isinstance(v, bool) else str(v)+ parts.append(f'--{boundary}\r\nContent-Disposition: form-data; name="{k}"\r\n\r\n{v}\r\n'.encode())+ parts.append(f'--{boundary}\r\nContent-Disposition: form-data; name="{field}"; filename="{file.name}"\r\nContent-Type: audio/wav\r\n\r\n'.encode())+ parts += [file.read_bytes(), f"\r\n--{boundary}--\r\n".encode()]+ req = urllib.request.Request(API + path, data=b"".join(parts), headers={"Content-Type": f"multipart/form-data; boundary={boundary}"})+ with urllib.request.urlopen(req, timeout=600) as r:+ resp = json.load(r)+ if resp.get("code") != 200:+ raise RuntimeError(f"{path}: {resp.get('error')}")+ return resp["data"]++def generate(style: str) -> None:- prompt, bpm, key = STYLES[style]- task = call("/release_task", {+ base, src, strength = COVERS.get(style, (style, None, None))+ prompt, bpm, key = STYLES[base]+ body = {"prompt": prompt,- "lyrics": "[Instrumental]",+ "lyrics": STRUCTURE.get(style, "[Instrumental]"),"instrumental": True,"thinking": True,"bpm": bpm,@@ -76,7 +126,13 @@ def generate(style: str) -> None:"batch_size": TAKES,"inference_steps": 8,"audio_format": "wav",- })+ }+ if src:+ body.update(task_type="cover", audio_cover_strength=strength)+ del body["audio_duration"] # the source's length+ task = call_with_file("/release_task", body, "src_audio", src)+ else:+ task = call("/release_task", body)task_id = task["task_id"]stamp = time.strftime("%Y%m%d-%H%M%S")t0 = time.time()@@ -90,7 +146,7 @@ def generate(style: str) -> None:results = json.loads(item["result"]) if isinstance(item["result"], str) else item["result"]OUT.mkdir(exist_ok=True)for n, res in enumerate(results, 1):- dest = OUT / (f"{style}-{stamp}-{n}.wav" if style in DURATIONS else f"{style}-{n}.wav")+ dest = OUT / (f"{style}-{stamp}-{n}.wav" if style in DURATIONS or style in COVERS else f"{style}-{n}.wav")urllib.request.urlretrieve(API + res["file"], dest)print(f"{dest.name} seed {res.get('seed_value', '?')} {res.get('metas', {})}")print(f"{style}: {len(results)} takes in {time.time() - t0:.0f} s")@@ -99,7 +155,7 @@ def generate(style: str) -> None:if __name__ == "__main__":# A style must be named: running every style would write over the launch takes.if not sys.argv[1:]:- raise SystemExit(f"usage: python gen_music.py STYLE [...] ({', '.join(STYLES)})")+ raise SystemExit(f"usage: python gen_music.py STYLE [...] ({', '.join([*STYLES, *COVERS])})")try:urllib.request.urlopen(API, timeout=5).close()except urllib.error.HTTPError:diff --git a/marketing/audio/gen_voice.py b/marketing/audio/gen_voice.pyindex 4839d22..66f701a 100644--- a/marketing/audio/gen_voice.py+++ b/marketing/audio/gen_voice.py@@ -17,6 +17,11 @@ launch take is never touched:-> voice/update-0.10/final-<stamp>/NN.wav, copied tovideo/public/voice-0.10 with video/src/app/voice-0.10.json+The "use cases" video (voiceover-usecases.md) works the same way, with a tone per line:++ D:/AI/tts/.venv/Scripts/python gen_voice.py audition-usecases [--seeds 4]+ D:/AI/tts/.venv/Scripts/python gen_voice.py build-usecases --from voice/usecases/audition-<stamp> --pick 1.0:11,...+redo/splice change single sentences of the approved take: `--keep NEW:OLD` reuses old sentenceOLD (cut from voice/final/raw by raw/spans.json) as new sentence NEW; the other sentences of theline in voiceover.md get takes to audition, and `--pick NEW:SEED` chooses one each (the auditioned file itself). splice backs@@ -53,7 +58,16 @@ TAKES = {"expressive": ("base", 0.7, 0.3, 0.8),"turbo": ("turbo", 0.0, 0.0, 0.8),"calmer": ("base", 0.55, 0.2, 0.8),+ # The "use cases" video's tones (voiceover-usecases.md, column Tone). "playful" is Chatterbox+ # Turbo, which reads paralinguistic tags ([chuckle], [happy], [laugh]...); it has no voice of its+ # own here, so it clones the launch voice from TURBO_REF.+ "punchy": ("base", 0.75, 0.35, 0.8),+ "playful": ("turbo", 0.0, 0.0, 0.8),+ "tender": ("base", 0.3, 0.45, 0.65),+ "intimate": ("base", 0.25, 0.5, 0.55),}+# A clean line of the launch take (12.8 s), the voice Turbo copies.+TURBO_REF = HERE.parent / "video" / "public" / "voice" / "03.wav"# The approved take (`gen_voice.py final`), picked by ear line by line. Each line is read one# sentence at a time (seed + i for sentence i) with a pause in between, which slows the@@ -76,9 +90,13 @@ MASTER = "aresample=48000,highpass=f=80,deesser=i=0.4,acompressor=threshold=-20dLUFS = -16.0-def script_lines(script: str = "voiceover.md") -> list[str]:+def script_rows(script: str) -> list[list[str]]:rows = [l for l in (HERE / script).read_text(encoding="utf-8").splitlines() if re.match(r"^\| \d+ \|", l)]- return [r.split("|")[4].strip() for r in rows]+ return [[c.strip() for c in r.split("|")] for r in rows]+++def script_lines(script: str = "voiceover.md") -> list[str]:+ return [r[4] for r in script_rows(script)]_models: dict = {}@@ -98,6 +116,8 @@ def say(take: str, text: str, ref: Path | None, seed: int) -> np.ndarray:kind, exag, cfg, temp = TAKES[take]m = model(kind)torch.manual_seed(seed)+ if kind == "turbo" and ref is None:+ ref = TURBO_REFkw = dict(audio_prompt_path=str(ref) if ref else None, temperature=temp)if kind == "base":kw.update(exaggeration=exag, cfg_weight=cfg)@@ -262,12 +282,19 @@ UPDATE_PAUSES = {3: 0.7}UPDATE_SPLITS = {"3.0": [(0.93, 0.35)]}-def audition(seeds: int, base: int) -> None:- """`seeds` takes of every sentence of the update script, read one at a time, for picking by ear."""- folder = UPDATE["dir"] / f"audition-{time.strftime('%Y%m%d-%H%M%S')}"+# The "use cases" video (voiceover-usecases.md): each line's tone is in the script's Tone column.+USECASES = {"script": "voiceover-usecases.md", "dir": OUT / "usecases", "public": "voice-usecases", "json": "voice-usecases.json"}+USECASES_TONES = {n: r[3] for n, r in enumerate(script_rows(USECASES["script"]), 1)}+PROJECTS = {"update": (UPDATE, UPDATE_TAKES), "usecases": (USECASES, USECASES_TONES)}+++def audition(seeds: int, base: int, project: str = "update") -> None:+ """`seeds` takes of every sentence of a script, read one at a time, for picking by ear."""+ proj, takes = PROJECTS[project]+ folder = proj["dir"] / f"audition-{time.strftime('%Y%m%d-%H%M%S')}"folder.mkdir(parents=True)- for n, line in enumerate(script_lines(UPDATE["script"]), 1):- take = UPDATE_TAKES.get(n, "expressive")+ for n, line in enumerate(script_lines(proj["script"]), 1):+ take = takes.get(n, "expressive")for i, text in enumerate(sentences(line)):for k in range(seeds):seed = base + 10 * i + k@@ -279,15 +306,18 @@ def audition(seeds: int, base: int) -> None:print(f"takes in {folder}")-def build(src: Path, pick: dict[str, int]) -> None:+def build(src: Path, pick: dict[str, int], project: str = "update") -> None:"""The update's lines from the picked sentence takes (`pick` "LINE.SENTENCE" -> seed), 0.4 sbetween sentences (UPDATE_PAUSES, UPDATE_SPLITS), mastered like the launch take (-16 LUFS over all lines). Each build goes toa new folder; the video gets the files and their sentence spans."""- lines = script_lines(UPDATE["script"])+ proj = PROJECTS[project][0]+ pauses = UPDATE_PAUSES if project == "update" else {}+ splits = UPDATE_SPLITS if project == "update" else {}+ lines = script_lines(proj["script"])missing = [f"{n}.{i}" for n, l in enumerate(lines, 1) for i in range(len(sentences(l))) if f"{n}.{i}" not in pick]if missing:raise SystemExit(f"no take picked for {', '.join(missing)}")- folder = UPDATE["dir"] / f"final-{time.strftime('%Y%m%d-%H%M%S')}"+ folder = proj["dir"] / f"final-{time.strftime('%Y%m%d-%H%M%S')}"(folder / "raw").mkdir(parents=True)spans: dict[int, dict] = {}files = []@@ -297,13 +327,13 @@ def build(src: Path, pick: dict[str, int]) -> None:for i in range(len(parts)):c, sr = sf.read(src / f"{n:02d}-s{i}-seed{pick[f'{n}.{i}']}.raw.wav", dtype="float32")assert sr == SR- for t, gap in sorted(UPDATE_SPLITS.get(f"{n}.{i}", []), reverse=True):+ for t, gap in sorted(splits.get(f"{n}.{i}", []), reverse=True):c = np.concatenate([c[:int(t * SR)], np.zeros(int(gap * SR), dtype=np.float32), c[int(t * SR):]])chunks.append(c)marks.append([round(pos / SR, 3), round((pos + c.size) / SR, 3)])pos += c.sizeif i < len(parts) - 1:- chunks.append(np.zeros(int(UPDATE_PAUSES.get(n, SENTENCE_PAUSE) * SR), dtype=np.float32))+ chunks.append(np.zeros(int(pauses.get(n, SENTENCE_PAUSE) * SR), dtype=np.float32))pos += chunks[-1].sizespans[n] = {"dur": round(pos / SR, 3), "sentences": marks}raw = folder / "raw" / f"{n:02d}.wav"@@ -320,12 +350,12 @@ def build(src: Path, pick: dict[str, int]) -> None:master(f, tmp, gain)tmp.replace(f)(folder / "picks.json").write_text(json.dumps({"from": str(src), "pick": pick}, indent=1) + "\n", encoding="utf-8")- dst = VIDEO / "public" / UPDATE["public"]+ dst = VIDEO / "public" / proj["public"]dst.mkdir(parents=True, exist_ok=True)for f in files:shutil.copy(f, dst / f.name)- (VIDEO / "src" / "app" / UPDATE["json"]).write_text(json.dumps(spans, indent=1) + "\n", encoding="utf-8")- print(f"{folder}: all.wav {preview.size / 48000:.1f} s at {lufs(folder / 'all.wav'):.1f} LUFS; copied to video/public/{UPDATE['public']}, spans in video/src/app/{UPDATE['json']}")+ (VIDEO / "src" / "app" / proj["json"]).write_text(json.dumps(spans, indent=1) + "\n", encoding="utf-8")+ print(f"{folder}: all.wav {preview.size / 48000:.1f} s at {lufs(folder / 'all.wav'):.1f} LUFS; copied to video/public/{proj['public']}, spans in video/src/app/{proj['json']}")if __name__ == "__main__":@@ -339,10 +369,12 @@ if __name__ == "__main__":ap.add_argument("--take", help="redo: model settings (default: the line's approved take in FINAL)")ap.add_argument("--from", dest="src", type=Path)a = ap.parse_args()- if a.takes[:1] == ["audition"]:- raise SystemExit(audition(a.seeds, a.seed))- if a.takes[:1] == ["build"]:- raise SystemExit(build(a.src, {k: int(v) for k, v in (p.split(":") for p in a.pick.split(","))}))+ for proj in PROJECTS:+ suffix = "" if proj == "update" else f"-{proj}"+ if a.takes[:1] == [f"audition{suffix}"]:+ raise SystemExit(audition(a.seeds, a.seed, proj))+ if a.takes[:1] == [f"build{suffix}"]:+ raise SystemExit(build(a.src, {k: int(v) for k, v in (p.split(":") for p in a.pick.split(","))}, proj))if a.takes[:1] == ["redo"]:n = int(a.takes[1])raise SystemExit(redo(n, pairs(a.keep), a.seeds, a.take or FINAL[n][0], a.seed))diff --git a/marketing/audio/make_sfx.py b/marketing/audio/make_sfx.pyindex c759110..d11f93b 100644--- a/marketing/audio/make_sfx.py+++ b/marketing/audio/make_sfx.py@@ -186,7 +186,43 @@ def riser(sec: float = 1.6) -> np.ndarray:return x * np.linspace(0.2, 1, x.size) ** 1.5+def pop() -> np.ndarray:+ """A soft, round pop: a caption landing. A short pitch drop on a sine, a breath of air."""+ x = t(0.18)+ f = 330 + 520 * np.exp(-x / 0.018)+ body = np.sin(2 * np.pi * np.cumsum(f) / SR) * env(x.size, 0.001, 0.04)+ air = band(noise(0.18), 1500, 5000) * env(x.size, 0.0005, 0.008) * 0.25+ return fade(body + air, 0.0005, 0.04)+++def swipe() -> np.ndarray:+ """A short, light whoosh panned left to right: a before/after wipe."""+ x = swish(0.42, 700, 2500, 2500, 8000)+ pan = np.linspace(0.1, 0.9, x.size)+ st = room(x, 0.15)[: x.size]+ return np.stack([st[:, 0] * np.cos(pan * np.pi / 2) * 1.3, st[:, 1] * np.sin(pan * np.pi / 2) * 1.3], axis=1)+++def deep() -> np.ndarray:+ """A low, soft hit with a long dark tail, under the privacy line."""+ x = t(3.2)+ f = 41 + 30 * np.exp(-x / 0.08)+ sub = np.sin(2 * np.pi * np.cumsum(f) / SR) * env(x.size, 0.008, 1.1)+ body = low(noise(3.2), 600) * env(x.size, 0.004, 0.25) * 0.3+ return fade(sub + body, 0.002, 0.6)+++# The "use cases" video's effects; write only these with: python make_sfx.py pop swipe deep+EXTRA = {"pop": (pop, -8), "swipe": (swipe, -8), "deep": (deep, -4)}+if __name__ == "__main__":+ import sys++ if sys.argv[1:]:+ for name in sys.argv[1:]:+ make, peak = EXTRA[name]+ save(name, make(), peak)+ raise SystemExitsave("click", click(), -6)save("typing", typing(), -6)save("send", send(), -6)diff --git a/marketing/audio/make_update_music.py b/marketing/audio/make_update_music.pyindex 4f06966..ea89246 100644--- a/marketing/audio/make_update_music.py+++ b/marketing/audio/make_update_music.py@@ -1,6 +1,6 @@"""The music of the "Kokon 0.10" update video, cut from an ACE-Step take (gen_music.py update).- D:/AI/tts/.venv/Scripts/python make_update_music.py [1|1b|3] -> ../video/public/<out>+ D:/AI/tts/.venv/Scripts/python make_update_music.py [1|1b|3|usecases|usecases-house4] -> ../video/public/<out>Both takes are 118 BPM (beats every 0.50849 s, grids measured with librosa). The video needs thetake's drop on its beat 26 (the image hatching) and about 12 bars after it, then a stop for the@@ -13,6 +13,14 @@ join is on a bar line with a 10 ms crossfade.the drop at 24.44 s (bar 12), 4 bars, an ending bar. Two beats of silence, then bars 6-11 (thebreak under the logo forming), the drop, bars 12-15, the drop again (on the LoRA part), bars13-15 and the ending bar.++The "use cases" video uses it too (plan "usecases", ../video/public/music-usecases.m4a): take+house4-cover-20261023-015102-4 (gen_music.py house4-cover, a close version of the launch film's+house-4), 118 BPM in 8-bar phrases: a pause in bar 6, groove 7-14 and 15-22, a lighter part without+hats in 23-28, a build in 29-30, the drop 31-38, the ending 39-41. The video plays the pause under+"Why Kokon?" and the groove from "Private" (bars 6-14), the lighter part under its serious block+(23-28, then 23-30, so the build ends it and the drop lands on the flamingo cut), the drop (31-38,+33-38) and the ending (39-43)."""import subprocessimport sys@@ -22,8 +30,8 @@ import numpy as npimport soundfile as sfHERE = Path(__file__).parent-BEAT = 60 / 118-BAR = 4 * BEAT+# The 0.10 takes' grid (118 BPM); a plan with "bpm" uses its own.+BAR = 4 * 60 / 118FADE = 0.010PLANS = {@@ -35,6 +43,11 @@ PLANS = {# longer. Stop at 39.64 s."1b": {"take": "update-20261020-175836-1.wav", "out": "music-0.10-long.m4a", "first": 16.252 - 8 * BAR,"lead": 0, "bars": [(1.5, 15), (10, 15), (15, 16)], "tail": 3.5},+ "usecases": {"take": "house4-cover-20261023-015102-4.wav", "out": "music-usecases.m4a", "bpm": 118, "first": 1.534,+ "lead": 0, "bars": [(6, 15), (23, 29), (23, 31), (31, 39), (33, 39), (39, 44)], "tail": 0},+ # The same cut on the launch film's own house-4 (its bars sit one later): music-usecases-house4.m4a.+ "usecases-house4": {"take": "C:/AI/qwen-local-studio/marketing/audio/takes/house-4.wav", "out": "music-usecases-house4.m4a", "bpm": 118,+ "first": 0.013, "lead": 0, "bars": [(7, 16), (24, 30), (24, 32), (32, 40), (34, 40), (40, 45)], "tail": 0},3: {"take": "update-20261020-175836-3.wav", "out": "music-0.10-take3.m4a", "first": 0.0287,"lead": 2, "bars": [(6, 16), (12, 16), (13, 17)], "tail": 2.5},}@@ -42,10 +55,12 @@ PLANS = {def main(n: int | str) -> None:plan = PLANS[n]+ beat = 60 / plan.get("bpm", 118)+ bar_len = 4 * beaty, sr = sf.read(HERE / "takes" / plan["take"], dtype="float32", always_2d=True)at = lambda t: int(round(t * sr))- bar = lambda i: plan["first"] + i * BAR- parts = [np.zeros((at(plan["lead"] * BEAT), y.shape[1]), np.float32)] if plan["lead"] else []+ bar = lambda i: plan["first"] + i * bar_len+ parts = [np.zeros((at(plan["lead"] * beat), y.shape[1]), np.float32)] if plan["lead"] else []last = len(plan["bars"]) - 1for k, (a, b) in enumerate(plan["bars"]):end = bar(b) + (plan["tail"] if k == last else 0)diff --git a/marketing/audio/voiceover-usecases.md b/marketing/audio/voiceover-usecases.mdnew file mode 100644index 0000000..7398c83--- /dev/null+++ b/marketing/audio/voiceover-usecases.md@@ -0,0 +1,40 @@+# Voiceover script: "use cases" video (2026-10-23)++About 85 s, English, for the site and YouTube. The voice tells the story; the on-screen captions stay+as they are. Honest claims only (no "keeps your face", no "best", "free for personal use", "no daily+limit" means usage limits); every image on screen is an example made with Kokon.++One narrator, the launch voice, in a different tone per section (`Tone`, the settings are in+gen_voice.py `USECASES_TONES`):+- **punchy** (the opening): base model, more exaggeration, firm and quick.+- **playful** (fun beats): Chatterbox Turbo, cloned from the launch voice, with its paralinguistic tags+ (`[chuckle]`, `[happy]`...) where a smile helps.+- **tender** (grandparents, family, kids): base model, low exaggeration, slower and softer.+- **intimate** (the privacy line, alone on dark): base model, the lowest exaggeration, slowest.+- **warm** (the close): base model, the launch take's settings.++Order: beat 10 (kids) comes right after beat 5 (privacy), so the serious part is one block (3, 4, 5,+10, 6) and the music has one quiet section in the middle.++| # | Beat | Tone | Line |+|---|---|---|---|+| 1 | Why Kokon? (opening) | punchy | Why Kokon? Private: your photos never leave your computer. Unlimited: no subscription, no daily limit. |+| 2 | 01 tourists | playful | Photobombers in your holiday photo? [chuckle] Gone. |+| 3 | 02 blink | playful | Someone always blinks. Add the other shot, and it's fixed. |+| 4 | 03 restore | tender | Your grandparents' wedding photo, creased and scratched. Restore it… |+| 5 | 03 colour | tender | and bring it back in colour. |+| 6 | privacy, text on dark | intimate | Your family's memories are yours. They never leave your computer. |+| 7 | 05 child | tender | The same goes for photos of your kids. They don't belong on someone else's server. |+| 8 | 04 grandma | tender | Someone missing from the photo? Bring them in. |+| 9 | 17 flamingo | playful | [happy] And when it's time to have fun: your holiday, upgraded. |+| 10 | 13 hair | playful | Try a new haircut before the hairdresser. |+| 11 | 14 jacket | playful | Try on a jacket before you buy it. |+| 12 | montage 10, 11, 12 | playful | Redo your home before you spend a cent. |+| 13 | 16 CV | playful | Turn a kitchen selfie into a headshot. |+| 14 | 15 invite | playful | It even writes the text. |+| 15 | end card | warm | Kokon. Edit photos by describing the change. On your own computer, free for personal use. Get it at kokon dot app. |++Takes: `gen_voice.py audition-usecases` (every sentence, a few seeds each, in voice/usecases/audition-<stamp>),+then `gen_voice.py build-usecases --from <that folder> --pick LINE.SENTENCE:SEED,...`, which writes+voice/usecases/final-<stamp>/ and copies the lines to video/public/voice-usecases with their sentence spans in+video/src/app/voice-usecases.json. The launch and 0.10 takes are never touched.diff --git a/marketing/video/public/img/usecases/01-after.jpg b/marketing/video/public/img/usecases/01-after.jpgnew file mode 100644index 0000000..4d0f675Binary files /dev/null and b/marketing/video/public/img/usecases/01-after.jpg differdiff --git a/marketing/video/public/img/usecases/01-before.jpg b/marketing/video/public/img/usecases/01-before.jpgnew file mode 100644index 0000000..15e0561Binary files /dev/null and b/marketing/video/public/img/usecases/01-before.jpg differdiff --git a/marketing/video/public/img/usecases/02-after.jpg b/marketing/video/public/img/usecases/02-after.jpgnew file mode 100644index 0000000..eca7c5eBinary files /dev/null and b/marketing/video/public/img/usecases/02-after.jpg differdiff --git a/marketing/video/public/img/usecases/02-before.jpg b/marketing/video/public/img/usecases/02-before.jpgnew file mode 100644index 0000000..d231d23Binary files /dev/null and b/marketing/video/public/img/usecases/02-before.jpg differdiff --git a/marketing/video/public/img/usecases/02-ref.jpg b/marketing/video/public/img/usecases/02-ref.jpgnew file mode 100644index 0000000..1b84c9eBinary files /dev/null and b/marketing/video/public/img/usecases/02-ref.jpg differdiff --git a/marketing/video/public/img/usecases/03-after.jpg b/marketing/video/public/img/usecases/03-after.jpgnew file mode 100644index 0000000..467eee3Binary files /dev/null and b/marketing/video/public/img/usecases/03-after.jpg differdiff --git a/marketing/video/public/img/usecases/03-before.jpg b/marketing/video/public/img/usecases/03-before.jpgnew file mode 100644index 0000000..27a1650Binary files /dev/null and b/marketing/video/public/img/usecases/03-before.jpg differdiff --git a/marketing/video/public/img/usecases/03-color.jpg b/marketing/video/public/img/usecases/03-color.jpgnew file mode 100644index 0000000..50e192fBinary files /dev/null and b/marketing/video/public/img/usecases/03-color.jpg differdiff --git a/marketing/video/public/img/usecases/04-after.jpg b/marketing/video/public/img/usecases/04-after.jpgnew file mode 100644index 0000000..874d47fBinary files /dev/null and b/marketing/video/public/img/usecases/04-after.jpg differdiff --git a/marketing/video/public/img/usecases/04-before.jpg b/marketing/video/public/img/usecases/04-before.jpgnew file mode 100644index 0000000..7b780dcBinary files /dev/null and b/marketing/video/public/img/usecases/04-before.jpg differdiff --git a/marketing/video/public/img/usecases/04-ref.jpg b/marketing/video/public/img/usecases/04-ref.jpgnew file mode 100644index 0000000..7d0c4beBinary files /dev/null and b/marketing/video/public/img/usecases/04-ref.jpg differdiff --git a/marketing/video/public/img/usecases/05-after.jpg b/marketing/video/public/img/usecases/05-after.jpgnew file mode 100644index 0000000..4b0a67aBinary files /dev/null and b/marketing/video/public/img/usecases/05-after.jpg differdiff --git a/marketing/video/public/img/usecases/05-before.jpg b/marketing/video/public/img/usecases/05-before.jpgnew file mode 100644index 0000000..40d4e0cBinary files /dev/null and b/marketing/video/public/img/usecases/05-before.jpg differdiff --git a/marketing/video/public/img/usecases/10-after.jpg b/marketing/video/public/img/usecases/10-after.jpgnew file mode 100644index 0000000..6d1fc74Binary files /dev/null and b/marketing/video/public/img/usecases/10-after.jpg differdiff --git a/marketing/video/public/img/usecases/10-before.jpg b/marketing/video/public/img/usecases/10-before.jpgnew file mode 100644index 0000000..4f8013eBinary files /dev/null and b/marketing/video/public/img/usecases/10-before.jpg differdiff --git a/marketing/video/public/img/usecases/11-after.jpg b/marketing/video/public/img/usecases/11-after.jpgnew file mode 100644index 0000000..8d7aa80Binary files /dev/null and b/marketing/video/public/img/usecases/11-after.jpg differdiff --git a/marketing/video/public/img/usecases/11-before.jpg b/marketing/video/public/img/usecases/11-before.jpgnew file mode 100644index 0000000..4f8013eBinary files /dev/null and b/marketing/video/public/img/usecases/11-before.jpg differdiff --git a/marketing/video/public/img/usecases/12-after.jpg b/marketing/video/public/img/usecases/12-after.jpgnew file mode 100644index 0000000..f92fb67Binary files /dev/null and b/marketing/video/public/img/usecases/12-after.jpg differdiff --git a/marketing/video/public/img/usecases/12-before.jpg b/marketing/video/public/img/usecases/12-before.jpgnew file mode 100644index 0000000..5706442Binary files /dev/null and b/marketing/video/public/img/usecases/12-before.jpg differdiff --git a/marketing/video/public/img/usecases/13-after.jpg b/marketing/video/public/img/usecases/13-after.jpgnew file mode 100644index 0000000..ee82431Binary files /dev/null and b/marketing/video/public/img/usecases/13-after.jpg differdiff --git a/marketing/video/public/img/usecases/13-before.jpg b/marketing/video/public/img/usecases/13-before.jpgnew file mode 100644index 0000000..6165bf2Binary files /dev/null and b/marketing/video/public/img/usecases/13-before.jpg differdiff --git a/marketing/video/public/img/usecases/14-after.jpg b/marketing/video/public/img/usecases/14-after.jpgnew file mode 100644index 0000000..242194dBinary files /dev/null and b/marketing/video/public/img/usecases/14-after.jpg differdiff --git a/marketing/video/public/img/usecases/14-before.jpg b/marketing/video/public/img/usecases/14-before.jpgnew file mode 100644index 0000000..cce8452Binary files /dev/null and b/marketing/video/public/img/usecases/14-before.jpg differdiff --git a/marketing/video/public/img/usecases/14-ref.jpg b/marketing/video/public/img/usecases/14-ref.jpgnew file mode 100644index 0000000..1539457Binary files /dev/null and b/marketing/video/public/img/usecases/14-ref.jpg differdiff --git a/marketing/video/public/img/usecases/15-after.jpg b/marketing/video/public/img/usecases/15-after.jpgnew file mode 100644index 0000000..6b72ac6Binary files /dev/null and b/marketing/video/public/img/usecases/15-after.jpg differdiff --git a/marketing/video/public/img/usecases/15-before.jpg b/marketing/video/public/img/usecases/15-before.jpgnew file mode 100644index 0000000..04e9ab5Binary files /dev/null and b/marketing/video/public/img/usecases/15-before.jpg differdiff --git a/marketing/video/public/img/usecases/16-after.jpg b/marketing/video/public/img/usecases/16-after.jpgnew file mode 100644index 0000000..c9e7028Binary files /dev/null and b/marketing/video/public/img/usecases/16-after.jpg differdiff --git a/marketing/video/public/img/usecases/16-before.jpg b/marketing/video/public/img/usecases/16-before.jpgnew file mode 100644index 0000000..d3d763cBinary files /dev/null and b/marketing/video/public/img/usecases/16-before.jpg differdiff --git a/marketing/video/public/img/usecases/17-after.jpg b/marketing/video/public/img/usecases/17-after.jpgnew file mode 100644index 0000000..b3f9e31Binary files /dev/null and b/marketing/video/public/img/usecases/17-after.jpg differdiff --git a/marketing/video/public/img/usecases/17-before.jpg b/marketing/video/public/img/usecases/17-before.jpgnew file mode 100644index 0000000..04ea9dcBinary files /dev/null and b/marketing/video/public/img/usecases/17-before.jpg differdiff --git a/marketing/video/public/music-usecases-house4.m4a b/marketing/video/public/music-usecases-house4.m4anew file mode 100644index 0000000..b93d89bBinary files /dev/null and b/marketing/video/public/music-usecases-house4.m4a differdiff --git a/marketing/video/public/music-usecases.m4a b/marketing/video/public/music-usecases.m4anew file mode 100644index 0000000..abe121dBinary files /dev/null and b/marketing/video/public/music-usecases.m4a differdiff --git a/marketing/video/public/sfx/deep.wav b/marketing/video/public/sfx/deep.wavnew file mode 100644index 0000000..2238254Binary files /dev/null and b/marketing/video/public/sfx/deep.wav differdiff --git a/marketing/video/public/sfx/pop.wav b/marketing/video/public/sfx/pop.wavnew file mode 100644index 0000000..64239f9Binary files /dev/null and b/marketing/video/public/sfx/pop.wav differdiff --git a/marketing/video/public/sfx/swipe.wav b/marketing/video/public/sfx/swipe.wavnew file mode 100644index 0000000..de42d03Binary files /dev/null and b/marketing/video/public/sfx/swipe.wav differdiff --git a/marketing/video/public/voice-usecases/01.wav b/marketing/video/public/voice-usecases/01.wavnew file mode 100644index 0000000..12af957Binary files /dev/null and b/marketing/video/public/voice-usecases/01.wav differdiff --git a/marketing/video/public/voice-usecases/02.wav b/marketing/video/public/voice-usecases/02.wavnew file mode 100644index 0000000..592dea3Binary files /dev/null and b/marketing/video/public/voice-usecases/02.wav differdiff --git a/marketing/video/public/voice-usecases/03.wav b/marketing/video/public/voice-usecases/03.wavnew file mode 100644index 0000000..76ad985Binary files /dev/null and b/marketing/video/public/voice-usecases/03.wav differdiff --git a/marketing/video/public/voice-usecases/04.wav b/marketing/video/public/voice-usecases/04.wavnew file mode 100644index 0000000..20acf0aBinary files /dev/null and b/marketing/video/public/voice-usecases/04.wav differdiff --git a/marketing/video/public/voice-usecases/05.wav b/marketing/video/public/voice-usecases/05.wavnew file mode 100644index 0000000..acf5dc0Binary files /dev/null and b/marketing/video/public/voice-usecases/05.wav differdiff --git a/marketing/video/public/voice-usecases/06.wav b/marketing/video/public/voice-usecases/06.wavnew file mode 100644index 0000000..0c23058Binary files /dev/null and b/marketing/video/public/voice-usecases/06.wav differdiff --git a/marketing/video/public/voice-usecases/07.wav b/marketing/video/public/voice-usecases/07.wavnew file mode 100644index 0000000..6cdc0a5Binary files /dev/null and b/marketing/video/public/voice-usecases/07.wav differdiff --git a/marketing/video/public/voice-usecases/08.wav b/marketing/video/public/voice-usecases/08.wavnew file mode 100644index 0000000..feb16d5Binary files /dev/null and b/marketing/video/public/voice-usecases/08.wav differdiff --git a/marketing/video/public/voice-usecases/09.wav b/marketing/video/public/voice-usecases/09.wavnew file mode 100644index 0000000..0d54503Binary files /dev/null and b/marketing/video/public/voice-usecases/09.wav differdiff --git a/marketing/video/public/voice-usecases/10.wav b/marketing/video/public/voice-usecases/10.wavnew file mode 100644index 0000000..3f81e9cBinary files /dev/null and b/marketing/video/public/voice-usecases/10.wav differdiff --git a/marketing/video/public/voice-usecases/11.wav b/marketing/video/public/voice-usecases/11.wavnew file mode 100644index 0000000..67801c7Binary files /dev/null and b/marketing/video/public/voice-usecases/11.wav differdiff --git a/marketing/video/public/voice-usecases/12.wav b/marketing/video/public/voice-usecases/12.wavnew file mode 100644index 0000000..23dd9a2Binary files /dev/null and b/marketing/video/public/voice-usecases/12.wav differdiff --git a/marketing/video/public/voice-usecases/13.wav b/marketing/video/public/voice-usecases/13.wavnew file mode 100644index 0000000..ad28353Binary files /dev/null and b/marketing/video/public/voice-usecases/13.wav differdiff --git a/marketing/video/public/voice-usecases/14.wav b/marketing/video/public/voice-usecases/14.wavnew file mode 100644index 0000000..9d09a58Binary files /dev/null and b/marketing/video/public/voice-usecases/14.wav differdiff --git a/marketing/video/public/voice-usecases/15.wav b/marketing/video/public/voice-usecases/15.wavnew file mode 100644index 0000000..1b22144Binary files /dev/null and b/marketing/video/public/voice-usecases/15.wav differdiff --git a/marketing/video/src/Root.tsx b/marketing/video/src/Root.tsxindex a4874d4..b3b3c8f 100644--- a/marketing/video/src/Root.tsx+++ b/marketing/video/src/Root.tsx@@ -14,6 +14,7 @@ import { LENGTH } from "./app/timeline";import { REELS, ReelScene, reelFrames } from "./scenes/Reels";import { AppShot, PH_SLIDES } from "./scenes/ProductHunt";import { VREELS, VReelScene, vreelFrames } from "./scenes/VReels";+import { UseCases, USECASES_FRAMES, USECASES_IMAGES, UseCasesThumb } from "./scenes/UseCases";const withPreload = (C: ComponentType) => () => (<>@@ -27,6 +28,9 @@ export function Root() {return (<><Composition id="KokonLaunch" component={withPreload(Main)} durationInFrames={MAIN_FRAMES} {...S} />+ <Composition id="UseCases" component={() => (<><Preload extra={USECASES_IMAGES} /><UseCases /></>)} durationInFrames={USECASES_FRAMES} {...S} />+ <Composition id="UseCasesHouse4" component={() => (<><Preload extra={USECASES_IMAGES} /><UseCases music="music-usecases-house4.m4a" /></>)} durationInFrames={USECASES_FRAMES} {...S} />+ <Composition id="UseCasesThumb" component={() => (<><Preload extra={USECASES_IMAGES} /><UseCasesThumb /></>)} durationInFrames={1} fps={30} width={1280} height={720} /><Composition id="Update010" component={withPreload(Update010)} durationInFrames={UPDATE_FRAMES} {...S} /><Composition id="Montage" component={withPreload(Montage)} durationInFrames={MONTAGE_FRAMES} {...S} /><Composition id="Agent" component={withPreload(Agent)} durationInFrames={AGENT_FRAMES} {...S} />diff --git a/marketing/video/src/app/Preload.tsx b/marketing/video/src/app/Preload.tsxindex 433d1ca..e4532f0 100644--- a/marketing/video/src/app/Preload.tsx+++ b/marketing/video/src/app/Preload.tsx@@ -7,11 +7,13 @@ import { SIZES } from "./fixtures";const IDS = Object.keys(SIZES);const SRCS = [...IDS.map((id) => staticFile(`img/${id}.jpg`)), ...IDS.map((id) => staticFile(`thumb/${id}.jpg`))];-export function Preload() {+/** `extra`: more images to hold the first frame for (paths under public/). */+export function Preload({ extra = [] }: { extra?: string[] }) {+ const srcs = [...SRCS, ...extra.map((p) => staticFile(p))];const [handle] = useState(() => delayRender("Loading fonts and images"));useEffect(() => {const fonts = Promise.all(["400", "500", "600", "700"].map((w) => document.fonts.load(`${w} 16px "Inter Variable"`)));- const images = SRCS.map(+ const images = srcs.map((src) =>new Promise<void>((resolve) => {const img = new Image();@@ -24,7 +26,7 @@ export function Preload() {}, [handle]);return (<div style={{ position: "absolute", width: 1, height: 1, overflow: "hidden", opacity: 0.001, pointerEvents: "none" }}>- {SRCS.map((s) => (+ {srcs.map((s) => (<img key={s} src={s} alt="" style={{ width: 64, height: 64 }} />))}</div>diff --git a/marketing/video/src/app/sound.tsx b/marketing/video/src/app/sound.tsxindex 8dd71ba..c722337 100644--- a/marketing/video/src/app/sound.tsx+++ b/marketing/video/src/app/sound.tsx@@ -17,6 +17,10 @@ const LEVEL = {brush: 0.16,hit: 0.55,riser: 0.22,+ // the "use cases" video+ pop: 0.2,+ swipe: 0.2,+ deep: 0.3,} as const;/** Music level under the voice (about -8 dB), and how fast it dips and comes back. */const DUCK = { level: 0.4, attack: 8, release: 16 };@@ -84,7 +88,8 @@ function duck(f: number, cues: Cue[]): number {}/** Music for the whole film, under the voice (`cues`), fading out over the last `fadeOut` frames.- * `src` and `from` (seconds into the file) pick the track and where it starts. */-export function Music({ frames, fadeOut = 45, cues = CUES, src = "music.m4a", from = 0 }: { frames: number; fadeOut?: number; cues?: Cue[]; src?: string; from?: number }) {- return <Html5Audio src={staticFile(src)} trimBefore={Math.round(from * FPS)} volume={(f) => LEVEL.music * duck(f, cues) * Math.min(1, Math.max(0, (frames - f) / fadeOut))} />;+ * `src` and `from` (seconds into the file) pick the track and where it starts; `gain` shapes its level+ * over the video. */+export function Music({ frames, fadeOut = 45, cues = CUES, src = "music.m4a", from = 0, gain }: { frames: number; fadeOut?: number; cues?: Cue[]; src?: string; from?: number; gain?: (f: number) => number }) {+ return <Html5Audio src={staticFile(src)} trimBefore={Math.round(from * FPS)} volume={(f) => LEVEL.music * (gain ? gain(f) : 1) * duck(f, cues) * Math.min(1, Math.max(0, (frames - f) / fadeOut))} />;}diff --git a/marketing/video/src/app/timelineUseCases.ts b/marketing/video/src/app/timelineUseCases.tsnew file mode 100644index 0000000..89b1f5a--- /dev/null+++ b/marketing/video/src/app/timelineUseCases.ts@@ -0,0 +1,128 @@+// The clock of the "use cases" video (composition UseCases): the beat grid of its music, each beat's+// length (in musical beats, so every cut lands on one) and mood, where its voice-over line starts,+// and the word the wipe lands on. Frames at 30 fps from the start of the video. Retime here:+// pictures, voice, effects and music follow.+import voice from "./voice-usecases.json";+import words from "./voice-usecases-words.json";+import { FPS, type Cue, type Lines, type VoiceSet } from "./timeline";++// Music: public/music-usecases.m4a, cut by audio/make_update_music.py usecases from a close version+// of the launch film's house-4 (118 BPM), starting on a bar line. Its lighter part covers the+// serious block (restore to grandma, 14 bars), its drop lands on the flamingo cut, and it falls+// silent before the last words.+export const MUSIC = { src: "music-usecases.m4a", from: 0 };+export const BPM = 118;+const BEAT = 60 / BPM;+/** Frame of beat `k` (fractions allowed) of the video. */+export const beat = (k: number) => Math.round(k * BEAT * FPS);++export type Mood = "fun" | "serious" | "message" | "end";++/** Voice-over: public/voice-usecases/NN.wav (audio/gen_voice.py build-usecases); voice-usecases.json+ * holds where each sentence starts and ends, voice-usecases-words.json each word's start (Whisper). */+export const USECASES_VOICE: VoiceSet = { dir: "voice-usecases", lines: voice as unknown as Lines };+const WORDS = words as unknown as Record<string, [string, number][]>;+/** Seconds into line `line` where the `nth` word starting with `w` (lower case) starts. */+export function wordAt(line: number, w: string, nth = 0): number {+ const hits = WORDS[String(line)].filter(([t]) => t.toLowerCase().replace(/[^a-z']/g, "").startsWith(w));+ if (!hits[nth]) throw new Error(`no "${w}" in line ${line}`);+ return hits[nth][1];+}++/** One beat of the video: its length in musical beats, its mood, its voice-over line, how long+ * after the cut the line starts (s), and for the photo beats the word the change lands on. */+export interface Seg {+ id: string;+ len: number;+ mood: Mood;+ line: number;+ lead: number;+ word?: string;+}++export const SEGS: Seg[] = [+ { id: "why", len: 15, mood: "fun", line: 1, lead: 0.25 },+ { id: "tourists", len: 11, mood: "fun", line: 2, lead: 0.3, word: "gone" },+ { id: "blink", len: 10, mood: "fun", line: 3, lead: 0.3, word: "fixed" },+ // The music's lighter part, 14 bars, played lower (MUSIC_GAIN).+ { id: "restore", len: 13, mood: "serious", line: 4, lead: 0.4, word: "restore" },+ { id: "colour", len: 9, mood: "serious", line: 5, lead: 1.2, word: "back" },+ { id: "message", len: 12, mood: "message", line: 6, lead: 0.5 },+ { id: "child", len: 12, mood: "serious", line: 7, lead: 0.4, word: "they" },+ { id: "grandma", len: 10, mood: "serious", line: 8, lead: 0.4, word: "bring" },+ // The music's drop is on this cut.+ { id: "flamingo", len: 10, mood: "fun", line: 9, lead: 0.3, word: "upgraded" },+ { id: "hair", len: 8, mood: "fun", line: 10, lead: 0.5, word: "before" },+ { id: "jacket", len: 8, mood: "fun", line: 11, lead: 0.9, word: "before" },+ // The montage: three edits from beats 0, 3 and 6 of it (MONTAGE), each cut on the beat.+ { id: "home", len: 11, mood: "fun", line: 12, lead: 0.3, word: "before" },+ { id: "cv", len: 10, mood: "fun", line: 13, lead: 0.9, word: "into" },+ { id: "invite", len: 9, mood: "fun", line: 14, lead: 1.1, word: "writes" },+ { id: "end", len: 20, mood: "end", line: 15, lead: 0.6 },+];+/** Beats of each montage shot, from the start of the montage. */+export const MONTAGE = [0, 3, 6];++/** Start frame of each beat, by id, and the video's length. */+export const START: Record<string, number> = {};+let k = 0;+for (const s of SEGS) {+ START[s.id] = beat(k);+ k += s.len;+}+export const TOTAL_BEATS = k;+export const USECASES_FRAMES = beat(k);+const beatOf = (id: string) => {+ let b = 0;+ for (const s of SEGS) {+ if (s.id === id) return b;+ b += s.len;+ }+ throw new Error(id);+};+export const seg = (id: string) => SEGS.find((s) => s.id === id)!;+/** Frame (from the segment's start) of beat `b` of the segment. */+export const at = (id: string, b: number) => beat(beatOf(id) + b) - START[id];+export const segFrames = (id: string) => beat(beatOf(id) + seg(id).len) - START[id];++/** Frame (from the segment's start) where its line starts, and where a word of it starts. */+export const voiceAt = (id: string) => Math.round(seg(id).lead * FPS);+export const wordFrame = (id: string, w: string, nth = 0) => voiceAt(id) + Math.round(wordAt(seg(id).line, w, nth) * FPS);+/** Frame (from the segment's start) where sentence `i` of its line starts. */+export const sentenceFrame = (id: string, i: number) => voiceAt(id) + Math.round(USECASES_VOICE.lines[String(seg(id).line)].sentences[i][0] * FPS);++/**+ * A photo beat, in frames from its start: the prompt box comes in, the prompt is typed, Send, the+ * wipe, and the answer, which lands with the spoken word (`word`). Fun wipes are quick, serious+ * ones slow.+ */+export function photoTimes(id: string) {+ const s = seg(id);+ const punch = wordFrame(id, s.word!) + 2;+ const wipeLen = s.mood === "fun" ? 12 : 24;+ const wipe = punch - wipeLen;+ const send = wipe - 4;+ return { chip: 4, from: 8, to: send - 6, send, wipe, wipeEnd: punch, punch };+}++/** The whole voice-over: each line from its segment's lead. */+export const CUES_USECASES: Cue[] = SEGS.map((s) => ({ line: s.line, from: 0, to: USECASES_VOICE.lines[String(s.line)].sentences.length - 1, at: START[s.id] + voiceAt(s.id), set: USECASES_VOICE }));++/** The music's level by mood (before the voice ducks it): a little lower through the serious block,+ * lower still under the privacy line. Each change ramps over the beat before its cut, so the cut+ * (and the drop on the flamingo) lands at the new level. */+export function musicGain(f: number): number {+ const ramp = beat(1);+ const level = (m: Mood) => (m === "serious" ? 0.62 : m === "message" ? 0.45 : 1);+ let g = level(SEGS[0].mood);+ for (const s of SEGS.slice(1)) {+ const a = START[s.id];+ const next = level(s.mood);+ if (f >= a) g = next;+ else {+ if (f > a - ramp) g += ((next - g) * (f - (a - ramp))) / ramp;+ break;+ }+ }+ return g;+}diff --git a/marketing/video/src/app/voice-usecases-words.json b/marketing/video/src/app/voice-usecases-words.jsonnew file mode 100644index 0000000..a8c798c--- /dev/null+++ b/marketing/video/src/app/voice-usecases-words.json@@ -0,0 +1,616 @@+{+"1": [+[+"Why",+0.0+],+[+"Cocon?",+0.22+],+[+"Private,",+1.5+],+[+"you",+1.92+],+[+"have",+2.02+],+[+"photos",+2.12+],+[+"never",+2.36+],+[+"leave",+2.66+],+[+"your",+2.92+],+[+"computer.",+3.06+],+[+"Unlimited,",+4.22+],+[+"no",+4.94+],+[+"subscription,",+5.1+],+[+"no",+5.84+],+[+"daily",+5.96+],+[+"limit.",+6.2+]+],+"2": [+[+"Fortabomber's",+0.0+],+[+"in",+0.62+],+[+"your",+0.72+],+[+"holiday",+0.84+],+[+"photo?",+1.14+],+[+"Heh.",+2.42+],+[+"Gone.",+3.2+]+],+"3": [+[+"Someone",+0.0+],+[+"always",+0.34+],+[+"blinks.",+0.66+],+[+"Add",+1.98+],+[+"the",+2.28+],+[+"other",+2.4+],+[+"shot,",+2.6+],+[+"and",+3.2+],+[+"it's",+3.28+],+[+"fixed.",+3.5+]+],+"4": [+[+"Your",+0.0+],+[+"grandparent's",+0.3+],+[+"wedding",+0.84+],+[+"photo",+1.02+],+[+"creased",+1.48+],+[+"and",+2.04+],+[+"scratched,",+2.18+],+[+"restore",+3.46+],+[+"it.",+3.86+]+],+"5": [+[+"and",+0.0+],+[+"bring",+0.5+],+[+"it",+0.7+],+[+"back",+0.82+],+[+"in",+0.98+],+[+"color.",+1.14+]+],+"6": [+[+"Your",+0.0+],+[+"family's",+0.32+],+[+"memories",+0.74+],+[+"are",+0.98+],+[+"yours.",+1.24+],+[+"They",+2.3+],+[+"never",+2.6+],+[+"leave",+2.8+],+[+"your",+3.06+],+[+"computer.",+3.22+]+],+"7": [+[+"The",+0.0+],+[+"same",+0.3+],+[+"goes",+0.5+],+[+"for",+0.7+],+[+"photos",+0.96+],+[+"of",+1.16+],+[+"your",+1.36+],+[+"kids.",+1.48+],+[+"They",+2.6+],+[+"don't",+2.86+],+[+"belong",+3.0+],+[+"on",+3.3+],+[+"someone",+3.5+],+[+"else's",+3.78+],+[+"server.",+4.1+]+],+"8": [+[+"Someone",+0.0+],+[+"missing",+0.82+],+[+"from",+1.26+],+[+"the",+1.58+],+[+"photo?",+1.7+],+[+"Bring",+2.96+],+[+"them",+3.1+],+[+"in.",+3.26+]+],+"9": [+[+"And",+0.0+],+[+"when",+0.22+],+[+"it's",+0.42+],+[+"time",+0.64+],+[+"to",+0.84+],+[+"have",+1.04+],+[+"fun,",+1.2+],+[+"your",+1.82+],+[+"holiday",+1.92+],+[+"upgraded!",+2.34+]+],+"10": [+[+"Try",+0.0+],+[+"a",+0.32+],+[+"new",+0.52+],+[+"haircut",+0.7+],+[+"before",+1.06+],+[+"the",+1.44+],+[+"hairdresser.",+1.6+]+],+"11": [+[+"Try",+0.0+],+[+"on",+0.3+],+[+"a",+0.44+],+[+"jacket",+0.6+],+[+"before",+0.82+],+[+"you",+1.2+],+[+"buy",+1.38+],+[+"it.",+1.56+]+],+"12": [+[+"Redo",+0.0+],+[+"your",+0.38+],+[+"home",+0.56+],+[+"before",+0.8+],+[+"you",+1.18+],+[+"spend",+1.36+],+[+"a",+1.6+],+[+"cent.",+1.74+]+],+"13": [+[+"turn",+0.0+],+[+"a",+0.28+],+[+"kitchen",+0.44+],+[+"selfie",+0.62+],+[+"into",+1.08+],+[+"a",+1.54+],+[+"headshot.",+1.74+]+],+"14": [+[+"It",+0.0+],+[+"even",+0.22+],+[+"writes",+0.48+],+[+"the",+0.72+],+[+"text.",+0.9+]+],+"15": [+[+"CoCon.",+0.0+],+[+"Edit",+1.22+],+[+"photos",+1.42+],+[+"by",+1.66+],+[+"describing",+2.02+],+[+"the",+2.36+],+[+"change.",+2.52+],+[+"On",+3.5+],+[+"your",+3.72+],+[+"own",+3.84+],+[+"computer,",+4.08+],+[+"free",+4.78+],+[+"for",+5.0+],+[+"personal",+5.22+],+[+"use.",+5.54+],+[+"Get",+6.74+],+[+"it",+6.98+],+[+"at",+7.16+],+[+"cocon",+7.38+],+[+".app.",+7.88+]+]+}\ No newline at end of filediff --git a/marketing/video/src/app/voice-usecases.json b/marketing/video/src/app/voice-usecases.jsonnew file mode 100644index 0000000..22c42e3--- /dev/null+++ b/marketing/video/src/app/voice-usecases.json@@ -0,0 +1,181 @@+{+ "1": {+ "dur": 6.72,+ "sentences": [+ [+ 0.0,+ 0.8+ ],+ [+ 1.2,+ 3.76+ ],+ [+ 4.16,+ 6.72+ ]+ ]+ },+ "2": {+ "dur": 3.72,+ "sentences": [+ [+ 0.0,+ 1.92+ ],+ [+ 2.32,+ 3.72+ ]+ ]+ },+ "3": {+ "dur": 4.16,+ "sentences": [+ [+ 0.0,+ 1.6+ ],+ [+ 2.0,+ 4.16+ ]+ ]+ },+ "4": {+ "dur": 4.32,+ "sentences": [+ [+ 0.0,+ 2.96+ ],+ [+ 3.36,+ 4.32+ ]+ ]+ },+ "5": {+ "dur": 1.64,+ "sentences": [+ [+ 0.0,+ 1.64+ ]+ ]+ },+ "6": {+ "dur": 3.92,+ "sentences": [+ [+ 0.0,+ 1.92+ ],+ [+ 2.32,+ 3.92+ ]+ ]+ },+ "7": {+ "dur": 4.72,+ "sentences": [+ [+ 0.0,+ 2.16+ ],+ [+ 2.56,+ 4.72+ ]+ ]+ },+ "8": {+ "dur": 3.68,+ "sentences": [+ [+ 0.0,+ 2.44+ ],+ [+ 2.84,+ 3.68+ ]+ ]+ },+ "9": {+ "dur": 3.64,+ "sentences": [+ [+ 0.0,+ 3.64+ ]+ ]+ },+ "10": {+ "dur": 2.44,+ "sentences": [+ [+ 0.0,+ 2.44+ ]+ ]+ },+ "11": {+ "dur": 2.08,+ "sentences": [+ [+ 0.0,+ 2.08+ ]+ ]+ },+ "12": {+ "dur": 2.36,+ "sentences": [+ [+ 0.0,+ 2.36+ ]+ ]+ },+ "13": {+ "dur": 2.52,+ "sentences": [+ [+ 0.0,+ 2.52+ ]+ ]+ },+ "14": {+ "dur": 1.6,+ "sentences": [+ [+ 0.0,+ 1.6+ ]+ ]+ },+ "15": {+ "dur": 8.52,+ "sentences": [+ [+ 0.0,+ 0.76+ ],+ [+ 1.16,+ 3.08+ ],+ [+ 3.48,+ 6.28+ ],+ [+ 6.68,+ 8.52+ ]+ ]+ }+}diff --git a/marketing/video/src/scenes/UseCases.tsx b/marketing/video/src/scenes/UseCases.tsxnew file mode 100644index 0000000..f054efd--- /dev/null+++ b/marketing/video/src/scenes/UseCases.tsx@@ -0,0 +1,535 @@+// "Use cases": an 85-second video of everyday edits (site and YouTube, English, narrated). It opens on+// why Kokon (private, unlimited); then each beat: the before photo, the prompt typed into Kokon's+// prompt box, a wipe to the after landing on the spoken word, the caption. Fun beats pop (bold+// words, a pill, a burst); serious beats breathe (soft type, darker ground, the music lighter).+// Nothing moves the camera: motion comes from cuts on the beat, wipes and type. The clock is+// app/timelineUseCases.ts. All images were made with Kokon (marketing/README.md).+import type { CSSProperties, ReactNode } from "react";+import { AbsoluteFill, Img, Sequence, spring, staticFile, useCurrentFrame, useVideoConfig } from "remotion";+import { ArrowUp, Gauge, Infinity as InfinityIcon, LockKeyhole } from "lucide-react";+import "../../../../src/styles.css";+import { Mark } from "../app/Mark";+import { inOut, prog } from "../app/motion";+import { Music, Send, Sfx, Voice } from "../app/sound";+import { FPS } from "../app/timeline";+import { at, CUES_USECASES, MONTAGE, MUSIC, musicGain, type Mood, photoTimes, seg, segFrames, SEGS, sentenceFrame, START, USECASES_FRAMES, wordFrame } from "../app/timelineUseCases";+import "../app/theme.css";++export { USECASES_FRAMES };+if (typeof document !== "undefined") document.documentElement.dataset.theme = "dark";++const font = '"Inter Variable", Inter, sans-serif';+const PAPER = "#F7F6F2";+const pic = (n: string) => staticFile(`img/usecases/${n}.jpg`);+/** Every image, for <Preload extra>. */+export const USECASES_IMAGES = ["01-before", "01-after", "02-before", "02-after", "02-ref", "03-before", "03-after", "03-color", "04-before", "04-after", "04-ref", "05-before", "05-after", "10-before", "10-after", "11-before", "11-after", "12-before", "12-after", "13-before", "13-after", "14-before", "14-after", "14-ref", "15-before", "15-after", "16-before", "16-after", "17-before", "17-after"].map((n) => `img/usecases/${n}.jpg`);++interface Ref { src: string; ar: number }+interface Case {+ before: string;+ after: string;+ /** Portrait photos sit left with the words right; landscape ones fill the frame. */+ tall: boolean;+ prompt: string;+ /** The question before the change, then the answer once it lands. */+ setup?: string;+ punch: string;+ /** The end of `punch` that goes in a pill (fun beats). */+ hl?: string;+ /** The second image of a multi-image edit, shown as a small card. */+ ref?: Ref;+ /** Landscape crop: CSS object-position. */+ pos?: string;+ /** A fixed detail of the change (fractions of the image): centre and radius (of the width). */+ loupe?: { x: number; y: number; r: number };+}++const CASES: Record<string, Case> = {+ tourists: { before: "01-before", after: "01-after", tall: true, prompt: "remove the tourists", setup: "Photobombers?", punch: "Gone.", hl: "Gone." },+ blink: {+ before: "02-before",+ after: "02-after",+ tall: false,+ prompt: "open his eyes, from the other shot",+ setup: "Someone always blinks?",+ punch: "Fixed.",+ hl: "Fixed.",+ ref: { src: "02-ref", ar: 1920 / 1427 },+ pos: "50% 28%",+ loupe: { x: 460 / 1920, y: 400 / 1427, r: 0.085 },+ },+ restore: { before: "03-before", after: "03-after", tall: true, prompt: "restore this old photo", setup: "Your grandparents' wedding photo.", punch: "Creases and scratches, gone." },+ colour: { before: "03-after", after: "03-color", tall: true, prompt: "colorize it", punch: "…and back in colour." },+ grandma: { before: "04-before", after: "04-after", tall: false, prompt: "add grandma from this photo", setup: "Someone missing?", punch: "Bring them in.", ref: { src: "04-ref", ar: 1427 / 1920 }, pos: "50% 45%" },+ flamingo: { before: "17-before", after: "17-after", tall: true, prompt: "on a flamingo, surfing a wave", setup: "Your holiday,", punch: "upgraded.", hl: "upgraded." },+ hair: { before: "13-before", after: "13-after", tall: true, prompt: "copper bob", setup: "Try the haircut", punch: "before the hairdresser.", hl: "hairdresser." },+ jacket: { before: "14-before", after: "14-after", tall: true, prompt: "wear this jacket", setup: "Try it on", punch: "before you buy it.", hl: "buy it.", ref: { src: "14-ref", ar: 1 } },+ child: { before: "05-before", after: "05-after", tall: false, prompt: "tidy up the room", setup: "Photos of your kids", punch: "don't belong on someone else's server.", pos: "50% 55%" },+ cv: { before: "16-before", after: "16-after", tall: true, prompt: "professional headshot", setup: "Kitchen selfie?", punch: "Now it's a headshot.", hl: "headshot." },+ invite: { before: "15-before", after: "15-after", tall: true, prompt: "birthday invite", punch: "Text too.", hl: "Text too." },+};+const HOME = [+ { before: "10-before", after: "10-after", prompt: "paint the wall sage green" },+ { before: "11-before", after: "11-after", prompt: "a cognac leather sofa" },+ { before: "12-before", after: "12-after", prompt: "tidy up the garden" },+];++// ---------------------------------------------------------------------------------------------+// Pieces+// ---------------------------------------------------------------------------------------------+const fill: CSSProperties = { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" };++/** Before under after, the after wiping in from the left (`p` 0–1), a light sweeping on its edge. */+function Wipe({ before, after, p, pos, radius = 0 }: { before: string; after: string; p: number; pos?: string; radius?: number }) {+ const moving = p > 0 && p < 1;+ const glow = Math.sin(Math.PI * Math.min(1, Math.max(0, p)));+ return (+ <div style={{ position: "absolute", inset: 0, overflow: "hidden", borderRadius: radius }}>+ <Img src={pic(before)} style={{ ...fill, objectPosition: pos }} />+ <Img src={pic(after)} style={{ ...fill, objectPosition: pos, clipPath: `inset(0 ${(1 - p) * 100}% 0 0)` }} />+ {moving && (+ <>+ {/* the sweep: a soft band of light trailing the edge, on the after side */}+ <div style={{ position: "absolute", top: 0, bottom: 0, left: `${p * 100}%`, width: 260, marginLeft: -260, background: `linear-gradient(to right, rgba(255,255,255,0), rgba(255,250,240,${0.22 * glow}))`, mixBlendMode: "screen" }} />+ <div style={{ position: "absolute", top: 0, bottom: 0, left: `${p * 100}%`, width: 3, marginLeft: -1.5, background: "rgba(255,255,255,0.95)", boxShadow: `0 0 ${18 + 26 * glow}px rgba(255,255,255,${0.5 + 0.3 * glow})` }} />+ </>+ )}+ </div>+ );+}++/** "Before" / "After" tag on a photo. */+function Tag({ after, style }: { after: number; style: CSSProperties }) {+ const tag = (text: string, o: number) => (+ <span style={{ position: "absolute", left: 0, top: 0, opacity: o, padding: "7px 16px 9px", borderRadius: 999, background: "rgba(10,10,10,0.62)", color: PAPER, fontFamily: font, fontSize: 22, fontWeight: 560, letterSpacing: "-0.01em", whiteSpace: "nowrap", backdropFilter: "blur(8px)" }}>{text}</span>+ );+ return (+ <div style={{ position: "absolute", width: 120, height: 44, ...style }}>+ {tag("Before", 1 - after)}+ {tag("After", after)}+ </div>+ );+}++/**+ * Kokon's prompt box (the app's own .composer markup and styles), with the text typed in, a caret,+ * the attached images as the app shows them (`refs`), and Send pressed at `send`. `w` is its width+ * in app pixels; `scale` sizes it for the frame.+ */+function PromptBox({ text, from, to, send, refs, w, scale, origin = "0 0" }: { text: string; from: number; to: number; send: number; refs?: string[]; w: number; scale: number; origin?: string }) {+ const f = useCurrentFrame();+ const n = Math.round(text.length * prog(f, from, Math.max(1, to - from), (x) => x));+ const typing = f < send;+ const caretOn = typing && (f < to || Math.floor((f - to) / 12) % 2 === 0);+ const press = Math.max(0, 1 - Math.abs(f - send) / 4);+ const vt = { "--vt": (100 + f / FPS).toFixed(3) } as CSSProperties;+ return (+ <div className="kokon-window silk" style={{ width: w, background: "transparent", boxShadow: "none", overflow: "visible", borderRadius: 0, transform: `scale(${scale})`, transformOrigin: origin, ...vt }}>+ <div className="composer" style={{ maxWidth: "none", boxShadow: "0 0 0 1px rgba(255,255,255,0.09), 0 30px 70px -20px rgba(0,0,0,0.9)" }}>+ {refs && (+ <div className="target">+ <div className="refs" style={{ maxWidth: "none" }}>+ {refs.map((r, i) => (+ <div className="ref" key={r}>+ <img src={pic(r)} alt="" />+ <span className="num">{i + 1}</span>+ </div>+ ))}+ </div>+ </div>+ )}+ <div className="prompt" style={{ color: "var(--text)", minHeight: 30, whiteSpace: "pre-wrap" }}>+ {text.slice(0, n)}+ <span style={{ display: "inline-block", width: 2, height: "1.1em", marginLeft: 2, verticalAlign: -3, borderRadius: 1, background: "var(--text)", opacity: caretOn ? 1 : 0 }} />+ </div>+ <div className="controls">+ <button className="pill">+ <Gauge size={15} />+ <span className="lbl">Quality</span>+ </button>+ <div className="spacer" />+ <button className="send" style={{ transform: `scale(${1 - press * 0.14})` }} aria-label="Generate">+ <ArrowUp size={18} strokeWidth={2.4} />+ </button>+ </div>+ </div>+ </div>+ );+}++/** How a piece enters: fun pops in on a spring, serious fades in softly. */+function useEnter(start: number, mood: Mood) {+ const f = useCurrentFrame();+ const { fps } = useVideoConfig();+ if (mood === "fun") {+ const s = spring({ frame: f - start, fps, config: { damping: 12, mass: 0.6, stiffness: 170 } });+ return { opacity: Math.min(1, s * 1.6), transform: `translateY(${(1 - s) * 30}px) scale(${0.9 + 0.1 * s})` } as CSSProperties;+ }+ const p = prog(f, start, 22, inOut);+ return { opacity: p, transform: `translateY(${(1 - p) * 12}px)`, filter: `blur(${(1 - p) * 6}px)` } as CSSProperties;+}++/** Fun words: bold, popping in one after another; `hl` (the end of the text) lands in a paper+ * pill with a small burst. */+function Pop({ text, hl, start, size, style }: { text: string; hl?: string; start: number; size: number; style?: CSSProperties }) {+ const f = useCurrentFrame();+ const { fps } = useVideoConfig();+ const head = hl && text.endsWith(hl) ? text.slice(0, -hl.length).trim() : text;+ const words = head ? head.split(" ") : [];+ const items: { w: string; pill: boolean }[] = [...words.map((w) => ({ w, pill: false })), ...(hl && text.endsWith(hl) ? [{ w: hl, pill: true }] : [])];+ const sp = (i: number) => spring({ frame: f - start - i * 3, fps, config: { damping: 11, mass: 0.55, stiffness: 190 } });+ const last = items.length - 1;+ const burst = prog(f, start + last * 3 + 4, 10);+ const burstGone = prog(f, start + last * 3 + 16, 12, inOut);+ return (+ <div style={{ fontFamily: font, fontSize: size, fontWeight: 800, letterSpacing: "-0.045em", lineHeight: 1.08, color: PAPER, textShadow: "0 6px 30px rgba(0,0,0,0.5)", ...style }}>+ {items.map(({ w, pill }, i) => {+ const s = sp(i);+ const base: CSSProperties = { display: "inline-block", opacity: Math.min(1, s * 1.8), transform: `translateY(${(1 - s) * 0.5 * size}px) scale(${0.6 + 0.4 * s})`, transformOrigin: "50% 80%", marginRight: "0.22em" };+ if (!pill) return <span key={i} style={base}>{w}</span>;+ return (+ <span key={i} style={{ ...base, position: "relative", marginRight: 0 }}>+ <span style={{ display: "inline-block", padding: "0.02em 0.26em 0.1em", borderRadius: "0.24em", background: PAPER, color: "#0d0d0d", textShadow: "none", boxShadow: "0 14px 40px rgba(0,0,0,0.45)" }}>{w}</span>+ <svg width={size} height={size} viewBox="0 0 100 100" style={{ position: "absolute", right: -size * 0.62, top: -size * 0.5, overflow: "visible", opacity: 1 - burstGone }}>+ {[+ [20, 70, 48, 42],+ [44, 82, 84, 66],+ [12, 42, 22, 8],+ ].map(([x1, y1, x2, y2], k) => (+ <line key={k} x1={x1} y1={y1} x2={x1 + (x2 - x1) * burst} y2={y1 + (y2 - y1) * burst} stroke={PAPER} strokeWidth={7} strokeLinecap="round" />+ ))}+ </svg>+ </span>+ );+ })}+ </div>+ );+}++/** Serious words: lighter, fading in softly one after another. */+function Soft({ text, start, size, style, weight = 470 }: { text: string; start: number; size: number; style?: CSSProperties; weight?: number }) {+ const f = useCurrentFrame();+ return (+ <div style={{ fontFamily: font, fontSize: size, fontWeight: weight, letterSpacing: "-0.03em", lineHeight: 1.18, color: "rgba(247,246,242,0.94)", textShadow: "0 4px 30px rgba(0,0,0,0.6)", ...style }}>+ {text.split(" ").map((w, i) => {+ const p = prog(f, start + i * 4, 20, inOut);+ return (+ <span key={i} style={{ display: "inline-block", opacity: p, transform: `translateY(${(1 - p) * 12}px)`, filter: `blur(${(1 - p) * 7}px)`, marginRight: "0.24em" }}>+ {w}+ </span>+ );+ })}+ </div>+ );+}++/** A caption line in the beat's mood. */+const Line = ({ mood, text, hl, start, size, style }: { mood: Mood; text: string; hl?: string; start: number; size: number; style?: CSSProperties }) =>+ mood === "fun" ? <Pop text={text} hl={hl} start={start} size={size} style={style} /> : <Soft text={text} start={start} size={size * 0.7} style={style} />;++/** The second image of a multi-image edit: a small card with its number, as in the prompt box. */+function RefCard({ r, start, end, mood, style }: { r: Ref; start: number; end: number; mood: Mood; style: CSSProperties }) {+ const f = useCurrentFrame();+ const enter = useEnter(start, mood);+ const gone = prog(f, end, 10, inOut);+ const h = r.ar >= 1 ? 250 / r.ar : 300;+ const w = h * r.ar;+ return (+ <div style={{ position: "absolute", width: w, height: h, borderRadius: 18, overflow: "hidden", boxShadow: "0 0 0 3px rgba(247,246,242,0.92), 0 30px 70px rgba(0,0,0,0.6)", ...style, ...enter, opacity: (enter.opacity as number) * (1 - gone) }}>+ <Img src={pic(r.src)} style={fill} />+ <span style={{ position: "absolute", left: 10, top: 10, minWidth: 34, height: 34, borderRadius: 17, background: PAPER, color: "#0a0a0a", fontFamily: font, fontSize: 20, fontWeight: 650, display: "grid", placeItems: "center" }}>2</span>+ </div>+ );+}++/** A fixed circular detail of the change, crossfading as the wipe passes over it. */+function Loupe({ c, k, start, wipeP, style }: { c: Case; k: NonNullable<Case["loupe"]>; start: number; wipeP: number; style: CSSProperties }) {+ const enter = useEnter(start, "fun");+ const D = 330;+ const scale = D / (2 * k.r); // image width in px inside the loupe+ const ih = (scale * 1427) / 1920;+ const layer = (n: string, o: number) => (+ <Img src={pic(n)} style={{ position: "absolute", width: scale, height: ih, left: D / 2 - k.x * scale, top: D / 2 - k.y * ih, opacity: o, maxWidth: "none" }} />+ );+ const after = Math.min(1, Math.max(0, (wipeP - k.x) / 0.06));+ return (+ <div style={{ position: "absolute", width: D, height: D, ...style, ...enter }}>+ <div style={{ position: "absolute", inset: 0, borderRadius: "50%", overflow: "hidden", boxShadow: "0 0 0 4px rgba(247,246,242,0.95), 0 30px 70px rgba(0,0,0,0.6)" }}>+ {layer(c.before, 1)}+ {layer(c.after, after)}+ </div>+ </div>+ );+}++const Disclaimer = () => (+ <div style={{ position: "absolute", right: 34, bottom: 22, fontFamily: font, fontSize: 21, fontWeight: 450, color: "rgba(247,246,242,0.66)", letterSpacing: "-0.005em", textShadow: "0 1px 10px rgba(0,0,0,0.8)" }}>All images are examples made with Kokon.</div>+);++/** A dark wash at one edge so words stay readable on a photo. */+const Wash = ({ side, o }: { side: "top" | "bottom"; o: number }) => (+ <div style={{ position: "absolute", left: 0, right: 0, [side]: 0, height: 440, opacity: o, background: `linear-gradient(${side === "top" ? "to bottom" : "to top"}, rgba(0,0,0,0.82), rgba(0,0,0,0.5) 45%, rgba(0,0,0,0))` }} />+);++// ---------------------------------------------------------------------------------------------+// A photo beat+// ---------------------------------------------------------------------------------------------+function PhotoBeat({ id }: { id: string }) {+ const f = useCurrentFrame();+ const s = seg(id);+ const c = CASES[id];+ const mood = s.mood;+ const T = photoTimes(id);+ const p = prog(f, T.wipe, T.wipeEnd - T.wipe, inOut);+ const chipIn = useEnter(T.chip, mood);+ const refs = c.ref ? [c.before, c.ref.src] : undefined;+ const fun = mood === "fun";+ if (c.tall) {+ // Portrait: the photo left, the words right; the ground is the photo itself, blurred and dark.+ const H = 960;+ const W = (H * 1427) / 1920;+ const X = 120;+ // The prompt box (173 px high, 283 with attached images) under the question, the answer under it.+ const chipTop = c.setup ? 380 : 300;+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ <div style={{ position: "absolute", inset: -80, filter: `blur(70px) brightness(${fun ? 0.34 : 0.17}) saturate(${fun ? 1.3 : 0.9})` }}>+ <Img src={pic(c.before)} style={fill} />+ <Img src={pic(c.after)} style={{ ...fill, opacity: p }} />+ </div>+ <div style={{ position: "absolute", left: X, top: 60, width: W, height: H, borderRadius: 20, overflow: "hidden", boxShadow: "0 40px 120px rgba(0,0,0,0.65)" }}>+ <Wipe before={c.before} after={c.after} p={p} />+ <Tag after={prog(f, T.wipeEnd - 4, 8)} style={{ left: 22, top: 22 }} />+ </div>+ {c.ref && <RefCard r={c.ref} start={T.chip - 4} end={T.wipe} mood={mood} style={{ left: X + W - 190, top: 640, transform: "rotate(-3deg)" }} />}+ <div style={{ position: "absolute", left: 950, top: 0, width: 880, height: 1080 }}>+ {c.setup && <Line mood={mood} text={c.setup} start={3} size={84} style={{ position: "absolute", left: 0, top: 210, width: 880 }} />}+ <div style={{ position: "absolute", left: 0, top: chipTop, ...chipIn, opacity: (chipIn.opacity as number) * (1 - 0.2 * prog(f, T.send + 6, 12)) }}>+ <PromptBox text={c.prompt} from={T.from} to={T.to} send={T.send} refs={refs} w={460} scale={1.9} />+ </div>+ <Line mood={mood} text={c.punch} hl={c.hl} start={T.punch} size={112} style={{ position: "absolute", left: 0, top: chipTop + (refs ? 283 : 173) + 70, width: 880 }} />+ </div>+ <Disclaimer />+ </AbsoluteFill>+ );+ }+ // Landscape: the photo fills the frame; the question top left, the prompt box bottom centre, then+ // the answer bottom left as the box fades.+ const boxGone = prog(f, T.wipeEnd, 10, inOut);+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ <Wipe before={c.before} after={c.after} p={p} pos={c.pos} />+ {!fun && <div style={{ position: "absolute", inset: 0, background: "rgba(0,0,0,0.16)" }} />}+ <Wash side="top" o={c.setup ? 0.9 : 0} />+ <Wash side="bottom" o={0.55 + 0.4 * prog(f, T.punch - 6, 12)} />+ <Tag after={prog(f, T.wipeEnd - 4, 8)} style={{ right: 140, top: 44 }} />+ {c.setup && <Line mood={mood} text={c.setup} start={3} size={84} style={{ position: "absolute", left: 96, top: 70, width: 1300 }} />}+ {c.ref && <RefCard r={c.ref} start={T.chip - 4} end={T.wipeEnd} mood={mood} style={c.ref.ar >= 1 ? { right: 70, top: 120 } : { right: 90, top: 110 }} />}+ {c.loupe && <Loupe c={c} k={c.loupe} start={T.wipe - 10} wipeP={p} style={{ right: 70, top: 560 }} />}+ <div style={{ position: "absolute", left: 960 - 300, bottom: 58, ...chipIn, opacity: (chipIn.opacity as number) * (1 - boxGone) }}>+ <PromptBox text={c.prompt} from={T.from} to={T.to} send={T.send} refs={refs} w={600} scale={1.8} origin="50% 100%" />+ </div>+ <Line mood={mood} text={c.punch} hl={c.hl} start={T.punch} size={112} style={{ position: "absolute", left: 96, bottom: 96, width: 1500 }} />+ <Disclaimer />+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// Why Kokon? The two reasons, each landing as the voice says it, over a still wall of results.+// ---------------------------------------------------------------------------------------------+const WALL = ["01-after", "17-after", "13-after", "04-after", "12-after", "16-after", "03-color", "15-after"];++function Reason({ Icon, word, sub, start }: { Icon: typeof LockKeyhole; word: string; sub: string; start: number }) {+ const enter = useEnter(start, "fun");+ return (+ <div style={{ width: 640, display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center" }}>+ <div style={{ ...enter, width: 120, height: 120, borderRadius: 60, background: PAPER, color: "#0d0d0d", display: "grid", placeItems: "center", boxShadow: "0 20px 60px rgba(0,0,0,0.5)" }}>+ <Icon size={64} strokeWidth={2.2} />+ </div>+ <Pop text={word} start={start + 3} size={104} style={{ marginTop: 34 }} />+ <Soft text={sub} start={start + 10} size={38} style={{ marginTop: 22, color: "rgba(247,246,242,0.86)" }} />+ </div>+ );+}++function Why() {+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ <div style={{ position: "absolute", inset: 0, display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gridTemplateRows: "repeat(2, 1fr)", filter: "brightness(0.2) saturate(0.9)" }}>+ {WALL.map((n) => (+ <Img key={n} src={pic(n)} style={{ width: "100%", height: "100%", objectFit: "cover" }} />+ ))}+ </div>+ <div style={{ position: "absolute", inset: 0, background: "radial-gradient(ellipse 70% 65% at 50% 50%, rgba(5,5,5,0.55), rgba(5,5,5,0.9))" }} />+ <Pop text="Why Kokon?" start={sentenceFrame("why", 0)} size={132} style={{ position: "absolute", top: 120, left: 0, right: 0, textAlign: "center" }} />+ <div style={{ position: "absolute", top: 400, left: 0, right: 0, display: "flex", justifyContent: "center", gap: 120 }}>+ <Reason Icon={LockKeyhole} word="Private." sub="Your photos never leave your computer." start={wordFrame("why", "private")} />+ <Reason Icon={InfinityIcon} word="Unlimited." sub="No subscription, no daily limit." start={wordFrame("why", "unlimited")} />+ </div>+ <Disclaimer />+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// The privacy line, alone on dark.+// ---------------------------------------------------------------------------------------------+function Message() {+ return (+ <AbsoluteFill style={{ background: "#030303", alignItems: "center", justifyContent: "center" }}>+ <div style={{ position: "absolute", inset: 0, background: "radial-gradient(ellipse 55% 45% at 50% 50%, rgba(247,246,242,0.045), transparent 70%)" }} />+ <div style={{ textAlign: "center", width: 1500 }}>+ <Soft text="Your family photos are yours." start={sentenceFrame("message", 0) - 4} size={74} weight={430} style={{ color: "rgba(247,246,242,0.8)" }} />+ <Soft text="They never leave your computer." start={sentenceFrame("message", 1) - 4} size={74} weight={640} style={{ marginTop: 30 }} />+ </div>+ <Disclaimer />+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// Home: three edits cut on the beat.+// ---------------------------------------------------------------------------------------------+function Home() {+ const f = useCurrentFrame();+ const shot = MONTAGE.filter((b) => f >= at("home", b)).length - 1;+ const h = HOME[shot];+ const t0 = at("home", MONTAGE[shot]);+ const T = { from: t0 + 2, to: t0 + at("home", 0.75), send: t0 + at("home", 0.9), wipe: t0 + at("home", 1), wipeEnd: t0 + at("home", 1.75) };+ const p = prog(f, T.wipe, T.wipeEnd - T.wipe, inOut);+ const last = shot === HOME.length - 1;+ const punch = wordFrame("home", "before");+ const boxGone = last ? prog(f, T.wipeEnd, 10, inOut) : 0;+ const chipIn = useEnter(0, "fun");+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ <Wipe before={h.before} after={h.after} p={p} pos="50% 60%" />+ <Wash side="top" o={0.9} />+ <Wash side="bottom" o={0.55 + 0.4 * prog(f, punch - 6, 12)} />+ <Tag after={prog(f, T.wipeEnd - 4, 8)} style={{ right: 140, top: 44 }} />+ <Pop text="Redo your home" start={3} size={84} style={{ position: "absolute", left: 96, top: 70, width: 1300 }} />+ <div style={{ position: "absolute", left: 960 - 300, bottom: 58, ...chipIn, opacity: (chipIn.opacity as number) * (1 - boxGone) }}>+ <PromptBox text={h.prompt} from={T.from} to={T.to} send={T.send} w={600} scale={1.8} origin="50% 100%" />+ </div>+ <Pop text="before you spend a cent." hl="a cent." start={punch} size={84} style={{ position: "absolute", left: 96, top: 180, width: 1600 }} />+ <Disclaimer />+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// End card.+// ---------------------------------------------------------------------------------------------+function End() {+ const f = useCurrentFrame();+ const n = segFrames("end");+ // Each line comes in as the voice says it.+ const a = prog(f, sentenceFrame("end", 0) - 6, 26);+ const b = prog(f, sentenceFrame("end", 1) - 4, 24);+ const c = prog(f, sentenceFrame("end", 2) - 4, 24);+ const d = prog(f, sentenceFrame("end", 3) - 4, 24);+ const fade = prog(f, n - 18, 18, inOut);+ const rise = (p: number): CSSProperties => ({ opacity: p, transform: `translateY(${(1 - p) * 14}px)`, filter: `blur(${(1 - p) * 6}px)` });+ return (+ <AbsoluteFill style={{ background: "#050505", fontFamily: font, alignItems: "center", justifyContent: "center", opacity: 1 - fade }}>+ <div style={{ position: "absolute", inset: 0, background: "radial-gradient(circle at 50% 40%, rgba(247,246,242,0.06) 0%, transparent 45%)" }} />+ <div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: -30 }}>+ <div style={{ display: "flex", alignItems: "center", gap: 30, ...rise(a) }}>+ <Mark size={110} color={PAPER} />+ <span style={{ fontSize: 120, fontWeight: 620, color: PAPER, letterSpacing: "-0.045em", lineHeight: 1 }}>Kokon.</span>+ </div>+ <div style={{ marginTop: 34, fontSize: 56, fontWeight: 600, color: PAPER, letterSpacing: "-0.035em", ...rise(b) }}>Edit photos by describing the change.</div>+ <div style={{ marginTop: 26, fontSize: 34, fontWeight: 450, color: "rgba(247,246,242,0.8)", letterSpacing: "-0.015em", ...rise(c) }}>On your own computer. Free for personal use, no subscription, no daily limits.</div>+ <div style={{ marginTop: 60, display: "flex", alignItems: "center", gap: 22, fontSize: 31, color: "rgba(247,246,242,0.74)", ...rise(d) }}>+ <span>12 GB GPU (NVIDIA or AMD) or Apple Silicon Mac</span>+ <span>·</span>+ <span style={{ padding: "12px 30px 14px", borderRadius: 999, background: PAPER, color: "#0d0d0d", fontSize: 32, fontWeight: 650, letterSpacing: "-0.02em" }}>kokon.app</span>+ </div>+ </div>+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// Sound: the voice-over, the music under it (ducked while the voice speaks) and the effects, kept+// light so they never cover a word.+// ---------------------------------------------------------------------------------------------+function Sounds() {+ const out: ReactNode[] = [];+ let reveal = 0;+ for (const s of SEGS) {+ if (!s.word || s.id === "home") continue;+ const t = START[s.id];+ const T = photoTimes(s.id);+ const fun = s.mood === "fun";+ out.push(+ <Sfx key={`${s.id}-chip`} name="pop" at={t + T.chip} gain={fun ? 0.35 : 0.2} />,+ <Sfx key={`${s.id}-type`} name="typing" at={t + T.from} dur={T.to - T.from} gain={0.45} />,+ <Send key={`${s.id}-send`} at={t + T.send} />,+ <Sfx key={`${s.id}-swipe`} name="swipe" at={t + T.wipe - 2} gain={fun ? 0.8 : 0.5} />,+ fun ? <Sfx key={`${s.id}-punch`} name="pop" at={t + T.punch} gain={0.6} /> : <Sfx key={`${s.id}-punch`} name="reveal" at={t + T.punch - 4} variant={reveal++} gain={0.45} />,+ );+ }+ const home = START.home;+ MONTAGE.forEach((b, i) => {+ const t = home + at("home", b);+ out.push(<Sfx key={`home-type-${i}`} name="typing" at={t + 2} dur={at("home", 0.75) - 2} gain={0.35} />, <Sfx key={`home-click-${i}`} name="click" at={t + at("home", 0.9)} />, <Sfx key={`home-swipe-${i}`} name="swipe" at={t + at("home", 1) - 2} gain={0.7} />);+ });+ const why = START.why;+ out.push(<Sfx key="why-title" name="hit" at={why + sentenceFrame("why", 0)} gain={0.35} />, <Sfx key="why-priv" name="pop" at={why + wordFrame("why", "private") + 3} gain={0.6} />, <Sfx key="why-unl" name="pop" at={why + wordFrame("why", "unlimited") + 3} gain={0.6} />);+ out.push(<Sfx key="deep" name="deep" at={START.message + sentenceFrame("message", 1)} />);+ out.push(<Sfx key="end-hit" name="hit" at={START.end} gain={0.35} />);+ return <>{out}</>;+}++/** `music`: the music file in public/ (default: the house-4 variant; "music-usecases-house4.m4a" is+ * the same cut on the launch film's own house-4). */+export function UseCases({ music = MUSIC.src }: { music?: string }) {+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ {SEGS.map((s) => (+ <Sequence key={s.id} from={START[s.id]} durationInFrames={segFrames(s.id)} name={s.id}>+ {s.id === "why" ? <Why /> : s.id === "message" ? <Message /> : s.id === "home" ? <Home /> : s.id === "end" ? <End /> : <PhotoBeat id={s.id} />}+ </Sequence>+ ))}+ <Sounds />+ <Voice cues={CUES_USECASES} />+ <Music frames={USECASES_FRAMES} cues={CUES_USECASES} src={music} from={MUSIC.from} fadeOut={10} gain={musicGain} />+ </AbsoluteFill>+ );+}++// ---------------------------------------------------------------------------------------------+// YouTube thumbnail (1280×720): the tourists before/after, the line, the prompt box.+// ---------------------------------------------------------------------------------------------+export function UseCasesThumb() {+ const H = 640;+ const W = (H * 1427) / 1920;+ return (+ <AbsoluteFill style={{ background: "#050505", fontFamily: font }}>+ <div style={{ position: "absolute", inset: -60, filter: "blur(60px) brightness(0.3) saturate(1.3)" }}>+ <Img src={pic("01-after")} style={fill} />+ </div>+ <div style={{ position: "absolute", left: 40, top: 40, width: W, height: H, borderRadius: 18, overflow: "hidden", boxShadow: "0 30px 90px rgba(0,0,0,0.7)" }}>+ {/* before on the left, after on the right */}+ <Wipe before="01-after" after="01-before" p={0.5} />+ <div style={{ position: "absolute", top: 0, bottom: 0, left: "50%", width: 4, marginLeft: -2, background: PAPER, boxShadow: "0 0 24px rgba(255,255,255,0.7)" }} />+ <span style={{ position: "absolute", left: 14, bottom: 14, padding: "5px 12px 7px", borderRadius: 999, background: "rgba(10,10,10,0.7)", color: PAPER, fontSize: 20, fontWeight: 600 }}>Before</span>+ <span style={{ position: "absolute", right: 14, bottom: 14, padding: "5px 12px 7px", borderRadius: 999, background: "rgba(10,10,10,0.7)", color: PAPER, fontSize: 20, fontWeight: 600 }}>After</span>+ </div>+ <div style={{ position: "absolute", left: W + 90, top: 60, right: 40 }}>+ <div style={{ display: "flex", alignItems: "center", gap: 14, color: PAPER, fontSize: 40, fontWeight: 640, letterSpacing: "-0.04em" }}>+ <Mark size={44} color={PAPER} /> Kokon+ </div>+ <div style={{ marginTop: 36, color: PAPER, fontSize: 82, fontWeight: 800, letterSpacing: "-0.05em", lineHeight: 1.02 }}>+ Edit photos by{" "}+ <span style={{ display: "inline-block", padding: "0 0.2em 0.06em", borderRadius: "0.2em", background: PAPER, color: "#0d0d0d" }}>describing</span> the change.+ </div>+ <div style={{ marginTop: 44 }}>+ <PromptBox text="remove the tourists" from={-12} to={-11} send={-10} w={420} scale={1.4} />+ </div>+ </div>+ </AbsoluteFill>+ );+}