Skip to content

Show it a video you love. Get a new video in the same style. An AI crew (Claude Code or Codex) plans, builds and reviews it with you.

Previews no longer queue behind bulk renders; the climax's weaknesses are must-fix

許元豪06c7ef4bd2b3
diff --git a/.claude/skills/anime-cel/template/render.mjs b/.claude/skills/anime-cel/template/render.mjs
index d40ce17..e5c8ed3 100644
--- a/.claude/skills/anime-cel/template/render.mjs
+++ b/.claude/skills/anime-cel/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/.claude/skills/crayon-storybook/template/render.mjs b/.claude/skills/crayon-storybook/template/render.mjs
index c65caac..5f19c23 100644
--- a/.claude/skills/crayon-storybook/template/render.mjs
+++ b/.claude/skills/crayon-storybook/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/.claude/skills/painted-animation/template/render.mjs b/.claude/skills/painted-animation/template/render.mjs
index d40ce17..e5c8ed3 100644
--- a/.claude/skills/painted-animation/template/render.mjs
+++ b/.claude/skills/painted-animation/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/.claude/skills/paper-cutout/template/render.mjs b/.claude/skills/paper-cutout/template/render.mjs
index d40ce17..e5c8ed3 100644
--- a/.claude/skills/paper-cutout/template/render.mjs
+++ b/.claude/skills/paper-cutout/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/.claude/skills/pixel-art/template/render.mjs b/.claude/skills/pixel-art/template/render.mjs
index d40ce17..e5c8ed3 100644
--- a/.claude/skills/pixel-art/template/render.mjs
+++ b/.claude/skills/pixel-art/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/.claude/skills/whiteboard/template/render.mjs b/.claude/skills/whiteboard/template/render.mjs
index d40ce17..e5c8ed3 100644
--- a/.claude/skills/whiteboard/template/render.mjs
+++ b/.claude/skills/whiteboard/template/render.mjs
@@ -16,7 +16,8 @@
// node render.mjs --loop=emotions --png --out=out/loop_emotions one cycle as PNGs (for GIFs)
// Music: --audio=assets/song.mp3 (or PROJECT.audio) is muxed into --clip and --encode. Other flags: --fps=24,
// --chrome=<path to Chrome/Chromium>, --no-cache (redraw every frame in --frames).
-// At most RENDER_SLOTS (default 4) renders hold a Chrome at once on this machine; the rest wait their turn.
+// At most RENDER_SLOTS (default 4) previews and BULK_RENDER_SLOTS (default 1) --frames/--clip/--png renders hold a Chrome
+// at once on this machine; the rest wait their turn.
import puppeteer from 'puppeteer-core';
import { spawn } from 'node:child_process';
import { mkdirSync, writeFileSync, existsSync, statSync, renameSync, readdirSync, readFileSync, unlinkSync, rmSync } from 'node:fs';
@@ -75,7 +76,10 @@ const gpu = args['soft-gl'] ? ['--use-angle=swiftshader', '--enable-unsafe-swift
const sandbox = process.platform === 'linux' ? ['--no-sandbox'] : [];
// One machine-wide slot per render (lock files): many agents rendering at once made page loads time out and retry.
// A slot whose owner died (its turn was cut off) is taken back.
-const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots`, SLOTS = +(process.env.RENDER_SLOTS || 4);
+// Bulk renders (--frames/--clip/--png: minutes long) get their own small pool so quick previews never queue behind them
+// (a real run: previews averaged 93 s each against 3.5 s on an idle machine, mostly waiting).
+const BULK = !!(args.frames || args.clip || args.png);
+const SLOT_DIR = `${tmpdir()}/reelmimic_render_slots${BULK ? '_bulk' : ''}`, SLOTS = +(BULK ? process.env.BULK_RENDER_SLOTS || 1 : process.env.RENDER_SLOTS || 4);
const alive = pid => { try { process.kill(pid, 0); return true; } catch (e) { return e.code === 'EPERM'; } };
async function takeSlot() {
mkdirSync(SLOT_DIR, { recursive: true });
diff --git a/app/server/prompts.ts b/app/server/prompts.ts
index b887cfe..0838910 100644
--- a/app/server/prompts.ts
+++ b/app/server/prompts.ts
@@ -20,11 +20,12 @@ const REF = 'analysis/proxy.mp4(沒有 proxy.mp4 才用 analysis/source.mp4;
// gate compared against the drawing: proportions drifted shot to shot, accessories sat on top of the head, arms vanished.
const DESIGN = `**使用者給的角色設計圖(inputs/ 裡的圖)就是規格**:輪廓比例(寬:高)、眼睛位置與大小、手腳的數量/位置/粗細、配色都照圖。
不要拿引擎內建的同名角色或自己的印象去改;配件(帽子、耳機、墨鏡、髮型)要戴在對的部位(墨鏡在眼睛上、耳機在頭兩側),跟著身體一起轉,不能疊在頭頂蓋掉身體;
- 倒過來、拉長、壓扁、特寫等特殊姿勢也一樣要認得出是同一隻。`;
+ 倒過來、拉長、壓扁、特寫等特殊姿勢也一樣要認得出是同一隻。
+ 配件不能改變輪廓的判讀:大面積深色的頭帶、帽子會被看成頭髮或另一個部位,要細、要有高光或和身體對比明顯的顏色;特寫時再確認一次。`;
// The point of every video: a moment that gives goosebumps. Shared by the planner, builders, reviewers and the critic.
const WOW = `**這支片的目標是驚艷,讓人起雞皮疙瘩**,不是「沒有錯」。驚艷來自高潮設計,不是平均用力:
-- 高潮 = 鋪陳(張力往上堆)→ 屏息(安靜、停住、收窄)→ 爆發(落在重拍:構圖、色彩、動作、聲音同時翻轉)→ 停住(讓情緒落地 ≥ 1 秒,不要馬上切走)。
-- 爆發那一下要「看得到」:主體大、清楚、畫面密度和參考片的爆點一樣滿;閃白、光圈、轉場只能當引信,**不准用閃白或轉場蓋掉該被看到的那一刻**(擁抱、揭露、表情)。
+- 高潮 = 鋪陳(張力往上堆)→ 屏息(安靜、停住、收窄;長度和參考片的屏息接近(±30%),近乎空白的畫面不超過 1.2 秒)→ 爆發(落在重拍:構圖、色彩、動作、聲音同時翻轉)→ 停住(讓情緒落地 ≥ 1 秒,不要馬上切走)。
+- 爆發那一下要「看得到」:主體大、清楚(爆點那一格和之後的停住段,主角至少佔畫面高 30%;要拉寬景秀規模就讓主角在前景或在畫面中心被放大,不要變成遠方的小點)、畫面密度和參考片的爆點一樣滿;閃白、光圈、轉場只能當引信,**不准用閃白或轉場蓋掉該被看到的那一刻**(擁抱、揭露、表情)。
- 力氣集中在 plan.peaks 的 hero 鏡頭:特製姿勢、誇張變形臉、衝擊格、smear、光芒/粒子、鏡頭震動、色彩翻轉、音效(蓄力、撞擊、爆點前的安靜)——參考片爆點用了什麼,我們至少一樣多。
- 判斷爆點一律用連續影格,不看單張:python ${SKILL}/scripts/clip_strip.py <我們的影片> --range a:b --vs ${REF} --vs-range c:d --out …(參考在上、我們在下,逐格對齊)。
- 驚艷也需要變化:同一個場景+同一個機位不能超過全片的 40%;兩個高潮之間要換場景、換視角或換色彩世界;鋪陳段每 1–1.5 秒畫面要有新的東西(運鏡、構圖、新元素),不能一個構圖停 3 秒等爆點。`;
@@ -328,6 +329,8 @@ ${WOW}
(我們:build_from_s 到 hit_s+hold_after_s;參考:peaks.json 的 from–to),打開逐格比:鋪陳、屏息、爆點那一格、停住、畫面密度、主體大小、聲音落點
(用 ffmpeg 的 astats/ebur128 量我們爆點前後的音量變化,對照參考)。判定 ours_better / equal / ref_better 並寫具體理由。
**ref_better 就不能通過**:在 must_fix 寫出要加什麼才會贏(具體到手法、格數、大小)。
+ **就算判 ours_better,你在 why 裡寫到的弱點(主角太小、屏息太長、爆點後沒東西看、配件讀錯)也要各列一條 must_fix**——高潮是這支片的全部價值,不放在 nice_to_have。
+ hero 鏡頭裡一格就換姿勢(沒有中間格)、主角在爆點或停住段小於畫面高 30%,都是 must_fix。
3. 成片:ffmpeg 每 0.5 秒抽一格做總覽到 out/check/critic/,全部打開;每個接縫抽前後 0.5 秒的 strip;
每個動作用 clip_strip.py 抽 12fps 連續影格看(跳格、瞬移、該動不動、僵硬);可疑處抽全解析度放大。
跑 python ${SKILL}/scripts/motion_check.py out/video.mp4 --out out/check/critic/motion,打開它產生的每張 strip。