Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

863 B
Raw Blame
"""The shot timeline in film.js is built from the Chinese line lengths (VO_DUR). After a fresh narration run, check that
   out/vo_zh/dur.json still matches (edge-tts can drift by a few milliseconds; more than 0.08 s means: update VO_DUR)."""
import json, os, re, sys
D = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
got = json.load(open(os.path.join(D, 'out', 'vo_zh', 'dur.json')))
want = [float(x) for x in re.search(r'const VO_DUR = \[([^\]]*)\]', open(os.path.join(D, 'film.js'), encoding='utf-8').read()).group(1).split(',')]
bad = [(f'V{i + 1:02d}', w, got[f'V{i + 1:02d}']) for i, w in enumerate(want) if abs(got[f'V{i + 1:02d}'] - w) > .08]
for b in bad: print('line %s: film.js %.3f s, voice %.3f s' % b)
print('voice lengths match VO_DUR' if not bad else 'update VO_DUR in film.js to the voice lengths above'); sys.exit(1 if bad else 0)