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 种现成风格,也能做出你自己的

1.0 KB
Raw Blame
// content.json → lines.json (Kokoro voice input). Usage: node tools/make_lines.mjs [content.json] [lines.json] [voice override]
import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url';
const D = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const src = path.resolve(D, process.argv[2] || 'content.json'), out = process.argv[3] ? path.resolve(process.argv[3]) : path.join(D, 'lines.json');   // output path is relative to the current directory
const C = JSON.parse(fs.readFileSync(src, 'utf8'));
const v = process.argv[4] || C.voice?.id || 'af_heart', sp = C.voice?.speed ?? 0.96;
const L = [{ id: 'intro', text: C.intro_vo, asr: C.intro_vo_asr }, ...C.callouts.map((c, i) => ({ id: 'c' + i, text: c.vo, asr: c.vo_asr })), { id: 'outro', text: C.outro_vo, asr: C.outro_vo_asr }]
  .filter(l => l.text).map(l => { const o = { ...l, voice: v, speed: sp }; if (!o.asr) delete o.asr; return o; });
fs.writeFileSync(out, JSON.stringify(L, null, 1)); console.log(out, L.length, 'lines', v);