README.md

Scripts #

Templates for a project's previz/ folder (next to the song). Copy the ones you need into previz/, then edit the project-specific constants (each script's docstring says which) or pass the arguments. Run with ephemeral deps via uv, e.g. uv run --with librosa --with soundfile python previz/align.py --song … --vocals … --drums …. Never install globally.

Script Does Configure
align.py Lyric line starts from the song's embedded subtitles (or a text file), refined to vocal onsets on the vocal stem; beats from the drum stem → lyrics.json, beats.json --song --vocals --drums [--lyrics] [--out]; re-running overwrites hand/Whisper corrections
retime.py Warps an old storyboard's shot times onto the new song through matched lyric anchors, snaps cuts to beats, adds extra shots, splits shots longer than the max clip → shots.json --storyboard --old-lyrics --song [--extra --keep --anchor --max]
animatic.py One labelled card per shot, cut to the song → animatic.mp4; --live swaps in generated keyframes (old still as inset) → storyboard.mp4 --song [--anim old_video.mp4] [--live]
kfreq.py Prints the image request for frames from keyframes.json (agent chat, or --editor with ATTACH/UPLOAD lines), with set-continuity notes optional sets.json [{"shots": [...], "desc": "..."}]
vidreq.py Per shot: clip length, first/last frame files (newest of HD vs local), characters, motion prompt STYLE, LOCKS, MUSIC constants; motion lines in clips/prompts.py (M = {id: (seconds, text)})
roughcut.py Frame-exact rough cut: clips (speed-fit for start→end shots), cards for missing shots, song on top; RECUT (pieces of clips cut on beats: chained clips, trims, re-edits), WIPES (black-bar wipe between two clips), EXACT/INPOINT (timed clips trimmed, never speed-fit) --song [--clips --size --out]; the edit-decision dicts at the top
comp.py Wide background plate + green-screen foregrounds: frames, preview, video <SHOT> (numpy keyer tuned for generated green, per-column contact shadows, eased partial pans) plates/plates.json (plate, frame scroll positions, pan, accel)
ck_key.py Neural keying with CorridorKey (prep frames + coarse alpha hints, run inference, composite over the panning plate with despill in linear light); HD=1 for the 1080p finals; accelerating-ride mode CorridorKey in tools/CorridorKey; shot settings from comp.py
perspective_insert.py Exact content (text, signs, screens, values) warped into a measured quad in a frame, with optional clearing of old content, supersampling, light and grain matching; insert() reusable per frame `--quad TL TR BR BL --texture
masked_recolor.py Tracked masked recolour of a clip: track a part by a colour blob (shape-filtered), recolour an off-hue range inside it keeping luminance, before/after QC strip --track-hsv --off-hsv --target [--min-area --max-y --aspect --radius]
render_three.mjs Headless three.js renderer: stills <page> t1 t2 …, frames <page> (shot range on the 30 fps grid), floor; serves its folder via request interception CHROME env, page name; npm install with package_three.json locally

Project layout they expect: previz/shots.json (retime.py), previz/keyframes.json (the project's prompt generator), previz/keyframes/, previz/keyframes_hd/, previz/clips/ (+ clips/green/, clips/hd/), previz/cards_live/, previz/plates/.