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
Launch film v2: voice-led, beat-cut, full-frame results
Gabriele Lozuponef9458508227d
diff --git a/marketing/README.md b/marketing/README.mdindex a4a8ebc..7b7dc6c 100644--- a/marketing/README.md+++ b/marketing/README.md@@ -22,22 +22,40 @@ the before/after slider (`mocks/Compare.tsx`).cd marketing/videonpm installnpm run studio # preview and scrub in the browser-npm run render # out/kokon-launch.mp4, 1920×1080, ~87 s, about 5 minutes+npm run render # out/kokon-launch.mp4, 1920×1080, ~85 s, about 5 minutes```Scenes (`src/scenes`): Intro (the mark assembles) → Hook (wall of before/afters) → Create →-Region (paint, remove, add) → Versions → Montage (six edits) → Agent (MCP) → Hardware → Outro.-Each scene is also its own composition, so one can be rendered alone, for example-`npx remotion render Montage out/montage.mp4`.+Region (paint, remove, add) → Versions → Montage (six edits, full frame) → Agent (MCP) → Hardware →+Outro. Each scene is also its own composition, so one can be rendered alone, for example+`npx remotion render Montage out/montage.mp4` (the voice and music play only in `KokonLaunch`).-There is no music. Add a track from YouTube's free Audio Library when uploading.+`src/app/timeline.ts` is the film's clock: scene lengths, the frame where each voice-over sentence+plays, the frames of the actions the voice names (Remove, Add, the montage cuts) and the music's+beat grid. Retime there and pictures, voice and music move together.++Sound (`src/app/sound.tsx`, all levels in one table):++- **Voice-over**: `public/voice/NN.wav`, one file per line of `audio/voiceover.md`, generated+ locally with [Chatterbox](https://github.com/resemble-ai/chatterbox) (MIT) by+ `audio/gen_voice.py final`, which also writes `src/app/voice.json` (where each sentence starts+ and ends) so sentences can be placed one by one. The music ducks about 8 dB under it.+- **Music**: `public/music.m4a`, generated locally with [ACE-Step 1.5](https://github.com/ace-step/ACE-Step-1.5)+ (MIT, output usable commercially) by `audio/gen_music.py`: take `house-4`, 118 BPM, with two bars+ removed from its breakdown so the second drop (60.3 s) lands on the Agent scene.+- **Effects**: `public/sfx/*.wav`, synthesized from scratch by `audio/make_sfx.py` (no samples, no+ licences), kept sparse: typing only in the first demo, quiet clicks, a soft reveal in three+ variants that take turns when a result appears, whooshes only on big moves.++To regenerate music, start the ACE-Step API (`uv run acestep-api` in its folder) and run+`python audio/gen_music.py house`; takes land in `audio/takes/` (git-ignored).The website uses a lighter copy: `site/assets/kokon.mp4` (CRF 25, no audio, ~13 MB) and`site/assets/kokon-poster.jpg`. To refresh them after a new render:```powershellffmpeg -y -i marketing/video/out/kokon-launch.mp4 -c:v libx264 -preset slow -crf 25 -pix_fmt yuv420p -movflags +faststart -an site/assets/kokon.mp4-ffmpeg -y -ss 34 -i marketing/video/out/kokon-launch.mp4 -frames:v 1 -q:v 3 site/assets/kokon-poster.jpg+ffmpeg -y -ss 35.5 -i marketing/video/out/kokon-launch.mp4 -frames:v 1 -q:v 3 site/assets/kokon-poster.jpg```## The websitediff --git a/marketing/audio/.gitignore b/marketing/audio/.gitignorenew file mode 100644index 0000000..d81deb0--- /dev/null+++ b/marketing/audio/.gitignore@@ -0,0 +1,3 @@+takes/+voice/+ref/diff --git a/marketing/audio/gen_music.py b/marketing/audio/gen_music.pynew file mode 100644index 0000000..6d92d9d--- /dev/null+++ b/marketing/audio/gen_music.py@@ -0,0 +1,87 @@+"""Generate background-music takes for the launch video with a local ACE-Step 1.5 API server.++Start the server first (D:/AI/ACE-Step-1.5): uv run acestep-api (listens on :8001)+Then: python gen_music.py [style ...] -> takes/<style>-<n>.wav++Every take is instrumental and a little longer than the video (~85 s), so it can fade out.+"""+import json+import sys+import time+import urllib.parse+import urllib.request+from pathlib import Path++API = "http://127.0.0.1:8001"+OUT = Path(__file__).parent / "takes"+DURATION = 92+TAKES = 4++STYLES = {+ "keynote": (+ "minimal modern electronic, instrumental, warm analog synth pads, soft plucked arpeggio, "+ "gentle punchy kick enters after the intro, builds gradually, clean and optimistic, "+ "tech product launch film, polished mix",+ 104,+ "D Major",+ ),+ "piano": (+ "cinematic instrumental, felt piano motif, soft strings, light electronic pulse, airy pads, "+ "slowly building, hopeful and calm, clean modern production",+ 96,+ "C Major",+ ),+ "house": (+ "deep melodic house, instrumental, warm sub bass, crisp hi-hats, dreamy chords, "+ "smooth and confident, steady groove, modern clean mix",+ 118,+ "A Minor",+ ),+}+++def call(path: str, body: dict | None = None) -> dict:+ req = urllib.request.Request(API + path, data=json.dumps(body).encode() if body is not None else None, headers={"Content-Type": "application/json"})+ 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", {+ "prompt": prompt,+ "lyrics": "[Instrumental]",+ "instrumental": True,+ "thinking": True,+ "bpm": bpm,+ "key_scale": key,+ "time_signature": "4",+ "audio_duration": DURATION,+ "batch_size": TAKES,+ "inference_steps": 8,+ "audio_format": "wav",+ })+ task_id = task["task_id"]+ t0 = time.time()+ while True:+ time.sleep(3)+ item = call("/query_result", {"task_id_list": [task_id]})[0]+ if item["status"] == 1:+ break+ if item["status"] == 2:+ raise RuntimeError(f"{style}: generation failed: {item}")+ 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}-{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")+++if __name__ == "__main__":+ for s in sys.argv[1:] or list(STYLES):+ generate(s)diff --git a/marketing/audio/gen_voice.py b/marketing/audio/gen_voice.pynew file mode 100644index 0000000..2fd021e--- /dev/null+++ b/marketing/audio/gen_voice.py@@ -0,0 +1,176 @@+"""Voiceover takes for the launch video, generated locally with Chatterbox (MIT, Resemble AI).++ D:/AI/tts/.venv/Scripts/python gen_voice.py [take ...] -> voice/<take>.wav+ D:/AI/tts/.venv/Scripts/python gen_voice.py --ref me.wav [take ...]+ D:/AI/tts/.venv/Scripts/python gen_voice.py final -> voice/final/NN.wav (approved take)++Each take reads the whole script (voiceover.md, one file per line too, in voice/<take>/NN.wav)+so takes can be compared on the same text. Without --ref the model's built-in voice is used;+--ref clones the timbre of a clean recording of at least 5-10 s (only use a voice you have the+right to use, e.g. your own).+"""+import argparse+import json+import re+import shutil+import subprocess+from pathlib import Path++import numpy as np+import soundfile as sf+import torch+import torchaudio.functional as F++HERE = Path(__file__).parent+OUT = HERE / "voice"+VIDEO = HERE.parent / "video"+SR = 24000+PAUSE = 0.9++# name: (model, exaggeration, cfg_weight, temperature)+TAKES = {+ "calm": ("base", 0.35, 0.5, 0.7),+ "warm": ("base", 0.5, 0.4, 0.8),+ "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 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+# delivery down. Per line: (take, seed[, {sentence index: (take, seed)}[, pauses]]).+FINAL = {+ 1: ("calmer", 61),+ 2: ("calmer", 11),+ 3: ("expressive", 11),+ 4: ("expressive", 11),+ 5: ("calmer", 11),+ 6: ("expressive", 31),+ 7: ("expressive", 21),+ 8: ("calmer", 11),+ 9: ("expressive", 31, {2: ("calmer", 71)}, [0.4, 0.55, 0.55]),+}+SENTENCE_PAUSE = 0.4+# Light voice-over master: rumble cut, de-ess, gentle compression. Loudness is set afterwards+# with one gain for all lines, so their relative levels stay as read.+MASTER = "aresample=48000,highpass=f=80,deesser=i=0.4,acompressor=threshold=-20dB:ratio=3:attack=5:release=90"+LUFS = -16.0+++def script_lines() -> list[str]:+ rows = [l for l in (HERE / "voiceover.md").read_text(encoding="utf-8").splitlines() if re.match(r"^\| \d+ \|", l)]+ return [r.split("|")[4].strip() for r in rows]+++_models: dict = {}+++def model(kind: str):+ if kind not in _models:+ if kind == "turbo":+ from chatterbox.tts_turbo import ChatterboxTurboTTS as M+ else:+ from chatterbox.tts import ChatterboxTTS as M+ _models[kind] = M.from_pretrained(device="cuda")+ return _models[kind]+++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)+ kw = dict(audio_prompt_path=str(ref) if ref else None, temperature=temp)+ if kind == "base":+ kw.update(exaggeration=exag, cfg_weight=cfg)+ with torch.inference_mode():+ wav = m.generate(text, **kw)+ return F.resample(wav, m.sr, SR).squeeze(0).cpu().numpy()+++def read(take: str, ref: Path | None, seed: int) -> None:+ lines = script_lines()+ gap = np.zeros(int(PAUSE * SR), dtype=np.float32)+ folder = OUT / take+ folder.mkdir(parents=True, exist_ok=True)+ parts = []+ for i, line in enumerate(lines, 1):+ a = say(take, line, ref, seed + i)+ sf.write(folder / f"{i:02d}.wav", a, SR)+ parts += [a, gap]+ audio = np.concatenate(parts).astype(np.float32)+ audio /= max(1e-6, np.abs(audio).max()) / 0.89+ sf.write(OUT / f"{take}.wav", audio, SR)+ print(f"{take}.wav {audio.size / SR:.1f} s", flush=True)+++def sentences(line: str) -> list[str]:+ return [s for s in re.split(r"(?<=[.?!])\s+", line) if s]+++def master(src: Path, dst: Path, gain_db: float = 0.0) -> None:+ # alimiter at -1.5 dBFS: the loudness gain would otherwise clip the peaks.+ af = MASTER if gain_db == 0 else f"volume={gain_db:.2f}dB,alimiter=limit=0.84:attack=5:release=50:level=0"+ subprocess.run(["ffmpeg", "-v", "error", "-y", "-i", str(src), "-af", af, str(dst)], check=True)+++def lufs(path: Path) -> float:+ r = subprocess.run(["ffmpeg", "-hide_banner", "-i", str(path), "-af", "ebur128", "-f", "null", "-"],+ capture_output=True, text=True)+ return float(re.findall(r"I:\s+(-?[\d.]+) LUFS", r.stderr)[-1])+++def final() -> None:+ """voice/final/NN.wav, one mastered file per line at -16 LUFS, plus final.wav to preview them in a row.++ Also copies the lines to the video (public/voice/NN.wav) with src/app/voice.json: each line's+ length and where each sentence starts and ends in it, so scenes can place single sentences.+ """+ folder = OUT / "final"+ (folder / "raw").mkdir(parents=True, exist_ok=True)+ spans: dict[int, dict] = {}+ for n, line in enumerate(script_lines(), 1):+ spec = FINAL[n]+ take, seed = spec[:2]+ swap = spec[2] if len(spec) > 2 else {}+ pauses = spec[3] if len(spec) > 3 else None+ parts = sentences(line)+ pauses = pauses or [SENTENCE_PAUSE] * (len(parts) - 1)+ chunks, marks, pos = [], [], 0+ for i, s in enumerate(parts):+ t, sd = swap.get(i, (take, seed + i))+ chunks.append(say(t, s, None, sd))+ marks.append([round(pos / SR, 3), round((pos + chunks[-1].size) / SR, 3)])+ pos += chunks[-1].size+ if i < len(pauses):+ chunks.append(np.zeros(int(pauses[i] * SR), dtype=np.float32))+ pos += chunks[-1].size+ spans[n] = {"dur": round(pos / SR, 3), "sentences": marks}+ raw = folder / "raw" / f"{n:02d}.wav"+ sf.write(raw, np.concatenate(chunks), SR)+ master(raw, folder / f"{n:02d}.wav")+ print(f"{n:02d} {sum(c.size for c in chunks) / SR:4.1f} s {line}", flush=True)+ files = [folder / f"{n:02d}.wav" for n in FINAL]+ gap = np.zeros(int(PAUSE * 48000), dtype=np.float32)+ preview = np.concatenate([x for f in files for x in (sf.read(f, dtype="float32")[0], gap)])+ sf.write(folder / "final.wav", preview, 48000)+ gain = LUFS - lufs(folder / "final.wav")+ for f in [*files, folder / "final.wav"]:+ tmp = f.with_suffix(".tmp.wav")+ master(f, tmp, gain)+ tmp.replace(f)+ print(f"final.wav {preview.size / 48000:.1f} s, gain {gain:+.1f} dB -> {lufs(folder / 'final.wav'):.1f} LUFS")+ (VIDEO / "public" / "voice").mkdir(parents=True, exist_ok=True)+ for f in files:+ shutil.copy(f, VIDEO / "public" / "voice" / f.name)+ (VIDEO / "src" / "app" / "voice.json").write_text(json.dumps(spans, indent=1) + "\n", encoding="utf-8")+ print("copied to video/public/voice, timings in video/src/app/voice.json")+++if __name__ == "__main__":+ ap = argparse.ArgumentParser()+ ap.add_argument("takes", nargs="*", default=list(TAKES))+ ap.add_argument("--ref", type=Path)+ ap.add_argument("--seed", type=int, default=11)+ a = ap.parse_args()+ for t in a.takes:+ final() if t == "final" else read(t, a.ref, a.seed)diff --git a/marketing/audio/make_sfx.py b/marketing/audio/make_sfx.pynew file mode 100644index 0000000..c759110--- /dev/null+++ b/marketing/audio/make_sfx.py@@ -0,0 +1,199 @@+"""Synthesizes the launch video's sound effects (no samples, no licences) into video/public/sfx.++Every sound is soft and short, shares one small room reverb so they read as one family, and+is meant to sit well under the music. Run with any Python that has numpy + scipy, e.g. the+ACE-Step venv: D:/AI/ACE-Step-1.5/.venv/Scripts/python make_sfx.py+"""+from pathlib import Path++import numpy as np+from scipy.io import wavfile+from scipy.signal import butter, fftconvolve, sosfilt++SR = 48000+OUT = Path(__file__).parent.parent / "video" / "public" / "sfx"+rng = np.random.default_rng(7)+++def t(sec: float) -> np.ndarray:+ return np.arange(int(sec * SR)) / SR+++def noise(sec: float) -> np.ndarray:+ return rng.standard_normal(int(sec * SR))+++def band(x: np.ndarray, lo: float, hi: float, order: int = 2) -> np.ndarray:+ return sosfilt(butter(order, [lo, hi], btype="band", fs=SR, output="sos"), x)+++def low(x: np.ndarray, f: float, order: int = 2) -> np.ndarray:+ return sosfilt(butter(order, f, btype="low", fs=SR, output="sos"), x)+++def env(n: int, attack: float, decay: float) -> np.ndarray:+ """Linear attack (s), then exponential decay with time constant `decay` (s)."""+ x = np.arange(n) / SR+ a = np.clip(x / max(attack, 1e-4), 0, 1)+ return a * np.exp(-np.maximum(x - attack, 0) / decay)+++def fade(x: np.ndarray, fin: float = 0.002, fout: float = 0.02) -> np.ndarray:+ x = x.copy()+ i, o = int(fin * SR), int(fout * SR)+ if i:+ x[:i] *= np.linspace(0, 1, i)+ if o:+ x[-o:] *= np.linspace(1, 0, o)+ return x+++# One small, dark room for everything.+_ir_t = t(0.45)+_ir = low(rng.standard_normal(_ir_t.size), 5000) * np.exp(-_ir_t / 0.11)+_ir /= np.abs(_ir).sum() / 6+++def room(x: np.ndarray, wet: float = 0.18) -> np.ndarray:+ """Stereo: dry signal plus slightly different reverb tails per side."""+ pad = np.concatenate([x, np.zeros(_ir.size)])+ l = fftconvolve(pad, _ir)[: pad.size]+ r = fftconvolve(pad, np.roll(_ir, 37))[: pad.size]+ return np.stack([pad + wet * l, pad + wet * r], axis=1)+++def save(name: str, x: np.ndarray, peak_db: float) -> None:+ if x.ndim == 1:+ x = room(x)+ x = low(x.T, 12000).T # keep the noise-based sounds soft on top+ x = x / np.abs(x).max() * 10 ** (peak_db / 20)+ OUT.mkdir(parents=True, exist_ok=True)+ wavfile.write(OUT / f"{name}.wav", SR, (x * 32767).astype(np.int16))+ print(f"{name}.wav {x.shape[0] / SR:.2f} s")+++def key_tap(pitch: float) -> np.ndarray:+ n = int(0.05 * SR)+ tick = band(rng.standard_normal(n), 1800 * pitch, 5200 * pitch) * env(n, 0.0005, 0.006)+ body = np.sin(2 * np.pi * 240 * pitch * t(0.05)) * env(n, 0.001, 0.012) * 0.5+ return tick + body+++def click() -> np.ndarray:+ n = int(0.08 * SR)+ tick = band(rng.standard_normal(n), 2500, 7000) * env(n, 0.0003, 0.004)+ body = np.sin(2 * np.pi * 1450 * t(0.08)) * env(n, 0.0005, 0.018) * 0.35+ thump = np.sin(2 * np.pi * 170 * t(0.08)) * env(n, 0.001, 0.02) * 0.6+ return fade(tick + body + thump)+++def typing(sec: float = 9.0) -> np.ndarray:+ """Irregular keystrokes, ~11 per second, a few heavier ones (space bar)."""+ out = np.zeros(int(sec * SR))+ pos = 0.02+ while pos < sec - 0.1:+ k = key_tap(rng.uniform(0.85, 1.2)) * rng.uniform(0.55, 1.0)+ if rng.random() < 0.15:+ k = key_tap(0.7) * 1.1+ i = int(pos * SR)+ out[i : i + k.size] += k[: out.size - i]+ pos += rng.uniform(0.055, 0.13)+ return out+++def send() -> np.ndarray:+ x = t(0.32)+ f = 520 + 520 * (x / x[-1]) ** 1.5+ tone = np.sin(2 * np.pi * np.cumsum(f) / SR) * env(x.size, 0.02, 0.08)+ air = band(noise(0.32), 2000, 8000) * env(x.size, 0.03, 0.06) * 0.25+ return fade(tone * 0.5 + air)+++def tone(f: float, sec: float, attack: float, decay: float, partials=((1, 1.0),)) -> np.ndarray:+ """A soft sine voice with a few partials and a slow, slight vibrato."""+ x = t(sec)+ v = 1 + 0.002 * np.sin(2 * np.pi * 4.5 * x)+ out = sum(np.sin(2 * np.pi * f * k * x * v) * w for k, w in partials)+ return out * env(x.size, attack, decay)+++def reveal(kind: str) -> np.ndarray:+ """A result appears: a breath of air that opens, with a low, warm note under it. Three+ variants (notes from A minor) take turns in the video so no two reveals in a row match."""+ sec = 1.6+ n = int(sec * SR)+ x = t(sec)+ if kind == "a": # airy swell upward, A3 + E4+ air = swish(0.9, 500, 2000, 2500, 8000)+ note = tone(220, sec, 0.03, 0.45, ((1, 1), (2, 0.25))) + tone(329.6, sec, 0.05, 0.4) * 0.45+ elif kind == "b": # breath falling, C4 + G4, a touch brighter+ air = swish(0.8, 2500, 8000, 600, 2500)+ note = tone(261.6, sec, 0.02, 0.38, ((1, 1), (3, 0.08))) + tone(392, sec, 0.04, 0.32) * 0.4+ else: # soft felt mallet, E4 with its octave, little air+ air = swish(0.6, 1200, 4000, 1500, 6000) * 0.6+ note = tone(329.6, sec, 0.008, 0.3, ((1, 1), (2, 0.35), (4, 0.05))) + tone(220, sec, 0.02, 0.5) * 0.35+ out = np.zeros(n)+ out[: air.size] += air * 0.5+ out += low(note, 3000) * 0.55+ return fade(out * np.clip(x / 0.012, 0, 1), 0.002, 0.3)+++def swish(sec: float, lo0: float, hi0: float, lo1: float, hi1: float) -> np.ndarray:+ """Noise through a moving band, rising then falling in level."""+ n = int(sec * SR)+ out = np.zeros(n)+ blocks = 48+ edges = np.linspace(0, n, blocks + 1).astype(int)+ src = noise(sec)+ for b in range(blocks):+ p = b / (blocks - 1)+ lo, hi = lo0 + (lo1 - lo0) * p, hi0 + (hi1 - hi0) * p+ seg = band(src[max(0, edges[b] - 2000) : edges[b + 1]], lo, hi)+ out[edges[b] : edges[b + 1]] = seg[-(edges[b + 1] - edges[b]) :]+ shape = np.sin(np.pi * np.linspace(0, 1, n)) ** 1.6+ return fade(low(out, 9000) * shape, 0.01, 0.05)+++def whoosh() -> np.ndarray:+ """Panned left to right: the transition between two examples."""+ x = swish(0.75, 250, 900, 1500, 6000)+ pan = np.linspace(0, 1, x.size)+ st = room(x, 0.25)[: 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 brush(sec: float = 3.6) -> np.ndarray:+ """Soft bristle texture with stroke-like level changes."""+ x = t(sec)+ strokes = 0.6 + 0.4 * np.sin(2 * np.pi * 1.7 * x) ** 2+ tex = band(noise(sec), 900, 4200) * strokes+ return fade(tex, 0.15, 0.3)+++def hit() -> np.ndarray:+ """Low, warm impact with a soft top: the mark appearing."""+ x = t(2.4)+ f = 48 + 60 * np.exp(-x / 0.05)+ sub = np.sin(2 * np.pi * np.cumsum(f) / SR) * env(x.size, 0.003, 0.7)+ top = low(noise(2.4), 2500) * env(x.size, 0.002, 0.08) * 0.35+ air = band(noise(2.4), 3000, 10000) * env(x.size, 0.25, 0.6) * 0.06+ return fade(sub + top + air, 0.001, 0.3)+++def riser(sec: float = 1.6) -> np.ndarray:+ """Short breath that swells into the next moment."""+ x = swish(sec, 300, 1200, 2500, 9000)+ return x * np.linspace(0.2, 1, x.size) ** 1.5+++if __name__ == "__main__":+ save("click", click(), -6)+ save("typing", typing(), -6)+ save("send", send(), -6)+ for k in "abc":+ save(f"reveal-{k}", reveal(k), -9)+ save("slider", swish(1.1, 500, 2500, 1200, 5000), -6)+ save("whoosh", whoosh(), -6)+ save("brush", brush(), -6)+ save("hit", hit(), -3)+ save("riser", riser(), -6)diff --git a/marketing/audio/voiceover.md b/marketing/audio/voiceover.mdnew file mode 100644index 0000000..3d46b63--- /dev/null+++ b/marketing/audio/voiceover.md@@ -0,0 +1,20 @@+# Voiceover script — v2 (approved 2026-10-10)++Tone: direct and plain-spoken, a little cheeky, confident. Short sentences, one idea each: the+app is yours and it stays on your PC. The Hook's "yours" comes back in the Outro. Times are the+scene windows in the current cut; the redesign times the scenes to these lines.++| # | Scene | Window | Line |+|---|---|---|---|+| 1 | Intro (the mark) | 0:00–0:03.4 | Introducing Kokon. |+| 2 | Hook (wall of edits) | 0:03.4–0:07.8 | Another image editor? Nope. This one is yours. |+| 3 | Create | 0:07.8–0:20.2 | Kokon runs on your PC, and everything stays there. Describe an image, and your graphics card makes it. No cloud. No account. No subscription. |+| 4 | Region | 0:20.2–0:38.2 | Want to change just one thing? Paint over it, and say what you want. Remove the scooter. Add a cat. Everything else stays exactly as it was. |+| 5 | Versions | 0:38.2–0:42.6 | Changed your mind? Every version is saved. |+| 6 | Montage | 0:42.6–1:00.7 | Change the season. Fix the sign. Restyle a portrait. Swap the furniture. Expand the frame. Shoot a product ad. One sentence each. |+| 7 | Agent | 1:00.7–1:09.4 | Use an AI agent? Kokon works with it too. Just ask for an image. |+| 8 | Hardware | 1:09.4–1:16.8 | Windows or Mac. NVIDIA, AMD, Intel or Apple silicon. It runs on what you have. |+| 9 | Outro | 1:16.8–1:24.7 | Kokon. Free, open source, and yours. Try it now. Your PC already knows what to do. |++About 130 words. The take is generated with `gen_voice.py final` (voice, seeds and pauses per+line are in FINAL there); files land in voice/final/, one per line, mastered to -16 LUFS.diff --git a/marketing/video/public/music.m4a b/marketing/video/public/music.m4anew file mode 100644index 0000000..511763aBinary files /dev/null and b/marketing/video/public/music.m4a differdiff --git a/marketing/video/public/sfx/brush.wav b/marketing/video/public/sfx/brush.wavnew file mode 100644index 0000000..2d9cd95Binary files /dev/null and b/marketing/video/public/sfx/brush.wav differdiff --git a/marketing/video/public/sfx/click.wav b/marketing/video/public/sfx/click.wavnew file mode 100644index 0000000..9ddbdf8Binary files /dev/null and b/marketing/video/public/sfx/click.wav differdiff --git a/marketing/video/public/sfx/hit.wav b/marketing/video/public/sfx/hit.wavnew file mode 100644index 0000000..15dcb4dBinary files /dev/null and b/marketing/video/public/sfx/hit.wav differdiff --git a/marketing/video/public/sfx/reveal-a.wav b/marketing/video/public/sfx/reveal-a.wavnew file mode 100644index 0000000..c005f2aBinary files /dev/null and b/marketing/video/public/sfx/reveal-a.wav differdiff --git a/marketing/video/public/sfx/reveal-b.wav b/marketing/video/public/sfx/reveal-b.wavnew file mode 100644index 0000000..ce69e14Binary files /dev/null and b/marketing/video/public/sfx/reveal-b.wav differdiff --git a/marketing/video/public/sfx/reveal-c.wav b/marketing/video/public/sfx/reveal-c.wavnew file mode 100644index 0000000..c0bc740Binary files /dev/null and b/marketing/video/public/sfx/reveal-c.wav differdiff --git a/marketing/video/public/sfx/riser.wav b/marketing/video/public/sfx/riser.wavnew file mode 100644index 0000000..60a5894Binary files /dev/null and b/marketing/video/public/sfx/riser.wav differdiff --git a/marketing/video/public/sfx/send.wav b/marketing/video/public/sfx/send.wavnew file mode 100644index 0000000..7566eceBinary files /dev/null and b/marketing/video/public/sfx/send.wav differdiff --git a/marketing/video/public/sfx/slider.wav b/marketing/video/public/sfx/slider.wavnew file mode 100644index 0000000..a3ec8bdBinary files /dev/null and b/marketing/video/public/sfx/slider.wav differdiff --git a/marketing/video/public/sfx/typing.wav b/marketing/video/public/sfx/typing.wavnew file mode 100644index 0000000..0ad37abBinary files /dev/null and b/marketing/video/public/sfx/typing.wav differdiff --git a/marketing/video/public/sfx/whoosh.wav b/marketing/video/public/sfx/whoosh.wavnew file mode 100644index 0000000..4685fb6Binary files /dev/null and b/marketing/video/public/sfx/whoosh.wav differdiff --git a/marketing/video/public/voice/01.wav b/marketing/video/public/voice/01.wavnew file mode 100644index 0000000..5f46bcaBinary files /dev/null and b/marketing/video/public/voice/01.wav differdiff --git a/marketing/video/public/voice/02.wav b/marketing/video/public/voice/02.wavnew file mode 100644index 0000000..4212fc5Binary files /dev/null and b/marketing/video/public/voice/02.wav differdiff --git a/marketing/video/public/voice/03.wav b/marketing/video/public/voice/03.wavnew file mode 100644index 0000000..fa780bfBinary files /dev/null and b/marketing/video/public/voice/03.wav differdiff --git a/marketing/video/public/voice/04.wav b/marketing/video/public/voice/04.wavnew file mode 100644index 0000000..ba07851Binary files /dev/null and b/marketing/video/public/voice/04.wav differdiff --git a/marketing/video/public/voice/05.wav b/marketing/video/public/voice/05.wavnew file mode 100644index 0000000..803e62aBinary files /dev/null and b/marketing/video/public/voice/05.wav differdiff --git a/marketing/video/public/voice/06.wav b/marketing/video/public/voice/06.wavnew file mode 100644index 0000000..1ec1667Binary files /dev/null and b/marketing/video/public/voice/06.wav differdiff --git a/marketing/video/public/voice/07.wav b/marketing/video/public/voice/07.wavnew file mode 100644index 0000000..0565b17Binary files /dev/null and b/marketing/video/public/voice/07.wav differdiff --git a/marketing/video/public/voice/08.wav b/marketing/video/public/voice/08.wavnew file mode 100644index 0000000..621cb5fBinary files /dev/null and b/marketing/video/public/voice/08.wav differdiff --git a/marketing/video/public/voice/09.wav b/marketing/video/public/voice/09.wavnew file mode 100644index 0000000..5552c55Binary files /dev/null and b/marketing/video/public/voice/09.wav differdiff --git a/marketing/video/src/Root.tsx b/marketing/video/src/Root.tsxindex 81a86fc..cc9438f 100644--- a/marketing/video/src/Root.tsx+++ b/marketing/video/src/Root.tsx@@ -8,6 +8,7 @@ import { Layout } from "./scenes/Layout";import { MAIN_FRAMES, Main } from "./scenes/Main";import { MONTAGE_FRAMES, Montage } from "./scenes/Montage";import { Hook, Intro } from "./scenes/Opening";+import { LENGTH } from "./app/timeline";const withPreload = (C: ComponentType) => () => (<>@@ -25,8 +26,8 @@ export function Root() {<Composition id="Agent" component={withPreload(Agent)} durationInFrames={AGENT_FRAMES} {...S} /><Composition id="Hardware" component={withPreload(Hardware)} durationInFrames={HARDWARE_FRAMES} {...S} /><Composition id="Outro" component={withPreload(Outro)} durationInFrames={OUTRO_FRAMES} {...S} />- <Composition id="Intro" component={withPreload(Intro)} durationInFrames={120} {...S} />- <Composition id="Hook" component={withPreload(Hook)} durationInFrames={150} {...S} />+ <Composition id="Intro" component={withPreload(Intro)} durationInFrames={LENGTH.intro} {...S} />+ <Composition id="Hook" component={withPreload(Hook)} durationInFrames={LENGTH.hook} {...S} /><Composition id="Create" component={withPreload(Create)} durationInFrames={CREATE_FRAMES} {...S} /><Composition id="Region" component={withPreload(Region)} durationInFrames={REGION_FRAMES} {...S} /><Composition id="Versions" component={withPreload(Versions)} durationInFrames={VERSIONS_FRAMES} {...S} />diff --git a/marketing/video/src/app/AppWindow.tsx b/marketing/video/src/app/AppWindow.tsxindex 2824d3f..a93b623 100644--- a/marketing/video/src/app/AppWindow.tsx+++ b/marketing/video/src/app/AppWindow.tsx@@ -6,54 +6,60 @@ import { ProjectTitle, Sidebar } from "../../../../src/components/Sidebar";import { Stage } from "../../../../src/components/Stage";import { IconButton } from "../../../../src/components/ui";import "../../../../src/styles.css";-import { setFrameState, type State } from "../mocks/store";+import { CompareSplitContext } from "../mocks/Compare";+import { FrameStateContext, setFrameState, type State } from "../mocks/store";import { Mark } from "./Mark";import "./theme.css";-export function AppWindow({ state, width, height, overlay, hideComposer, busy }: { state: State; width: number; height: number; overlay?: ReactNode; hideComposer?: boolean; busy?: boolean }) {+/** `split` is the before/after slider position for this frame (0–1). */+export function AppWindow({ state, width, height, overlay, hideComposer, busy, split = 0.5 }: { state: State; width: number; height: number; overlay?: ReactNode; hideComposer?: boolean; busy?: boolean; split?: number }) {setFrameState(state);const hasHistory = state.session.length > 1;return (- <div className="kokon-window" style={{ width, height }}>- <div className="win-titlebar">- <span className="win-icon">- <Mark size={11} color="#0d0d0d" />- </span>- Kokon- <span className="spacer" />- <span className="ctl"><Minus size={15} /></span>- <span className="ctl"><Square size={12} /></span>- <span className="ctl"><X size={15} /></span>- </div>- <div className="app">- {state.sidebar && <Sidebar />}- <div className="workspace">- <div className="topbar">- <div className="brand">- <ProjectTitle />- </div>- <div className="toolbar">- {hasHistory && (- <>- <IconButton title="Undo"><Undo2 size={18} /></IconButton>- <IconButton title="Redo" disabled><Redo2 size={18} /></IconButton>- </>- )}- <IconButton title="Private mode"><EyeOff size={18} /></IconButton>- <span className="status">- <span className="dot ready" />- <span>{busy ? "Working" : "Ready"}</span>- </span>- <IconButton title="Settings"><Settings size={18} /></IconButton>- </div>+ <FrameStateContext.Provider value={state}>+ <CompareSplitContext.Provider value={split}>+ <div className="kokon-window" style={{ width, height }}>+ <div className="win-titlebar">+ <span className="win-icon">+ <Mark size={11} color="#0d0d0d" />+ </span>+ Kokon+ <span className="spacer" />+ <span className="ctl"><Minus size={15} /></span>+ <span className="ctl"><Square size={12} /></span>+ <span className="ctl"><X size={15} /></span></div>- <div className="main">- <Stage />- {overlay}+ <div className="app">+ {state.sidebar && <Sidebar />}+ <div className="workspace">+ <div className="topbar">+ <div className="brand">+ <ProjectTitle />+ </div>+ <div className="toolbar">+ {hasHistory && (+ <>+ <IconButton title="Undo"><Undo2 size={18} /></IconButton>+ <IconButton title="Redo" disabled><Redo2 size={18} /></IconButton>+ </>+ )}+ <IconButton title="Private mode"><EyeOff size={18} /></IconButton>+ <span className="status">+ <span className="dot ready" />+ <span>{busy ? "Working" : "Ready"}</span>+ </span>+ <IconButton title="Settings"><Settings size={18} /></IconButton>+ </div>+ </div>+ <div className="main">+ <Stage />+ {overlay}+ </div>+ {!hideComposer && <Composer />}+ </div></div>- {!hideComposer && <Composer />}</div>- </div>- </div>+ </CompareSplitContext.Provider>+ </FrameStateContext.Provider>);}diff --git a/marketing/video/src/app/FullImage.tsx b/marketing/video/src/app/FullImage.tsxnew file mode 100644index 0000000..ea5f037--- /dev/null+++ b/marketing/video/src/app/FullImage.tsx@@ -0,0 +1,112 @@+// A result filling the frame, the way a finished image deserves to be seen: the picture as large+// as it fits over a blurred, dimmed copy of itself, a slow push-in, and the change shown by a+// soft wipe (`reveal`), a before/after handle (`split`) or, for an expanded image, the frame+// opening outward from the original (`expandFrom`).+import { Img, staticFile } from "remotion";++const src = (id: string) => staticFile(`img/${id}.jpg`);+const SIZE: Record<string, [number, number]> = {+ street: [2752, 1536],+ "street-removed": [2752, 1536],+ "street-cat": [2752, 1536],+ cabin: [2200, 1228],+ "cabin-winter": [2200, 1228],+ bakery: [2200, 1635],+ "bakery-text": [2200, 1635],+ potter: [1635, 2200],+ "potter-watercolor": [1635, 2200],+ room: [2200, 1635],+ "room-sofa": [2200, 1635],+ lighthouse: [1536, 1536],+ "lighthouse-wide": [2764, 1536],+ sneaker: [1536, 1536],+ "sneaker-ad": [1536, 1536],+};++/**+ * Where an image of aspect `ar` sits in the 1920×1080 frame: wide images fill it, others fit its+ * height; portraits sit right of centre, leaving the left side to the captions.+ */+export function fullBox(ar: number) {+ if (ar >= 1.7) return { x: 0, y: 0, w: 1920, h: 1080 };+ const h = 1080 - 120;+ const w = h * ar;+ const cx = ar < 1 ? 1200 : 960;+ return { x: cx - w / 2, y: 60, w, h };+}++export function FullImage({+ before,+ after,+ reveal = 0,+ split,+ push = 1,+ expandFrom,+ dim = 0,+}: {+ before: string;+ after?: string;+ /** 0–1: how far the after image has wiped in from the left. */+ reveal?: number;+ /** 0–1: before/after handle position (before on the left); replaces `reveal` when set. */+ split?: number;+ push?: number;+ /** For an outpaint: the before image's width as a fraction of the after image; reveal opens it. */+ expandFrom?: number;+ /** 0–1: darkens the picture under captions. */+ dim?: number;+}) {+ const main = after ?? before;+ const [w, h] = SIZE[main] ?? [16, 9];+ const box = fullBox(w / h);+ const pct = (v: number) => `${v * 100}%`;+ const img = (id: string, extra = {}) => <Img src={src(id)} style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", ...extra }} />;+ const edge = split ?? reveal;+ const showEdge = after && !expandFrom && (split !== undefined || (reveal > 0 && reveal < 1));+ return (+ <div style={{ position: "absolute", inset: 0, overflow: "hidden", background: "#050505" }}>+ {box.w < 1920 && (+ <div style={{ position: "absolute", inset: -80, filter: "blur(60px) brightness(0.32) saturate(1.2)" }}>+ {/* Fades with the wipe: switching at once makes the glow around the picture flicker. */}+ {img(before)}+ {after && img(after, { opacity: split !== undefined ? 1 - split : reveal })}+ </div>+ )}+ <div+ style={{+ position: "absolute",+ left: box.x,+ top: box.y,+ width: box.w,+ height: box.h,+ transform: `scale(${push})`,+ borderRadius: box.w < 1920 ? 18 : 0,+ overflow: "hidden",+ boxShadow: box.w < 1920 ? "0 40px 120px rgba(0,0,0,0.6)" : undefined,+ }}+ >+ {expandFrom ? (+ <>+ {/* The original sits in the middle; the expanded frame opens out to both sides. */}+ <div style={{ position: "absolute", inset: 0, background: "#050505" }} />+ {img(main, { clipPath: `inset(0 ${pct(((1 - expandFrom) / 2) * (1 - reveal))})` })}+ <div style={{ position: "absolute", top: 0, bottom: 0, left: pct((1 - expandFrom) / 2), width: pct(expandFrom), opacity: 1 - reveal }}>{img(before)}</div>+ </>+ ) : (+ <>+ {img(before)}+ {after && img(after, { clipPath: split !== undefined ? `inset(0 0 0 ${pct(split)})` : `inset(0 ${pct(1 - reveal)} 0 0)` })}+ </>+ )}+ {showEdge && (+ <div style={{ position: "absolute", top: 0, bottom: 0, left: pct(edge), width: 3, marginLeft: -1.5, background: "rgba(255,255,255,0.95)", boxShadow: "0 0 24px rgba(255,255,255,0.7)" }}>+ {split !== undefined && (+ <div style={{ position: "absolute", top: "50%", left: 1.5, width: 44, height: 44, margin: "-22px 0 0 -22px", borderRadius: 22, background: "rgba(255,255,255,0.95)", boxShadow: "0 6px 20px rgba(0,0,0,0.4)" }} />+ )}+ </div>+ )}+ {dim > 0 && <div style={{ position: "absolute", inset: 0, background: `rgba(0,0,0,${dim})` }} />}+ </div>+ </div>+ );+}diff --git a/marketing/video/src/app/motion.tsx b/marketing/video/src/app/motion.tsxindex 0903de2..468a41e 100644--- a/marketing/video/src/app/motion.tsx+++ b/marketing/video/src/app/motion.tsx@@ -31,10 +31,13 @@ export const typingDone = (text: string, start: number, cps = 32, fps = 30) => sexport interface Cam { x: number; y: number; s: number }-/** Puts window point (x, y) at the centre of the 1920×1080 frame, scaled by s. */-export function Camera({ cam, children, tilt = 0, lift = 0, opacity = 1 }: { cam: Cam; children: ReactNode; tilt?: number; lift?: number; opacity?: number }) {+/**+ * Puts window point (x, y) at the centre of the 1920×1080 frame, scaled by s. `free` lets a+ * macro shot show past the window's edges; `blur` (px) smears fast moves.+ */+export function Camera({ cam, children, tilt = 0, lift = 0, opacity = 1, free = false, blur = 0, turn }: { cam: Cam; children: ReactNode; tilt?: number; lift?: number; opacity?: number; free?: boolean; blur?: number; turn?: { x: number; y: number } }) {// Zoomed in further than the frame: never show past the window's edges.- const clamp = (v: number, half: number, size: number) => (cam.s * size >= half * 2 ? Math.min(Math.max(v, half / cam.s), size - half / cam.s) : v);+ const clamp = (v: number, half: number, size: number) => (!free && cam.s * size >= half * 2 ? Math.min(Math.max(v, half / cam.s), size - half / cam.s) : v);const x = clamp(cam.x, 960, WIN.w);const y = clamp(cam.y, 540, WIN.h);const px = 960 - cam.s * x;@@ -51,20 +54,95 @@ export function Camera({ cam, children, tilt = 0, lift = 0, opacity = 1 }: { camtransformOrigin: "0 0",transform: `translate(${px}px, ${py}px) scale(${cam.s}) rotateX(${tilt}deg)`,opacity,+ filter: blur > 0.3 ? `blur(${blur / cam.s}px)` : undefined,+ perspective: turn ? 2000 / cam.s : undefined,}}>- {children}+ {turn ? (+ // An angled view, turning about the point the camera looks at.+ <div style={{ position: "absolute", inset: 0, transformOrigin: `${x}px ${y}px`, transform: `rotateX(${turn.x}deg) rotateY(${turn.y}deg)` }}>{children}</div>+ ) : (+ children+ )}</div></div>);}-/** Interpolates a camera through keyframes [frame, cam]. */+/**+ * Shallow depth of field: the frame stays sharp in the band `focus` (frame y, px) and goes soft+ * above and below, like a macro lens. Renders `children` twice (soft copy under a sharp one).+ */+export function DepthOfField({ focus, blur = 7, feather = 150, children }: { focus: [number, number]; blur?: number; feather?: number; children: ReactNode }) {+ const [a, b] = focus;+ const mask = `linear-gradient(to bottom, transparent ${a - feather}px, #000 ${a}px, #000 ${b}px, transparent ${b + feather}px)`;+ return (+ <>+ <div style={{ position: "absolute", inset: 0, filter: `blur(${blur}px)` }}>{children}</div>+ <div style={{ position: "absolute", inset: 0, maskImage: mask, WebkitMaskImage: mask }}>{children}</div>+ </>+ );+}++/** How fast a camera moves at `frame` (frame px per frame), for motion blur. */+export function camSpeed(frame: number, at: (f: number) => Cam): number {+ const a = at(frame - 0.5);+ const b = at(frame + 0.5);+ const scale = Math.abs(Math.log(b.s / a.s)) * 900; // zoom: how far the frame edge travels+ return Math.hypot((b.x - a.x) * b.s, (b.y - a.y) * b.s) + scale;+}++/**+ * Monotone cubic (Fritsch–Carlson) through [frame, value] keys: glides through the inner keys+ * instead of stopping at each one, never overshoots, rests at the first and last key and+ * wherever a value turns or holds.+ */+export function glide(frame: number, points: [number, number][]): number {+ const n = points.length;+ if (frame <= points[0][0]) return points[0][1];+ if (frame >= points[n - 1][0]) return points[n - 1][1];+ const d = points.slice(1).map(([f1, v1], i) => (v1 - points[i][1]) / (f1 - points[i][0]));+ const m = points.map((_, i) => {+ if (i === 0 || i === n - 1) return 0;+ const a = d[i - 1];+ const b = d[i];+ if (a * b <= 0) return 0;+ const h0 = points[i][0] - points[i - 1][0];+ const h1 = points[i + 1][0] - points[i][0];+ return (3 * (h0 + h1)) / ((2 * h1 + h0) / a + (h1 + 2 * h0) / b);+ });+ let i = 1;+ while (frame > points[i][0]) i++;+ const [f0, v0] = points[i - 1];+ const [f1, v1] = points[i];+ const h = f1 - f0;+ const t = (frame - f0) / h;+ const t2 = t * t;+ const t3 = t2 * t;+ return (2 * t3 - 3 * t2 + 1) * v0 + (t3 - 2 * t2 + t) * h * m[i - 1] + (-2 * t3 + 3 * t2) * v1 + (t3 - t2) * h * m[i];+}++/** Moves a camera smoothly through keyframes [frame, cam]. */export function camAt(frame: number, keys: [number, Cam][]): Cam {- const k = (sel: (c: Cam) => number) => kf(frame, keys.map(([f, c]) => [f, sel(c)] as [number, number]));+ const k = (sel: (c: Cam) => number) => glide(frame, keys.map(([f, c]) => [f, sel(c)] as [number, number]));return { x: k((c) => c.x), y: k((c) => c.y), s: k((c) => c.s) };}+/**+ * Renders `view(frame)`; for `dur` frames after each frame in `cuts`, the view from just+ * before the cut stays on top and fades out, so a new screen state dissolves in instead of+ * replacing the old one in a single frame.+ */+export function Dissolve({ frame, cuts, view, dur = 9 }: { frame: number; cuts: number[]; view: (t: number) => ReactNode; dur?: number }) {+ const cut = cuts.find((c) => frame >= c && frame < c + dur);+ return (+ <>+ {view(frame)}+ {cut !== undefined && <div style={{ position: "absolute", inset: 0, opacity: 1 - prog(frame, cut, dur, inOut) }}>{view(cut - 1)}</div>}+ </>+ );+}+/** A mouse pointer in window coordinates; `clicks` are frames where it presses. */export function Pointer({ path, clicks = [], hideBefore = -1, hideAfter = 1e9 }: { path: [number, number, number][]; clicks?: number[]; hideBefore?: number; hideAfter?: number }) {const f = useCurrentFrame();diff --git a/marketing/video/src/app/sound.tsx b/marketing/video/src/app/sound.tsxnew file mode 100644index 0000000..9ef1cd1--- /dev/null+++ b/marketing/video/src/app/sound.tsx@@ -0,0 +1,89 @@+// The soundtrack: the voice-over (public/voice, see timeline.ts), the music bed (public/music.m4a,+// made locally with ACE-Step) and the sound effects (public/sfx, synthesized by+// marketing/audio/make_sfx.py), placed on the frames where things happen. Every level is here,+// so the mix can be tuned in one place.+import { Html5Audio, Sequence, staticFile } from "remotion";+import { CUES, cueFrames, cueSpan, FPS, type Cue } from "./timeline";++const LEVEL = {+ music: 0.62,+ voice: 1,+ click: 0.16,+ typing: 0.16,+ send: 0.16,+ reveal: 0.3,+ slider: 0.14,+ whoosh: 0.26,+ brush: 0.16,+ hit: 0.55,+ riser: 0.22,+} 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 };++type Base = Exclude<keyof typeof LEVEL, "music" | "voice" | "reveal">;+export type SfxName = Base | "reveal";++// Results appear with a soft reveal; three variants take turns (`variant`) so it never repeats+// back to back.+const REVEALS = ["reveal-a", "reveal-b", "reveal-c"] as const;++/** One effect from frame `at` of the current sequence; with `dur` it is cut short with a fade. */+export function Sfx({ name, at, dur, gain = 1, variant }: { name: SfxName; at: number; dur?: number; gain?: number; variant?: number }) {+ if (dur !== undefined && dur <= 0) return null;+ const level = LEVEL[name] * gain;+ const file = name === "reveal" ? REVEALS[(variant ?? 0) % REVEALS.length] : name;+ return (+ <Sequence from={Math.round(at)} durationInFrames={dur} layout="none" name={`sfx:${file}`}>+ <Html5Audio src={staticFile(`sfx/${file}.wav`)} volume={(f) => (dur === undefined ? level : level * Math.min(1, (dur - f) / 6))} />+ </Sequence>+ );+}++/** A click with the soft "send" swell on top: a request leaves. */+export const Send = ({ at }: { at: number }) => (+ <>+ <Sfx name="click" at={at} />+ <Sfx name="send" at={at + 1} />+ </>+);++/** One voice-over cue: its sentences cut from the line's file, with 2-frame fades at the edges. */+function Say({ c }: { c: Cue }) {+ const [a] = cueSpan(c);+ const n = cueFrames(c);+ return (+ <Sequence from={c.at} durationInFrames={n} layout="none" name={`voice ${c.line}.${c.from}`}>+ <Html5Audio+ src={staticFile(`voice/${String(c.line).padStart(2, "0")}.wav`)}+ trimBefore={Math.round(a * FPS)}+ volume={(f) => LEVEL.voice * Math.min(1, f / 2, (n - f) / 2)}+ />+ </Sequence>+ );+}++export const Voice = () => (+ <>+ {CUES.map((c) => (+ <Say key={`${c.line}.${c.from}`} c={c} />+ ))}+ </>+);++/** 1 with no voice, DUCK.level while the voice speaks, with smooth ramps around each cue. */+function duck(f: number): number {+ let d = 0;+ for (const c of CUES) {+ const a = c.at;+ const b = c.at + cueFrames(c);+ const v = f < a ? 1 - (a - f) / DUCK.attack : f > b ? 1 - (f - b) / DUCK.release : 1;+ d = Math.max(d, Math.min(1, Math.max(0, v)));+ }+ return 1 - (1 - DUCK.level) * d;+}++/** Music for the whole film, under the voice, fading out over the last `fadeOut` frames. */+export function Music({ frames, fadeOut = 45 }: { frames: number; fadeOut?: number }) {+ return <Html5Audio src={staticFile("music.m4a")} volume={(f) => LEVEL.music * duck(f) * Math.min(1, Math.max(0, (frames - f) / fadeOut))} />;+}diff --git a/marketing/video/src/app/timeline.ts b/marketing/video/src/app/timeline.tsnew file mode 100644index 0000000..87c915e--- /dev/null+++ b/marketing/video/src/app/timeline.ts@@ -0,0 +1,111 @@+// The film's clock: where each scene starts, where each voice-over sentence plays, and the+// music's beat grid. Scenes read their cue frames from here, so pictures, voice and music move+// together when one of them is retimed. All values are frames at 30 fps, on the main timeline.+import voice from "./voice.json";++export const FPS = 30;+/** Cross-fade between scenes that fade in (the others cut). */+export const FADE = 18;++/** Scene lengths; the start of each follows from the one before. */+export const LENGTH = {+ intro: 120,+ hook: 150,+ create: 384,+ region: 475,+ versions: 155,+ montage: 597,+ agent: 300,+ hardware: 240,+ outro: 240,+} as const;+export type SceneName = keyof typeof LENGTH;+export const FADES_IN: Record<SceneName, boolean> = {+ intro: false,+ hook: true,+ create: true,+ region: false,+ versions: false,+ montage: true,+ agent: true,+ hardware: true,+ outro: true,+};++export const START = {} as Record<SceneName, number>;+let at = 0;+for (const name of Object.keys(LENGTH) as SceneName[]) {+ if (FADES_IN[name] && at > 0) at -= FADE;+ START[name] = at;+ at += LENGTH[name];+}+export const TOTAL = at;++// Music (public/music.m4a, 118 BPM): one beat grid through the whole track, measured with+// librosa's onset envelope. The drop the Agent scene lands on is beat 102 (60.3 s), the outro+// accent beat 135 (77.1 s).+const BEAT0 = 8.45;+const BEAT = 60 / 118;+export const beatFrame = (k: number) => Math.round((BEAT0 + k * BEAT) * FPS);++// ---------------------------------------------------------------------------------------------+// Voice-over: public/voice/NN.wav from marketing/audio/gen_voice.py; voice.json holds where each+// sentence starts and ends in its file (seconds).+// ---------------------------------------------------------------------------------------------+type Lines = Record<string, { dur: number; sentences: [number, number][] }>;+const LINES = voice as unknown as Lines;++/** A piece of one line: sentences `from`..`to` (inclusive), starting at main-timeline frame `at`. */+export interface Cue {+ line: number;+ from: number;+ to: number;+ at: number;+}++/** Seconds into the line's file where the cue's sentences start and end. */+export function cueSpan(c: Cue): [number, number] {+ const s = LINES[String(c.line)].sentences;+ return [s[c.from][0], s[c.to][1]];+}+export const cueFrames = (c: Cue) => Math.ceil((cueSpan(c)[1] - cueSpan(c)[0]) * FPS);+/** Frame (main timeline) where sentence `i` of the cue's line starts, when played from this cue. */+export const sentenceAt = (c: Cue, i: number) => c.at + Math.round((LINES[String(c.line)].sentences[i][0] - cueSpan(c)[0]) * FPS);++const cue = (scene: SceneName, line: number, local: number, from = 0, to = from): Cue => ({ line, from, to, at: START[scene] + local });+const all = (scene: SceneName, line: number, local: number): Cue => cue(scene, line, local, 0, LINES[String(line)].sentences.length - 1);++// Scene-local frames where things happen that the voice names. Scenes import these too.+export const CREATE = { ask: 100, send: 172, done: 232, flyIn: 236, promises: 252 };+// Shot changes (removeCut, removeShot, addCut, addShot) and the scene's end sit on beats.+export const REGION = { paint: 46, paint1: 130, removeCut: 138, remove: 150, removeSend: 177, removeShot: 185, addCut: 246, add: 256, addSend: 298, addShot: 307, same: 344 };+export const MONTAGE_EDIT = 91.5; // 1.5 bars+export const MONTAGE = { edits: 6, mosaic: 549 };+export const AGENT = { works: 83, ask: 150 };+export const OUTRO = { try: 102, knows: 144 };++export const CUES: Cue[] = [+ all("intro", 1, 38),+ all("hook", 2, 15),+ cue("create", 3, 12, 0),+ cue("create", 3, CREATE.ask, 1),+ cue("create", 3, CREATE.promises, 2, 4),+ cue("region", 4, 6, 0),+ cue("region", 4, 58, 1),+ cue("region", 4, REGION.remove, 2),+ cue("region", 4, REGION.add, 3),+ cue("region", 4, REGION.same, 4),+ all("versions", 5, 10),+ ...Array.from({ length: MONTAGE.edits }, (_, i) => cue("montage", 6, Math.round(i * MONTAGE_EDIT) + 4, i)),+ cue("montage", 6, MONTAGE.mosaic + 3, 6),+ cue("agent", 7, 14, 0),+ cue("agent", 7, AGENT.works, 1),+ cue("agent", 7, AGENT.ask, 2),+ all("hardware", 8, 6),+ cue("outro", 9, 4, 0, 1),+ cue("outro", 9, OUTRO.try, 2),+ cue("outro", 9, OUTRO.knows, 3),+];++/** The cues of a scene with their start in scene-local frames. */+export const sceneCues = (scene: SceneName) => CUES.filter((c) => c.at >= START[scene] && c.at < START[scene] + LENGTH[scene]).map((c) => ({ ...c, at: c.at - START[scene] }));diff --git a/marketing/video/src/app/voice.json b/marketing/video/src/app/voice.jsonnew file mode 100644index 0000000..61351c2--- /dev/null+++ b/marketing/video/src/app/voice.json@@ -0,0 +1,179 @@+{+ "1": {+ "dur": 1.28,+ "sentences": [+ [+ 0.0,+ 1.28+ ]+ ]+ },+ "2": {+ "dur": 4.04,+ "sentences": [+ [+ 0.0,+ 1.16+ ],+ [+ 1.56,+ 2.12+ ],+ [+ 2.52,+ 4.04+ ]+ ]+ },+ "3": {+ "dur": 9.84,+ "sentences": [+ [+ 0.0,+ 2.52+ ],+ [+ 2.92,+ 5.72+ ],+ [+ 6.12,+ 7.16+ ],+ [+ 7.56,+ 8.36+ ],+ [+ 8.76,+ 9.84+ ]+ ]+ },+ "4": {+ "dur": 9.6,+ "sentences": [+ [+ 0.0,+ 1.4+ ],+ [+ 1.8,+ 3.76+ ],+ [+ 4.16,+ 5.4+ ],+ [+ 5.8,+ 6.76+ ],+ [+ 7.16,+ 9.6+ ]+ ]+ },+ "5": {+ "dur": 2.92,+ "sentences": [+ [+ 0.0,+ 1.0+ ],+ [+ 1.4,+ 2.92+ ]+ ]+ },+ "6": {+ "dur": 10.52,+ "sentences": [+ [+ 0.0,+ 1.28+ ],+ [+ 1.68,+ 2.56+ ],+ [+ 2.96,+ 4.24+ ],+ [+ 4.64,+ 5.72+ ],+ [+ 6.12,+ 7.36+ ],+ [+ 7.76,+ 8.92+ ],+ [+ 9.32,+ 10.52+ ]+ ]+ },+ "7": {+ "dur": 5.08,+ "sentences": [+ [+ 0.0,+ 1.28+ ],+ [+ 1.68,+ 3.32+ ],+ [+ 3.72,+ 5.08+ ]+ ]+ },+ "8": {+ "dur": 6.96,+ "sentences": [+ [+ 0.0,+ 1.64+ ],+ [+ 2.04,+ 5.24+ ],+ [+ 5.64,+ 6.96+ ]+ ]+ },+ "9": {+ "dur": 6.98,+ "sentences": [+ [+ 0.0,+ 0.68+ ],+ [+ 1.08,+ 3.0+ ],+ [+ 3.55,+ 4.43+ ],+ [+ 4.98,+ 6.98+ ]+ ]+ }+}diff --git a/marketing/video/src/mocks/Compare.tsx b/marketing/video/src/mocks/Compare.tsxindex 2fb397d..53f501d 100644--- a/marketing/video/src/mocks/Compare.tsx+++ b/marketing/video/src/mocks/Compare.tsx@@ -1,5 +1,7 @@// The app's CompareFrame (src/components/Compare.tsx) with the slider position taken from the-// frame clock (`setCompareSplit`) instead of the pointer. Markup and classes are unchanged.+// frame clock (`CompareSplitContext`, provided by <AppWindow>) instead of the pointer. Markup and+// classes are unchanged.+import { createContext, useContext } from "react";import { compareBase as _cb, type CompareBase, type CompareMode } from "../../../../src/lib/logic";import type { GenerationRecord } from "../../../../src/lib/types";import { Seg, useFit } from "../../../../src/components/ui";@@ -15,13 +17,11 @@ const MODES: { value: CompareMode; label: string }[] = [{ value: "diff", label: "Changes" },];-let split = 0.5;-export function setCompareSplit(v: number) {- split = Math.min(1, Math.max(0, v));-}+export const CompareSplitContext = createContext(0.5);export function CompareFrame({ g, base, fullscreen = false }: { g: GenerationRecord; base: CompareBase; fullscreen?: boolean }) {const mode = useStore((s) => s.compare);+ const split = Math.min(1, Math.max(0, useContext(CompareSplitContext)));const { ref, box } = useFit(g.width / g.height);const after = urls.gen(g.id);const before = urls.input(base.inputId);diff --git a/marketing/video/src/mocks/store.ts b/marketing/video/src/mocks/store.tsindex 8ca1491..75948f1 100644--- a/marketing/video/src/mocks/store.ts+++ b/marketing/video/src/mocks/store.ts@@ -1,5 +1,9 @@// The app's real store, except that components read the state computed for the current frame-// (set by <AppWindow> right before it renders) instead of the live global state.+// instead of the live global state. Each <AppWindow> provides its own state through context, so+// two windows on screen at once (cross-fades) never read each other's state, even when a+// component re-renders after layout. `getState()` (event handlers, a few renders) gets the+// state of the window rendered last.+import { createContext, useContext } from "react";import * as real from "../../../../src/lib/store";export * from "../../../../src/lib/store";@@ -12,6 +16,7 @@ export function setFrameState(s: real.State) {export function getState(): real.State {return frameState;}+export const FrameStateContext = createContext<real.State | null>(null);export function useStore<T>(sel: (s: real.State) => T): T {- return sel(frameState);+ return sel(useContext(FrameStateContext) ?? frameState);}diff --git a/marketing/video/src/scenes/Agent.tsx b/marketing/video/src/scenes/Agent.tsxindex 09a6b41..e9c0234 100644--- a/marketing/video/src/scenes/Agent.tsx+++ b/marketing/video/src/scenes/Agent.tsx@@ -1,8 +1,10 @@// An AI agent in a terminal asks Kokon's MCP server for an image; the image arrives.import { AbsoluteFill, Img, interpolate, staticFile, useCurrentFrame } from "remotion";-import { Backdrop, Caption, inOut, prog, typed, typingDone } from "../app/motion";+import { Backdrop, Caption, inOut, prog, typed } from "../app/motion";+import { Send, Sfx } from "../app/sound";+import { AGENT, LENGTH } from "../app/timeline";-export const AGENT_FRAMES = 280;+export const AGENT_FRAMES = LENGTH.agent;const mono = '"Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", monospace';const ASK = "Make a hero image for my landing page: a blue morpho butterfly on a silk cocoon, 16:9";@@ -16,8 +18,7 @@ function Line({ show, children, color = "#d6d6d6", indent = 0 }: { show: number;export function Agent() {const f = useCurrentFrame();const T0 = 22;- const T1 = typingDone(ASK, T0, 55);- const CALL = T1 + 14;+ const CALL = AGENT.works; // "Kokon works with it too."const STEPS0 = CALL + 26;const SAVED = STEPS0 + 48;const REPLY = SAVED + 16;@@ -98,6 +99,8 @@ export function Agent() {<div style={{ position: "absolute", left: 16, bottom: 14, padding: "4px 10px", borderRadius: 8, background: "rgba(0,0,0,0.55)", color: "#fff", fontSize: 14, fontFamily: '"Inter Variable", Inter, sans-serif' }}>hero.png</div></div><Caption title="Works with your AI agent." sub="Built-in MCP server and local HTTP API, for Claude Code, Cursor or any MCP client." start={10} end={AGENT_FRAMES} y={86} />+ <Send at={CALL} />+ <Sfx name="reveal" at={SAVED} variant={2} /></AbsoluteFill>);}diff --git a/marketing/video/src/scenes/AppScenes.tsx b/marketing/video/src/scenes/AppScenes.tsxindex f929a58..a11d0af 100644--- a/marketing/video/src/scenes/AppScenes.tsx+++ b/marketing/video/src/scenes/AppScenes.tsx@@ -1,12 +1,16 @@// The app in use, through its own components: create an image from a sentence, paint an area-// and remove what is in it, add something, and the version timeline.+// and remove what is in it, add something, and the version timeline. The voice leads: each+// action lands on the sentence that names it (cue frames in app/timeline.ts). Shots hold still+// and change by cutting, finished images are shown full frame.import type { ReactNode } from "react";import { AbsoluteFill, useCurrentFrame } from "remotion";import { AppWindow } from "../app/AppWindow";import { appState, gen, genItem, jobItem, PROJECTS, PROMPTS, ref } from "../app/fixtures";+import { FullImage } from "../app/FullImage";import { imageBox, InpaintOverlay, strokePoints } from "../app/InpaintOverlay";-import { Backdrop, Camera, camAt, Caption, kf, Pointer, prog, typed, typingDone, Vignette } from "../app/motion";-import { setCompareSplit } from "../mocks/Compare";+import { Backdrop, type Cam, Camera, camAt, camSpeed, Caption, DepthOfField, Dissolve, inOut, kf, Pointer, prog, typed, typingDone, Vignette } from "../app/motion";+import { Send, Sfx } from "../app/sound";+import { CREATE, LENGTH, REGION, sceneCues, sentenceAt } from "../app/timeline";import type { State } from "../mocks/store";const inpaintReq = (prompt: string, from: string, action: "remove" | "add") => ({@@ -26,80 +30,147 @@ const withProject = (count: number, cover: string): State["projects"] => [{ ...Sconst proj = (n: number, cover: string) => ({ projects: withProject(n, cover), projectId: "current" });const SEND: [number, number] = [1232, 857];+/** The composer, close: a macro shot past the window's bottom edge, sharp on the composer only. */+const COMPOSER_CAM: Cam = { x: 850, y: 742, s: 1.8 };+const COMPOSER_FOCUS: [number, number] = [520, 830];+/** The empty project's composer is shorter and lower: centre it. */+const PROMPT_CAM: Cam = { x: 850, y: 650, s: 1.7 };+/** Composer shots look at the window from slightly below and to the side. */+const ANGLE = { x: 16, y: -14 };+const PROMPT_FOCUS: [number, number] = [780, 1000];+/** Where the stage image sits once a result is selected (window px), to fly into it. */+const STAGE_IMG = { x: 850, y: 319, w: 820 };/** Steps of a job advancing from `start`, one every `every` frames. */const stepAt = (f: number, start: number, every: number) => Math.max(0, Math.min(8, Math.floor((f - start) / every) + 1));+/** Big centred words that rise in with the voice and leave with the next ones. */+function Words({ items, end }: { items: { text: string; at: number }[]; end: number }) {+ const f = useCurrentFrame();+ return (+ <>+ {items.map((w, i) => {+ const to = items[i + 1]?.at ?? end;+ if (f < w.at - 2 || f > to + 2) return null;+ const a = prog(f, w.at - 2, 14);+ const b = i < items.length - 1 ? prog(f, to - 6, 8, inOut) : prog(f, end - 10, 10, inOut);+ return (+ <div key={w.text} style={{ position: "absolute", inset: 0, display: "grid", placeItems: "center", pointerEvents: "none" }}>+ <div style={{ fontFamily: '"Inter Variable", Inter, sans-serif', fontSize: 104, fontWeight: 660, color: "#f4f4f2", letterSpacing: "-0.045em", textShadow: "0 6px 40px rgba(0,0,0,0.7)", opacity: a * (1 - b), transform: `translateY(${(1 - a) * 26 - b * 18}px)`, filter: `blur(${(1 - a) * 10 + b * 8}px)` }}>+ {w.text}+ </div>+ </div>+ );+ })}+ </>+ );+}++/** A small keyword in the lower left, for a shot whose action the voice names. */+const Tag = ({ text, start, end }: { text: string; start: number; end: number }) => <Caption title={text} start={start} end={end} y={930} size={48} />;+// ----------------------------------------------------------------------------------------// Create: an empty project, a sentence, the image.+// Create: the window arrives, a sentence is typed, the image is made, and the camera flies+// into it. "No cloud. No account. No subscription." over the finished picture.// ----------------------------------------------------------------------------------------export const CREATE_FRAMES = 390;+export const CREATE_FRAMES = LENGTH.create;export function Create() {const f = useCurrentFrame();const base = appState();- const T0 = 44;- const T1 = typingDone(PROMPTS.street, T0, 46);- const SEND_AT = T1 + 14;+ const cues = sceneCues("create");+ const T0 = CREATE.ask;+ const T1 = typingDone(PROMPTS.street, T0, 80);+ const SEND_AT = CREATE.send;const JOB = SEND_AT + 2;- const DONE = JOB + 92;-- let state: State;- if (f < JOB) {- state = appState({ composer: { ...base.composer, prompt: typed(PROMPTS.street, f, T0, 46) } });- } else if (f < DONE) {- const j = jobItem("j-street", "generate", PROMPTS.street, "street", undefined, stepAt(f, JOB + 10, 10));- state = appState({ session: [j.item], selected: "j-street", jobs: { "j-street": j.job }, ...proj(1, "gen:street") });- } else {- state = appState({ session: [genItem(STREET)], selected: "street", ...proj(1, "gen:street") });- }+ const DONE = CREATE.done;+ const FLY = CREATE.flyIn;+ const FULL = FLY + 22;++ const view = (t: number) => {+ let state: State;+ if (t < JOB) {+ state = appState({ composer: { ...base.composer, prompt: typed(PROMPTS.street, t, T0, 80) } });+ } else if (t < DONE) {+ const j = jobItem("j-street", "generate", PROMPTS.street, "street", undefined, stepAt(t, JOB + 6, 6));+ state = appState({ session: [j.item], selected: "j-street", jobs: { "j-street": j.job }, ...proj(1, "gen:street") });+ } else {+ state = appState({ session: [genItem(STREET)], selected: "street", ...proj(1, "gen:street") });+ }+ return <AppWindow state={state} width={1440} height={900} busy={t >= JOB && t < DONE} />;+ };const enter = prog(f, 0, 34);- const cam = camAt(f, [+ const camKeys: [number, Cam][] = [[0, { x: 720, y: 450, s: 1.02 }],- [34, { x: 720, y: 450, s: 1.12 }],- [70, { x: 850, y: 700, s: 1.5 }],- [T1, { x: 850, y: 720, s: 1.5 }],- [JOB + 14, { x: 850, y: 430, s: 1.22 }],- [DONE, { x: 850, y: 400, s: 1.24 }],- [CREATE_FRAMES, { x: 850, y: 330, s: 1.42 }],- ]);+ [40, { x: 720, y: 450, s: 1.1 }],+ [92, PROMPT_CAM],+ [SEND_AT, { ...PROMPT_CAM, s: 1.86 }],+ [SEND_AT + 30, { x: 850, y: 330, s: 1.3 }],+ [FLY, { x: 850, y: 325, s: 1.34 }],+ [FULL, { x: STAGE_IMG.x, y: STAGE_IMG.y, s: 1920 / STAGE_IMG.w }],+ ];+ const at = (t: number) => camAt(t, camKeys);+ const cam = at(f);+ // Sharp on the composer while typing; the whole window once the image is being made.+ const dof = prog(f, 70, 20) * (1 - prog(f, SEND_AT + 2, 16));+ const app = (+ <Camera cam={cam} tilt={(1 - enter) * 16} lift={(1 - enter) * 260} opacity={enter} free={f > 60 && f < SEND_AT + 30} turn={{ x: ANGLE.x * dof, y: ANGLE.y * dof }} blur={f > FLY ? camSpeed(f, at) * 0.12 : 0}>+ <Dissolve frame={f} cuts={[JOB, DONE]} view={view} dur={10} />+ <Pointer+ path={[+ [56, 980, 700],+ [88, 640, 812],+ [112, 1080, 880],+ [SEND_AT - 16, 1120, 880],+ [SEND_AT - 2, SEND[0], SEND[1]],+ [SEND_AT + 24, 1260, 700],+ ]}+ clicks={[90, SEND_AT]}+ hideBefore={56}+ hideAfter={SEND_AT + 26}+ />+ </Camera>+ );+ const full = prog(f, FULL - 6, 8, inOut);+ const words = cues.find((c) => c.from === 2)!;return (<AbsoluteFill><Backdrop />- <Camera cam={cam} tilt={(1 - enter) * 16} lift={(1 - enter) * 260} opacity={enter}>- <AppWindow state={state} width={1440} height={900} busy={f >= JOB && f < DONE} />- <Pointer- path={[- [20, 980, 560],- [42, 640, 806],- [T1, 650, 806],- [SEND_AT - 2, SEND[0], SEND[1]],- [SEND_AT + 30, 1260, 640],- ]}- clicks={[42, SEND_AT]}- hideBefore={20}- hideAfter={SEND_AT + 40}- />- </Camera>- <Vignette strength={prog(f, 50, 12) * (1 - prog(f, T1, 12))} side="top" />- <Vignette strength={prog(f, JOB, 12)} />- <Caption title="Describe it." sub="Any image, in plain words." start={56} end={T1 + 10} y={84} />- <Caption title="Made on your own GPU." sub="Qwen-Image 2.1 Turbo · 2752×1536 in 38 s on an RTX 5070 Ti (sped up here)" start={JOB + 6} end={CREATE_FRAMES} />+ {dof > 0.01 ? <DepthOfField focus={PROMPT_FOCUS} blur={7 * dof}>{app}</DepthOfField> : app}+ {f >= FULL - 6 && (+ <div style={{ position: "absolute", inset: 0, opacity: full }}>+ <FullImage before="street" push={1 + prog(f, FULL, LENGTH.create - FULL, (x) => x) * 0.06} dim={0.25 * prog(f, CREATE.promises - 8, 12)} />+ </div>+ )}+ <Vignette strength={prog(f, JOB, 12) * (1 - full)} />+ <Caption title="Made on your own GPU." sub="Qwen-Image 2.1 Turbo · 2752×1536 in 38 s on an RTX 5070 Ti (sped up here)" start={JOB + 8} end={FLY} size={48} />+ <Words+ items={[+ { text: "No cloud.", at: sentenceAt(words, 2) },+ { text: "No account.", at: sentenceAt(words, 3) },+ { text: "No subscription.", at: sentenceAt(words, 4) },+ ]}+ end={LENGTH.create - 4}+ />+ <Sfx name="click" at={90} />+ <Sfx name="typing" at={T0} dur={T1 - T0} />+ <Send at={SEND_AT} />+ <Sfx name="reveal" at={DONE} variant={0} />+ <Sfx name="whoosh" at={FLY - 4} gain={0.8} /></AbsoluteFill>);}// ----------------------------------------------------------------------------------------// Region: paint the scooter, Remove, result with a sweeping before/after slider; then Add.+// Region: paint the scooter; cut to the composer, Remove; the result full frame. Cut back,+// Add a cat; full frame again, then a before/after handle against the very first image.// ----------------------------------------------------------------------------------------export const REGION_FRAMES = 540;+export const REGION_FRAMES = LENGTH.region;const STROKE: [number, number][] = [[0.47, 0.52], [0.62, 0.49], [0.665, 0.58], [0.475, 0.6], [0.455, 0.7], [0.67, 0.68], [0.68, 0.78], [0.46, 0.8], [0.465, 0.9], [0.665, 0.88], [0.62, 0.965], [0.5, 0.965],];const AR = 2752 / 1536;-const DONE_BTN: [number, number] = [1086, 864];-const PAINT_BTN: [number, number] = [1086, 762];const REMOVE_SEG: [number, number] = [581, 857];const ADD_SEG: [number, number] = [689, 857];const CAT_PROMPT = "a ginger cat sitting on the cobblestones";@@ -107,137 +178,148 @@ const CAT_PROMPT = "a ginger cat sitting on the cobblestones";export function Region() {const f = useCurrentFrame();const base = appState();- const OPEN = 40;- const PAINT0 = 62;- const PAINT1 = 160;- const DONE_AT = 182;- const REMOVE_AT = 212;- const TY0 = 222;- const TY1 = typingDone(PROMPTS.remove, TY0, 26);- const SEND_AT = TY1 + 12;- const JOB = SEND_AT + 2;- const RESULT = JOB + 66;- const ADD0 = RESULT + 110; // second edit: add a cat- const ADD_TY = ADD0 + 26;- const ADD_TY1 = typingDone(CAT_PROMPT, ADD_TY, 60);- const ADD_SEND = ADD_TY1 + 8;- const ADD_RESULT = ADD_SEND + 44;-- const mask = { inputId: "mask", refKey: "ref-street" };- let state: State;- let overlay: ReactNode = null;- let split = 0.5;- const paint = prog(f, PAINT0, PAINT1 - PAINT0, (t) => t);- if (f < DONE_AT) {- state = appState({ session: [genItem(STREET)], selected: "street", composer: { ...base.composer, refs: [ref("street")] }, ...proj(1, "gen:street") });- if (f >= OPEN) overlay = <InpaintOverlay id="street" aspect={AR} points={STROKE} p={paint} brush={74} opacity={prog(f, OPEN, 8)} />;- } else if (f < JOB) {- state = appState({- session: [genItem(STREET)],- selected: "street",- composer: { ...base.composer, refs: [ref("street")], mask, inpaintAction: f >= REMOVE_AT ? "remove" : "edit", prompt: typed(PROMPTS.remove, f, TY0, 26) },- ...proj(1, "gen:street"),- });- } else if (f < RESULT) {- const j = jobItem("j-rm", "inpaint", PROMPTS.remove, "street-removed", "street", stepAt(f, JOB + 8, 7), "remove");- state = appState({ session: [genItem(STREET), j.item], selected: "j-rm", jobs: { "j-rm": j.job }, composer: { ...base.composer, refs: [ref("street")] }, ...proj(2, "gen:street") });- } else if (f < ADD0) {- split = kf(f, [[RESULT, 0.97], [RESULT + 6, 0.97], [RESULT + 50, 0.06], [RESULT + 92, 0.52]]);- state = appState({ session: [genItem(STREET), genItem(REMOVED)], selected: "street-removed", compare: "slider", composer: { ...base.composer, refs: [ref("street-removed")] }, ...proj(2, "gen:street-removed") });- } else if (f < ADD_SEND + 2) {- state = appState({- session: [genItem(STREET), genItem(REMOVED)],- selected: "street-removed",- composer: { ...base.composer, refs: [ref("street-removed")], mask: { inputId: "mask2", refKey: "ref-street-removed" }, inpaintAction: f >= ADD0 + 12 ? "add" : "edit", prompt: typed(CAT_PROMPT, f, ADD_TY, 60) },- ...proj(2, "gen:street-removed"),- });- } else if (f < ADD_RESULT) {- const j = jobItem("j-cat", "inpaint", PROMPTS.add, "street-cat", "street-removed", stepAt(f, ADD_SEND + 4, 5), "add");- state = appState({ session: [genItem(STREET), genItem(REMOVED), j.item], selected: "j-cat", jobs: { "j-cat": j.job }, composer: { ...base.composer, refs: [ref("street-removed")] }, ...proj(3, "gen:street-removed") });- } else {- split = kf(f, [[ADD_RESULT, 0.97], [ADD_RESULT + 6, 0.97], [ADD_RESULT + 40, 0.3], [REGION_FRAMES, 0.42]]);- state = appState({ session: [genItem(STREET), genItem(REMOVED), genItem(CAT)], selected: "street-cat", compare: "slider", composer: { ...base.composer, refs: [ref("street-cat")] }, ...proj(3, "gen:street-cat") });- }- setCompareSplit(split);-+ const R = REGION;const box = imageBox(AR);- const pts = strokePoints(STROKE, paint);- const tip = pts[pts.length - 1] ?? STROKE[0];- const tipWin: [number, number] = [box.x + tip[0] * box.w, box.y + tip[1] * box.h];- const painting = f >= PAINT0 - 4 && f <= PAINT1 + 2;- const cam = camAt(f, [- [0, { x: 850, y: 400, s: 1.24 }],- [OPEN, { x: 850, y: 470, s: 1.16 }],- [PAINT0 + 10, { x: 860, y: 500, s: 1.55 }],- [PAINT1, { x: 860, y: 520, s: 1.55 }],- [DONE_AT + 10, { x: 850, y: 640, s: 1.4 }],- [TY1, { x: 820, y: 660, s: 1.5 }],- [JOB + 16, { x: 850, y: 380, s: 1.3 }],- [RESULT + 100, { x: 850, y: 330, s: 1.42 }],- [ADD0 + 14, { x: 820, y: 660, s: 1.45 }],- [ADD_SEND + 12, { x: 850, y: 380, s: 1.3 }],- [REGION_FRAMES, { x: 850, y: 340, s: 1.4 }],- ]);- return (- <AbsoluteFill>- <Backdrop />- <Camera cam={cam}>- <AppWindow state={state} width={1440} height={900} overlay={overlay} hideComposer={!!overlay} busy={(f >= JOB && f < RESULT) || (f >= ADD_SEND && f < ADD_RESULT)} />- {!painting && (+ // The paint editor's image filling the frame, as the full-frame picture Create ended on.+ const fillCam: Cam = { x: box.x + box.w / 2, y: box.y + box.h / 2, s: 1920 / box.w };+ const paintAt = (t: number) => prog(t, R.paint, R.paint1 - R.paint, (x) => x);++ // Shot 1: the paint editor over the image.+ const paintShot = () => {+ const state = appState({ session: [genItem(STREET)], selected: "street", composer: { ...base.composer, refs: [ref("street")] }, ...proj(1, "gen:street") });+ const cam = camAt(f, [+ [0, fillCam],+ [40, { ...fillCam, s: 1.58 }],+ [R.removeCut, { ...fillCam, y: fillCam.y + 6, s: 1.63 }],+ ]);+ return (+ <Camera cam={cam} free>+ <AppWindow state={state} width={1440} height={900} hideComposer overlay={<InpaintOverlay id="street" aspect={AR} points={STROKE} p={paintAt(f)} brush={74} />} />+ </Camera>+ );+ };++ // Shots 2 and 4: the composer, close. The action is picked as the voice says it.+ const composerShot = (from: number, action: "remove" | "add") => {+ const t = f - from;+ const pick = action === "remove" ? R.remove : R.add;+ const send = action === "remove" ? R.removeSend : R.addSend;+ const seg = action === "remove" ? REMOVE_SEG : ADD_SEG;+ const prompt = action === "remove" ? PROMPTS.remove : CAT_PROMPT;+ const img = action === "remove" ? STREET : REMOVED;+ const state = appState({+ session: action === "remove" ? [genItem(STREET)] : [genItem(STREET), genItem(REMOVED)],+ selected: img.id,+ composer: {+ ...base.composer,+ refs: [ref(img.id)],+ mask: { inputId: action === "remove" ? "mask" : "mask2", refKey: `ref-${img.id}` },+ inpaintAction: f >= pick ? action : "edit",+ prompt: typed(prompt, f, pick + 6, 70),+ },+ ...proj(action === "remove" ? 1 : 2, `gen:${img.id}`),+ });+ const cam = { ...COMPOSER_CAM, s: COMPOSER_CAM.s + t * 0.0006 };+ return (+ <DepthOfField focus={COMPOSER_FOCUS}>+ <Camera cam={cam} free turn={ANGLE}>+ <AppWindow state={state} width={1440} height={900} /><Pointerpath={[- [0, 1100, 520],- [34, PAINT_BTN[0], PAINT_BTN[1]],- [PAINT0 - 4, tipWin[0], tipWin[1]],- [PAINT1 + 2, tipWin[0], tipWin[1]],- [DONE_AT - 2, DONE_BTN[0], DONE_BTN[1]],- [REMOVE_AT - 2, REMOVE_SEG[0], REMOVE_SEG[1]],- [TY1, REMOVE_SEG[0] + 40, REMOVE_SEG[1] - 30],- [SEND_AT - 2, SEND[0], SEND[1]],- [SEND_AT + 30, 1300, 620],- [ADD0 + 10, ADD_SEG[0], ADD_SEG[1]],- [ADD_SEND - 2, SEND[0], SEND[1]],- [ADD_SEND + 30, 1300, 620],+ [from, seg[0] + 120, seg[1] + 50],+ [pick - 2, seg[0], seg[1]],+ [send - 10, seg[0] + 60, seg[1] - 20],+ [send - 1, SEND[0], SEND[1]],+ [send + 10, SEND[0] + 30, SEND[1] - 30],]}- clicks={[36, DONE_AT, REMOVE_AT, SEND_AT, ADD0 + 12, ADD_SEND]}- hideBefore={6}- hideAfter={ADD_SEND + 34}+ clicks={[pick, send]}/>- )}- </Camera>- <Vignette strength={0.9} />- <Caption title="Paint an area." sub="Brush over what you want to change." start={48} end={DONE_AT + 6} />- <Caption title="Only that area changes." sub="Remove, replace, add or change. Everything outside the brush stays as it was." start={RESULT - 30} end={ADD0 + 4} />- <Caption title="Add something new." sub="“a ginger cat sitting on the cobblestones”" start={ADD0 + 8} end={REGION_FRAMES} />+ </Camera>+ </DepthOfField>+ );+ };++ let shot: ReactNode;+ if (f < R.removeCut) shot = paintShot();+ else if (f < R.removeShot) shot = composerShot(R.removeCut, "remove");+ else if (f < R.addCut) {+ shot = <FullImage before="street" after="street-removed" reveal={prog(f, R.removeShot + 6, 22, inOut)} push={1 + (f - R.removeShot) * 0.0007} />;+ } else if (f < R.addShot) shot = composerShot(R.addCut, "add");+ else {+ // The cat wipes in; then the handle compares against the very first image.+ const cmp = f >= R.same + 14;+ shot = cmp ? (+ <FullImage before="street" after="street-cat" split={kf(f, [[R.same + 14, 0], [R.same + 70, 0.72], [LENGTH.region, 0.46]])} push={1.03} />+ ) : (+ <FullImage before="street-removed" after="street-cat" reveal={prog(f, R.addShot + 6, 22, inOut)} push={1 + (f - R.addShot) * 0.0007} />+ );+ }+ // Create ended on the full-frame street; it hands over to the paint editor's identical image.+ const handover = 1 - prog(f, 0, 10, inOut);+ return (+ <AbsoluteFill>+ <Backdrop />+ {shot}+ {f < 10 && (+ <div style={{ position: "absolute", inset: 0, opacity: handover }}>+ <FullImage before="street" push={1.06} dim={0.25} />+ </div>+ )}+ {(f >= R.removeCut && f < R.removeShot) || (f >= R.addCut && f < R.addShot) ? (+ <>+ <Vignette strength={0.55} side="top" reach={0.6} />+ <Vignette strength={1} reach={0.42} />+ </>+ ) : null}+ <Tag text="Paint." start={R.paint} end={R.removeCut} />+ <Tag text="Remove." start={R.removeShot + 8} end={R.addCut} />+ <Tag text="Add." start={R.addShot + 8} end={R.same + 10} />+ {f >= R.same + 14 &&+ (["Before", "After"] as const).map((t) => (+ <div key={t} style={{ position: "absolute", top: 56, [t === "Before" ? "left" : "right"]: 64, padding: "8px 18px", borderRadius: 999, background: "rgba(0,0,0,0.5)", color: "#f2f2f2", fontFamily: '"Inter Variable", Inter, sans-serif', fontSize: 26, fontWeight: 550, opacity: prog(f, R.same + 18, 12) }}>+ {t}+ </div>+ ))}+ <Sfx name="brush" at={R.paint} dur={R.paint1 - R.paint} />+ <Sfx name="click" at={R.remove} />+ <Send at={R.removeSend} />+ <Sfx name="reveal" at={R.removeShot + 6} variant={1} />+ <Sfx name="click" at={R.add} />+ <Send at={R.addSend} />+ <Sfx name="reveal" at={R.addShot + 6} variant={2} />+ <Sfx name="slider" at={R.same + 16} /></AbsoluteFill>);}// ----------------------------------------------------------------------------------------// Versions: the timeline of the project, every step kept.+// Versions: the timeline of the project, every step kept; two clicks walk back through it.// ----------------------------------------------------------------------------------------export const VERSIONS_FRAMES = 150;+export const VERSIONS_FRAMES = LENGTH.versions;export function Versions() {const f = useCurrentFrame();const base = appState();- const sel = f < 50 ? "street-cat" : f < 90 ? "street-removed" : "street";- setCompareSplit(0.5);- const state = appState({ session: [genItem(STREET), genItem(REMOVED), genItem(CAT)], selected: sel, composer: { ...base.composer, refs: [ref(sel)] }, ...proj(3, "gen:street-cat") });- const cam = camAt(f, [- [0, { x: 850, y: 340, s: 1.4 }],- [36, { x: 850, y: 560, s: 1.7 }],- [VERSIONS_FRAMES, { x: 850, y: 540, s: 1.62 }],- ]);+ const cues = sceneCues("versions");+ const back1 = cues[0].at + 8;+ const back2 = sentenceAt(cues[0], 1) + 14;+ const view = (t: number) => {+ const sel = t < back1 ? "street-cat" : t < back2 ? "street-removed" : "street";+ const state = appState({ session: [genItem(STREET), genItem(REMOVED), genItem(CAT)], selected: sel, composer: { ...base.composer, refs: [ref(sel)] }, ...proj(3, "gen:street-cat") });+ return <AppWindow state={state} width={1440} height={900} />;+ };+ const cam = { x: 850, y: 520, s: 1.66 + f * 0.0005 };return (<AbsoluteFill><Backdrop /><Camera cam={cam}>- <AppWindow state={state} width={1440} height={900} />- <Pointer path={[[10, 1000, 700], [44, 812, 664], [84, 776, 664], [VERSIONS_FRAMES, 760, 690]]} clicks={[48, 88]} hideBefore={10} />+ <Dissolve frame={f} cuts={[back1, back2]} view={view} dur={8} />+ <Pointer path={[[0, 1000, 720], [back1 - 6, 812, 664], [back2 - 6, 776, 664], [VERSIONS_FRAMES, 760, 690]]} clicks={[back1, back2]} /></Camera><Vignette strength={0.9} side="top" />- <Caption title="Every version kept." sub="Go back to any step, compare, or branch from it." start={20} end={VERSIONS_FRAMES} y={90} />+ <Caption title="Every version kept." start={12} end={VERSIONS_FRAMES} y={90} size={56} />+ <Sfx name="click" at={back1} />+ <Sfx name="click" at={back2} /></AbsoluteFill>);}diff --git a/marketing/video/src/scenes/Closing.tsx b/marketing/video/src/scenes/Closing.tsxindex 611939e..8dc2da1 100644--- a/marketing/video/src/scenes/Closing.tsx+++ b/marketing/video/src/scenes/Closing.tsx@@ -4,6 +4,8 @@ import { AbsoluteFill, useCurrentFrame } from "remotion";import { siAmd, siApple, siGithub, siIntel, siNvidia } from "simple-icons";import { Mark } from "../app/Mark";import { Backdrop, inOut, prog } from "../app/motion";+import { Sfx } from "../app/sound";+import { LENGTH, OUTRO } from "../app/timeline";const font = '"Inter Variable", Inter, sans-serif';const PAPER = "#F7F6F2";@@ -64,7 +66,7 @@ function Card({ icon, title, show, children }: { icon: ReactNode; title: string;);}-export const HARDWARE_FRAMES = 240;+export const HARDWARE_FRAMES = LENGTH.hardware;export function Hardware() {const f = useCurrentFrame();@@ -103,14 +105,14 @@ export function Hardware() {);}-export const OUTRO_FRAMES = 200;+export const OUTRO_FRAMES = LENGTH.outro;export function Outro() {const f = useCurrentFrame();const a = prog(f, 0, 30);const b = prog(f, 22, 24);- const c = prog(f, 40, 24);- const d = prog(f, 62, 24);+ const c = prog(f, OUTRO.try - 4, 20); // kokon.app arrives with "Try it now."+ const d = prog(f, OUTRO.knows + 10, 24);const fade = prog(f, OUTRO_FRAMES - 24, 24, inOut);return (<AbsoluteFill style={{ fontFamily: font, background: "#050505", alignItems: "center", justifyContent: "center", opacity: 1 - fade }}>@@ -130,6 +132,7 @@ export function Outro() {</div></div><div style={{ position: "absolute", bottom: 80, fontSize: 24, color: "rgba(247,246,242,0.5)", opacity: d }}>Designed and built by Gabriele Lozupone, with the help of Claude Code.</div>+ <Sfx name="hit" at={0} gain={0.8} /></AbsoluteFill>);}diff --git a/marketing/video/src/scenes/Main.tsx b/marketing/video/src/scenes/Main.tsxindex ea6b044..578a40b 100644--- a/marketing/video/src/scenes/Main.tsx+++ b/marketing/video/src/scenes/Main.tsx@@ -1,33 +1,35 @@-// The launch video: every scene in order. Scenes that continue the same app session cut-// straight into each other; the others cross-fade.+// The launch video: every scene at its start in app/timeline.ts. Scenes that continue the same+// app session cut straight into each other; the others cross-fade. The voice-over and the music+// (ducked under the voice) run on the main timeline.import type { ComponentType } from "react";-import { AbsoluteFill, Series, useCurrentFrame } from "remotion";-import { prog } from "../app/motion";-import { AGENT_FRAMES, Agent } from "./Agent";-import { CREATE_FRAMES, Create, REGION_FRAMES, Region, VERSIONS_FRAMES, Versions } from "./AppScenes";-import { HARDWARE_FRAMES, Hardware, OUTRO_FRAMES, Outro } from "./Closing";-import { MONTAGE_FRAMES, Montage } from "./Montage";+import { AbsoluteFill, Sequence, useCurrentFrame } from "remotion";+import { inOut, prog } from "../app/motion";+import { Music, Voice } from "../app/sound";+import { FADE, FADES_IN, LENGTH, START, TOTAL, type SceneName } from "../app/timeline";+import { Agent } from "./Agent";+import { Create, Region, Versions } from "./AppScenes";+import { Hardware, Outro } from "./Closing";+import { Montage } from "./Montage";import { Hook, Intro } from "./Opening";-const FADE = 12;-const SCENES: { C: ComponentType; frames: number; fadeIn: boolean }[] = [- { C: Intro, frames: 120, fadeIn: false },- { C: Hook, frames: 150, fadeIn: true },- { C: Create, frames: CREATE_FRAMES, fadeIn: true },- { C: Region, frames: REGION_FRAMES, fadeIn: false },- { C: Versions, frames: VERSIONS_FRAMES, fadeIn: false },- { C: Montage, frames: MONTAGE_FRAMES, fadeIn: true },- { C: Agent, frames: AGENT_FRAMES, fadeIn: true },- { C: Hardware, frames: HARDWARE_FRAMES, fadeIn: true },- { C: Outro, frames: OUTRO_FRAMES, fadeIn: true },+const SCENES: [SceneName, ComponentType][] = [+ ["intro", Intro],+ ["hook", Hook],+ ["create", Create],+ ["region", Region],+ ["versions", Versions],+ ["montage", Montage],+ ["agent", Agent],+ ["hardware", Hardware],+ ["outro", Outro],];-export const MAIN_FRAMES = SCENES.reduce((n, s) => n + s.frames - (s.fadeIn ? FADE : 0), 0) + FADE;+export const MAIN_FRAMES = TOTAL;function FadeIn({ C, on }: { C: ComponentType; on: boolean }) {const f = useCurrentFrame();return (- <AbsoluteFill style={{ opacity: on ? prog(f, 0, FADE) : 1 }}>+ <AbsoluteFill style={{ opacity: on ? prog(f, 0, FADE, inOut) : 1 }}><C /></AbsoluteFill>);@@ -36,13 +38,13 @@ function FadeIn({ C, on }: { C: ComponentType; on: boolean }) {export function Main() {return (<AbsoluteFill style={{ background: "#050505" }}>- <Series>- {SCENES.map(({ C, frames, fadeIn }, i) => (- <Series.Sequence key={i} durationInFrames={frames} offset={fadeIn && i > 0 ? -FADE : 0}>- <FadeIn C={C} on={fadeIn} />- </Series.Sequence>- ))}- </Series>+ {SCENES.map(([name, C]) => (+ <Sequence key={name} from={START[name]} durationInFrames={LENGTH[name]} name={name}>+ <FadeIn C={C} on={FADES_IN[name] && START[name] > 0} />+ </Sequence>+ ))}+ <Voice />+ <Music frames={MAIN_FRAMES} /></AbsoluteFill>);}diff --git a/marketing/video/src/scenes/Montage.tsx b/marketing/video/src/scenes/Montage.tsxindex 715f06d..f9dd2ed 100644--- a/marketing/video/src/scenes/Montage.tsx+++ b/marketing/video/src/scenes/Montage.tsx@@ -1,92 +1,85 @@-// Six edits back to back, each in the app: the sentence is typed, the image is made, and the-// before/after slider sweeps across the result. All images were made by Kokon.-import { AbsoluteFill, Sequence, useCurrentFrame } from "remotion";-import { AppWindow } from "../app/AppWindow";-import { appState, gen, genItem, jobItem, PROJECTS, PROMPTS, ref } from "../app/fixtures";-import { Backdrop, Camera, camAt, Caption, kf, prog, typed, typingDone, Vignette } from "../app/motion";-import { setCompareSplit } from "../mocks/Compare";-import type { State } from "../mocks/store";-import type { ResolvedMode } from "../../../../src/lib/types";+// Six edits, full frame, cut on the music: each starts as the voice names it ("Change the+// season."), its one-sentence prompt appears under the picture, and the result wipes in on the+// next beat but one. All images were made by Kokon. It ends on the six results together,+// "One sentence each.", right before the drop the Agent scene lands on.+import { AbsoluteFill, Img, Sequence, staticFile, useCurrentFrame } from "remotion";+import { FullImage } from "../app/FullImage";+import { PROMPTS } from "../app/fixtures";+import { inOut, prog, typed } from "../app/motion";+import { Sfx } from "../app/sound";+import { LENGTH, MONTAGE, MONTAGE_EDIT } from "../app/timeline";interface Edit {label: string;before: string;after: string;prompt: string;- mode: ResolvedMode;- project: string;+ expand?: number;}const EDITS: Edit[] = [- { label: "Relight.", before: "cabin", after: "cabin-winter", prompt: PROMPTS.winter, mode: "edit", project: "p2" },- { label: "Change the text.", before: "bakery", after: "bakery-text", prompt: PROMPTS.text, mode: "edit", project: "p1" },- { label: "Restyle.", before: "potter", after: "potter-watercolor", prompt: PROMPTS.restyle, mode: "edit", project: "p3" },- { label: "Replace.", before: "room", after: "room-sofa", prompt: PROMPTS.replace, mode: "edit", project: "p4" },- { label: "Expand.", before: "lighthouse", after: "lighthouse-wide", prompt: PROMPTS.expand, mode: "outpaint", project: "p5" },- { label: "Product shots.", before: "sneaker", after: "sneaker-ad", prompt: PROMPTS.product, mode: "edit", project: "p6" },+ { label: "Change the season.", before: "cabin", after: "cabin-winter", prompt: PROMPTS.winter },+ { label: "Fix the sign.", before: "bakery", after: "bakery-text", prompt: PROMPTS.text },+ { label: "Restyle a portrait.", before: "potter", after: "potter-watercolor", prompt: PROMPTS.restyle },+ { label: "Swap the furniture.", before: "room", after: "room-sofa", prompt: PROMPTS.replace },+ { label: "Expand the frame.", before: "lighthouse", after: "lighthouse-wide", prompt: PROMPTS.expand, expand: 1536 / 2764 },+ { label: "Shoot a product ad.", before: "sneaker", after: "sneaker-ad", prompt: PROMPTS.product },];-export const EDIT_FRAMES = 100;-export const MONTAGE_FRAMES = EDIT_FRAMES * EDITS.length;+export const MONTAGE_FRAMES = LENGTH.montage;+const START = EDITS.map((_, i) => Math.round(i * MONTAGE_EDIT));+/** The result wipes in two beats after the cut. */+const WIPE = 30;+const font = '"Inter Variable", Inter, sans-serif';-const EXPAND = { left: 614, right: 614, top: 0, bottom: 0 };--function OneEdit({ e, index }: { e: Edit; index: number }) {+function OneEdit({ e, index, frames }: { e: Edit; index: number; frames: number }) {const f = useCurrentFrame();- const base = appState();- const before = gen(e.before, "generate", "");- const after = gen(e.after, e.mode, e.prompt, e.before, e.mode === "outpaint" ? { outpaint: EXPAND } : {});- const TY = 4;- const SEND = Math.min(36, typingDone(e.prompt, TY, 75) + 4);- const RESULT = SEND + 18;- const projects: State["projects"] = PROJECTS.map((p) => (p.id === e.project ? { ...p, updatedAt: Date.now() - 5_000 } : p));- const common = { projects, projectId: e.project };- const outpaint = e.mode === "outpaint" ? { left: 40, right: 40, top: 0, bottom: 0, units: "percent" as const } : null;-- let state: State;- let split = 0.5;- if (f < SEND) {- state = appState({ session: [genItem(before)], selected: e.before, composer: { ...base.composer, refs: [ref(e.before)], outpaint, prompt: typed(e.prompt, f, TY, 75) }, ...common });- } else if (f < RESULT) {- const j = jobItem(`j-${e.after}`, e.mode, e.prompt, e.after, e.before, Math.min(8, Math.floor((f - SEND) / 2) + 1));- state = appState({ session: [genItem(before), j.item], selected: j.item.key, jobs: { [j.item.key]: j.job }, composer: { ...base.composer, refs: [ref(e.before)] }, ...common });- } else {- split = kf(f, [[RESULT, 1], [RESULT + 4, 1], [RESULT + 34, 0.04], [EDIT_FRAMES, 0.5]]);- state = appState({ session: [genItem(before), genItem(after)], selected: e.after, compare: "slider", composer: { ...base.composer, refs: [ref(e.after)] }, ...common });- }- setCompareSplit(split);-- const cam = camAt(f, [- [0, { x: 850, y: 470, s: 1.2 }],- [SEND, { x: 850, y: 470, s: 1.22 }],- [RESULT + 6, { x: 850, y: 370, s: 1.34 }],- [EDIT_FRAMES, { x: 850, y: 360, s: 1.4 }],- ]);- const flash = 1 - prog(f, 0, 8);+ const reveal = prog(f, WIPE, 20, inOut);+ const label = prog(f, 3, 12);+ const sentence = typed(e.prompt, f, 6, 90);return (<AbsoluteFill>- <Backdrop />- <Camera cam={cam}>- <AppWindow state={state} width={1440} height={900} busy={f >= SEND && f < RESULT} />- </Camera>- <Vignette strength={0.95} side="top" reach={0.55} />- <div- style={{- position: "absolute",- left: 96,- top: 76,- fontFamily: '"Inter Variable", Inter, sans-serif',- fontSize: 22,- fontWeight: 600,- letterSpacing: "0.14em",- color: "rgba(240,240,240,0.55)",- opacity: prog(f, 0, 10),- }}- >+ <FullImage before={e.before} after={e.after} reveal={reveal} expandFrom={e.expand} push={1 + (f / frames) * 0.05} />+ <div style={{ position: "absolute", inset: 0, background: "linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 22%, rgba(0,0,0,0) 40%)" }} />+ <div style={{ position: "absolute", left: 96, top: 72, fontFamily: font, fontSize: 22, fontWeight: 600, letterSpacing: "0.14em", color: "rgba(240,240,240,0.6)", textShadow: "0 2px 12px rgba(0,0,0,0.6)" }}>{String(index + 1).padStart(2, "0")} / {String(EDITS.length).padStart(2, "0")}</div>- <Caption title={e.label} start={0} end={EDIT_FRAMES + 20} y={112} size={72} />- <AbsoluteFill style={{ background: "#fff", opacity: flash * 0.06, pointerEvents: "none" }} />+ <div style={{ position: "absolute", left: 96, bottom: 150, fontFamily: font, fontSize: 64, fontWeight: 650, letterSpacing: "-0.035em", color: "#f4f4f2", textShadow: "0 4px 30px rgba(0,0,0,0.6)", opacity: label, transform: `translateY(${(1 - label) * 20}px)`, filter: `blur(${(1 - label) * 6}px)` }}>+ {e.label}+ </div>+ <div style={{ position: "absolute", left: 96, bottom: 84, maxWidth: 1500, fontFamily: font, fontSize: 26, color: "rgba(240,240,240,0.78)", textShadow: "0 2px 14px rgba(0,0,0,0.7)", opacity: prog(f, 6, 8) }}>+ “{sentence}+ {sentence.length < e.prompt.length ? <span style={{ opacity: 0.7 }}>▍</span> : "”"}+ </div>+ <Sfx name="reveal" at={WIPE} variant={index} gain={0.85} />+ </AbsoluteFill>+ );+}++function Mosaic() {+ const f = useCurrentFrame();+ const W = 560;+ const H = 315;+ const G = 28;+ const text = prog(f, 4, 14);+ return (+ <AbsoluteFill style={{ background: "#050505" }}>+ <div style={{ position: "absolute", left: (1920 - (3 * W + 2 * G)) / 2, top: (1080 - (2 * H + G)) / 2, display: "grid", gridTemplateColumns: `repeat(3, ${W}px)`, gap: G, transform: `scale(${1.02 + f * 0.0012})` }}>+ {EDITS.map((e, i) => {+ const p = prog(f, i * 1.5 - 3, 10); // the first tiles are already there on the cut+ return (+ <div key={e.after} style={{ width: W, height: H, borderRadius: 16, overflow: "hidden", opacity: p, transform: `scale(${0.9 + p * 0.1})`, boxShadow: "0 20px 60px rgba(0,0,0,0.5)" }}>+ <Img src={staticFile(`img/${e.after}.jpg`)} style={{ width: "100%", height: "100%", objectFit: "cover" }} />+ </div>+ );+ })}+ </div>+ <div style={{ position: "absolute", inset: 0, background: `rgba(0,0,0,${0.45 * text})` }} />+ <div style={{ position: "absolute", inset: 0, display: "grid", placeItems: "center" }}>+ <div style={{ fontFamily: font, fontSize: 104, fontWeight: 660, color: "#f4f4f2", letterSpacing: "-0.045em", textShadow: "0 6px 40px rgba(0,0,0,0.7)", opacity: text, transform: `translateY(${(1 - text) * 26}px)`, filter: `blur(${(1 - text) * 10}px)` }}>+ One sentence each.+ </div>+ </div></AbsoluteFill>);}@@ -94,11 +87,18 @@ function OneEdit({ e, index }: { e: Edit; index: number }) {export function Montage() {return (<AbsoluteFill style={{ background: "#050505" }}>- {EDITS.map((e, i) => (- <Sequence key={e.after} from={i * EDIT_FRAMES} durationInFrames={EDIT_FRAMES}>- <OneEdit e={e} index={i} />- </Sequence>- ))}+ {EDITS.map((e, i) => {+ const frames = (START[i + 1] ?? MONTAGE.mosaic) - START[i];+ return (+ <Sequence key={e.after} from={START[i]} durationInFrames={frames}>+ <OneEdit e={e} index={i} frames={frames} />+ </Sequence>+ );+ })}+ <Sequence from={MONTAGE.mosaic}>+ <Mosaic />+ </Sequence>+ <Sfx name="riser" at={MONTAGE.mosaic - 18} /></AbsoluteFill>);}diff --git a/marketing/video/src/scenes/Opening.tsx b/marketing/video/src/scenes/Opening.tsxindex f0ea0e7..399194f 100644--- a/marketing/video/src/scenes/Opening.tsx+++ b/marketing/video/src/scenes/Opening.tsx@@ -3,6 +3,8 @@import { AbsoluteFill, Img, interpolate, spring, staticFile, useCurrentFrame, useVideoConfig } from "remotion";import { MARK_PATHS } from "../app/Mark";import { inOut, out, prog } from "../app/motion";+import { Sfx } from "../app/sound";+import { sceneCues, sentenceAt } from "../app/timeline";const PAPER = "#F7F6F2";const font = '"Inter Variable", Inter, sans-serif';@@ -37,6 +39,7 @@ export function Intro() {Edit photos by describing the change.</div></div>+ <Sfx name="hit" at={4} /></AbsoluteFill>);}@@ -64,10 +67,12 @@ function Tile({ pair, flipAt, w, h }: { pair: [string, string]; flipAt: number;);}+// The three lines follow the voice: each appears as it is said.+const HOOK = sceneCues("hook")[0];const LINES = [- { text: "Describe the change.", from: 0, to: 46 },- { text: "Your computer makes it.", from: 46, to: 92 },- { text: "No cloud. No Python. No account.", from: 92, to: 150 },+ { text: "Another image editor?", from: sentenceAt(HOOK, 0) - 2, to: sentenceAt(HOOK, 1) - 2 },+ { text: "Nope.", from: sentenceAt(HOOK, 1) - 2, to: sentenceAt(HOOK, 2) - 2 },+ { text: "This one is yours.", from: sentenceAt(HOOK, 2) - 2, to: 150 },];export function Hook() {diff --git a/marketing/video/tsconfig.json b/marketing/video/tsconfig.jsonindex a1b0162..b491bfa 100644--- a/marketing/video/tsconfig.json+++ b/marketing/video/tsconfig.json@@ -7,7 +7,8 @@"jsx": "react-jsx","strict": true,"skipLibCheck": true,- "noEmit": true+ "noEmit": true,+ "resolveJsonModule": true},"include": ["src", "remotion.config.ts"]}diff --git a/site/assets/kokon-poster.jpg b/site/assets/kokon-poster.jpgindex d7cfea8..8246432 100644Binary files a/site/assets/kokon-poster.jpg and b/site/assets/kokon-poster.jpg differdiff --git a/site/assets/kokon.mp4 b/site/assets/kokon.mp4index 8c76bc8..6267b30 100644Binary files a/site/assets/kokon.mp4 and b/site/assets/kokon.mp4 differdiff --git a/site/index.html b/site/index.htmlindex 96f467d..90d3395 100644--- a/site/index.html+++ b/site/index.html@@ -70,8 +70,8 @@"description": "Kokon in use: creating an image from a sentence, painting an area to remove a scooter, adding a cat, and six more edits made with Qwen-Image 2.1 on a local GPU.","thumbnailUrl": "https://kokon.app/assets/kokon-poster.jpg","contentUrl": "https://kokon.app/assets/kokon.mp4",- "uploadDate": "2026-10-10",- "duration": "PT1M27S"+ "uploadDate": "2026-10-11",+ "duration": "PT1M25S"},{"@type": "WebSite",@@ -554,7 +554,22 @@const reel = $("reel"), reelBtn = $("reel-btn");const vio = new IntersectionObserver(([en]) => { if (en.isIntersecting) reel.play().catch(() => {}); else reel.pause(); }, { threshold: 0.3 });vio.observe(reel);- reelBtn.addEventListener("click", () => { reel.currentTime = 0; reel.controls = true; reel.loop = false; reel.play().catch(() => {}); reelBtn.remove(); });+ // The loop here is silent and 1080p. With the YouTube id set, the button swaps it for the full+ // film with voice and music (up to 4K), loaded from youtube-nocookie only on click.+ const YOUTUBE_ID = "";+ if (YOUTUBE_ID) { reelBtn.textContent = "▶ Watch with sound"; reelBtn.setAttribute("aria-label", "Play the launch film with sound"); }+ reelBtn.addEventListener("click", () => {+ if (YOUTUBE_ID) {+ const yt = document.createElement("iframe");+ yt.src = `https://www.youtube-nocookie.com/embed/${YOUTUBE_ID}?autoplay=1&rel=0&playsinline=1`;+ yt.title = "Kokon launch film";+ yt.allow = "autoplay; encrypted-media; picture-in-picture; fullscreen";+ yt.allowFullscreen = true;+ yt.style.cssText = "position:absolute;inset:0;width:100%;height:100%;border:0";+ vio.disconnect(); reel.pause(); reel.replaceWith(yt);+ } else { reel.currentTime = 0; reel.controls = true; reel.loop = false; reel.play().catch(() => {}); }+ reelBtn.remove();+ });const nav = $("nav");const onScroll = () => nav.classList.toggle("scrolled", scrollY > 10);diff --git a/site/sitemap.xml b/site/sitemap.xmlindex 8ce7726..2c55a16 100644--- a/site/sitemap.xml+++ b/site/sitemap.xml@@ -8,7 +8,7 @@<video:title>Kokon: edit photos by describing the change, on your own GPU</video:title><video:description>Kokon in use: creating an image from a sentence, painting an area to remove a scooter, adding a cat, and six more edits made with Qwen-Image 2.1 on a local GPU.</video:description><video:content_loc>https://kokon.app/assets/kokon.mp4</video:content_loc>- <video:duration>87</video:duration>+ <video:duration>85</video:duration></video:video></url><url><loc>https://kokon.app/qwen-image-2-1-local/</loc><lastmod>2026-10-10</lastmod></url>