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.4 KB
Raw Blame
import { chromium } from 'playwright-core'; import { serve } from './serve.mjs';
import { EXE } from '../../../core/render/browser.mjs';   // PLAYWRIGHT_CHROME, or the newest headless shell in the local playwright cache
const { server, port } = await serve(process.cwd());
const flagsets = { default: [], metal: ['--use-angle=metal', '--enable-gpu', '--ignore-gpu-blocklist'], gl: ['--use-angle=gl', '--enable-gpu', '--ignore-gpu-blocklist'] };
for (const [name, fl] of Object.entries(flagsets)) {
  const b = await chromium.launch({ executablePath: EXE, args: fl });
  const p = await b.newPage({ viewport: { width: 1920, height: 1080 } });
  p.on('pageerror', e => console.log('ERR', e.message));
  await p.goto(`http://127.0.0.1:${port}/test.html?h=${process.argv[2] || 'lythwood_lounge'}`);
  await p.waitForFunction(() => window.READY, null, { timeout: 60000 });
  const info = await p.evaluate(() => { const gl = document.querySelector('canvas').getContext('webgl2'); const e = gl.getExtension('WEBGL_debug_renderer_info'); return e ? gl.getParameter(e.UNMASKED_RENDERER_WEBGL) : '?'; });
  let t0 = Date.now();
  for (let i = 0; i < 10; i++) { await p.evaluate(t => window.render(t), i / 60); await p.screenshot({ type: 'jpeg', quality: 100, path: `out/gl_${name}.jpg` }); }
  console.log(name, info, ((Date.now() - t0) / 10).toFixed(0) + 'ms/frame');
  await b.close();
}
server.close();