AI digital-human talking-head videos from one photo: Renoise MCP generation + 5 editing styles + 48 creator-grade packaging components. Agent skill for Claude Code / Codex / OpenClaw / WorkBuddy …
TypeScript
skill: sub field for subtitle spelling, stepAt accepts 段:词, showcase note follows frame
Andycac16279c9ad
diff --git a/skills/digital-human-koubo/SKILL.md b/skills/digital-human-koubo/SKILL.mdindex 8691813..69ad2b7 100644--- a/skills/digital-human-koubo/SKILL.md+++ b/skills/digital-human-koubo/SKILL.md@@ -41,7 +41,7 @@ description: 用固定的数字人形象(白背心数字人 / 用户本人数| E 多主播多语言 | 16:9 | 3–7 分钟 | 参考实现 `templates/reference/multihost-169` |### 1. 写稿 → script.json-按选定风格的稿子写法(style-menu.md 里每种都有)。每段一句或两句,10 秒左右(约 40–55 字,Grok 中文约 5.4 字/秒),标 `shot`:`full`(全屏出镜)/ `pip`(画中画讲解)/ `vlog`(随意自拍口吻)/ `depth`(要做「文字在人身后」的段:中景、头顶两侧留背景)。英文缩写、网址写成好念的样子。外语段直接写目标语言的台词。+按选定风格的稿子写法(style-menu.md 里每种都有)。每段一句或两句,10 秒左右(约 40–55 字,Grok 中文约 5.4 字/秒),标 `shot`:`full`(全屏出镜)/ `pip`(画中画讲解)/ `vlog`(随意自拍口吻)/ `depth`(要做「文字在人身后」的段:中景、头顶两侧留背景)。英文缩写、网址写成好念的样子;字幕要显示原写法时在那段加 `"sub": {"SKILL 点 M D": "SKILL.md"}`(align.py 按念法对齐、字幕换回写法)。外语段直接写目标语言的台词。### 2. 切段 + 报价`python3 scripts/build_tasks.py script.json tasks.json --purpose "teaching a beginner tutorial step by step"`diff --git a/skills/digital-human-koubo/scripts/align.py b/skills/digital-human-koubo/scripts/align.pyindex 9a307e5..f7cdc5d 100644--- a/skills/digital-human-koubo/scripts/align.py+++ b/skills/digital-human-koubo/scripts/align.py@@ -1,7 +1,8 @@#!/usr/bin/env python3"""逐字时间轴:把 assemble.py 的 cut/<id>.json(whisper 逐字)和文稿对齐,输出剪辑模板用的 tl.json。用法:python3 align.py script.json [--out edit/src/tl.json]-tl.json = {"total": 秒, "segs": [{"i","id","start","end","text","chars":{"字符下标": 秒}}]}(chars 是整片绝对时间)"""+tl.json = {"total": 秒, "segs": [{"i","id","start","end","text","chars":{"字符下标": 秒}}]}(chars 是整片绝对时间)+字幕和念法不一样时,在 script.json 那段加 "sub": {"SKILL 点 M D": "SKILL.md"}:对齐按念法,字幕显示右边的写法,时间跟着换。"""import json, difflib, sysfrom pathlib import Patha = sys.argv[1:]@@ -29,7 +30,16 @@ for i, s in enumerate(S, 1):lo = max([j for j in known if j < k], default=None); hi = min([j for j in known if j > k], default=None)st[k] = 0.0 if lo is None and hi is None else (st[hi] if lo is None else (st[lo] + 0.18 * (k - lo) if hi is None else st[lo] + (st[hi] - st[lo]) * (k - lo) / (hi - lo)))cov = sum(bl.size for bl in sm.get_matching_blocks()) / max(1, len(A))- segs.append(dict(i=i, id=sid, start=round(T0, 3), end=round(T0 + keep, 3), text=text, chars={str(j): round(T0 + st[k], 3) for k, (j, _) in enumerate(clean)}))+ ch = {j: T0 + st[k] for k, (j, _) in enumerate(clean)}+ for say, show in s.get('sub', {}).items(): # 念法 → 字幕写法,这几个字的时间在原跨度里均分+ p0 = text.find(say)+ if p0 < 0: print(f' ⚠ {sid} 找不到 sub「{say}」'); continue+ span = [ch[j] for j in range(p0, p0 + len(say)) if j in ch]; a0, a1 = (span[0], span[-1]) if span else (T0, T0)+ d = len(show) - len(say)+ ch = {**{j: v for j, v in ch.items() if j < p0}, **{j + d: v for j, v in ch.items() if j >= p0 + len(say)},+ **{p0 + k: a0 + (a1 - a0) * k / max(1, len(show) - 1) for k, c in enumerate(show) if c not in PUNCT}}+ text = text[:p0] + show + text[p0 + len(say):]+ segs.append(dict(i=i, id=sid, start=round(T0, 3), end=round(T0 + keep, 3), text=text, chars={str(j): round(v, 3) for j, v in sorted(ch.items())}))print(f'{i:2d} {sid:5s} 对齐 {cov:.0%} {T0:.2f}–{T0 + keep:.2f}')T0 += keepPath(out).parent.mkdir(parents=True, exist_ok=True)diff --git a/skills/digital-human-koubo/templates/huazi-916/src/Huazi.tsx b/skills/digital-human-koubo/templates/huazi-916/src/Huazi.tsxindex e3d711c..712bdef 100644--- a/skills/digital-human-koubo/templates/huazi-916/src/Huazi.tsx+++ b/skills/digital-human-koubo/templates/huazi-916/src/Huazi.tsx@@ -323,7 +323,7 @@ const Showcase: React.FC<{ s: (typeof SHOWS)[number] }> = ({ s }) => {</AbsoluteFill>);})}- {s.note && <div style={{ position: "absolute", left: 40, top: 1010, fontFamily: ZH, fontSize: 24, color: "rgba(255,255,255,.6)" }}>{s.note}</div>}+ {s.note && <div style={{ position: "absolute", left: 40, top: 398 + (({ "9:16": 1200, "1:1": 900 } as Record<string, number>)[s.items[0]?.ratio ?? ""] ?? 608), fontFamily: ZH, fontSize: 24, color: "rgba(255,255,255,.6)" }}>{s.note}</div>}</AbsoluteFill>);};diff --git a/skills/digital-human-koubo/templates/huazi-916/src/kit/registry.tsx b/skills/digital-human-koubo/templates/huazi-916/src/kit/registry.tsxindex 0878b47..a703060 100644--- a/skills/digital-human-koubo/templates/huazi-916/src/kit/registry.tsx+++ b/skills/digital-human-koubo/templates/huazi-916/src/kit/registry.tsx@@ -44,6 +44,7 @@ const VERT: Record<string, Record<string, any>> = {};export type PackItem = { use: string; [k: string]: any };const walk = (v: any, T: (r: any) => number, key = ""): any => {+ if (key === "stepAt" && Array.isArray(v)) return v.map((x) => (typeof x === "string" || typeof x === "number" ? T(x) : x)); // 步骤时刻也能写 "段:词"if (Array.isArray(v)) return v.map((x) => walk(x, T));if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x, T, k)]));if ((key === "at" || key === "until") && (typeof v === "string" || typeof v === "number")) return T(v);diff --git a/skills/digital-human-koubo/templates/packaging/src/kit/registry.tsx b/skills/digital-human-koubo/templates/packaging/src/kit/registry.tsxindex 0878b47..a703060 100644--- a/skills/digital-human-koubo/templates/packaging/src/kit/registry.tsx+++ b/skills/digital-human-koubo/templates/packaging/src/kit/registry.tsx@@ -44,6 +44,7 @@ const VERT: Record<string, Record<string, any>> = {};export type PackItem = { use: string; [k: string]: any };const walk = (v: any, T: (r: any) => number, key = ""): any => {+ if (key === "stepAt" && Array.isArray(v)) return v.map((x) => (typeof x === "string" || typeof x === "number" ? T(x) : x)); // 步骤时刻也能写 "段:词"if (Array.isArray(v)) return v.map((x) => walk(x, T));if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x, T, k)]));if ((key === "at" || key === "until") && (typeof v === "string" || typeof v === "number")) return T(v);diff --git a/skills/digital-human-koubo/templates/reference/launch-169/src/kit/registry.tsx b/skills/digital-human-koubo/templates/reference/launch-169/src/kit/registry.tsxindex 0878b47..a703060 100644--- a/skills/digital-human-koubo/templates/reference/launch-169/src/kit/registry.tsx+++ b/skills/digital-human-koubo/templates/reference/launch-169/src/kit/registry.tsx@@ -44,6 +44,7 @@ const VERT: Record<string, Record<string, any>> = {};export type PackItem = { use: string; [k: string]: any };const walk = (v: any, T: (r: any) => number, key = ""): any => {+ if (key === "stepAt" && Array.isArray(v)) return v.map((x) => (typeof x === "string" || typeof x === "number" ? T(x) : x)); // 步骤时刻也能写 "段:词"if (Array.isArray(v)) return v.map((x) => walk(x, T));if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x, T, k)]));if ((key === "at" || key === "until") && (typeof v === "string" || typeof v === "number")) return T(v);diff --git a/skills/digital-human-koubo/templates/reference/multihost-169/src/kit/registry.tsx b/skills/digital-human-koubo/templates/reference/multihost-169/src/kit/registry.tsxindex 0878b47..a703060 100644--- a/skills/digital-human-koubo/templates/reference/multihost-169/src/kit/registry.tsx+++ b/skills/digital-human-koubo/templates/reference/multihost-169/src/kit/registry.tsx@@ -44,6 +44,7 @@ const VERT: Record<string, Record<string, any>> = {};export type PackItem = { use: string; [k: string]: any };const walk = (v: any, T: (r: any) => number, key = ""): any => {+ if (key === "stepAt" && Array.isArray(v)) return v.map((x) => (typeof x === "string" || typeof x === "number" ? T(x) : x)); // 步骤时刻也能写 "段:词"if (Array.isArray(v)) return v.map((x) => walk(x, T));if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x, T, k)]));if ((key === "at" || key === "until") && (typeof v === "string" || typeof v === "number")) return T(v);diff --git a/skills/digital-human-koubo/templates/reference/tutorial-169/src/kit/registry.tsx b/skills/digital-human-koubo/templates/reference/tutorial-169/src/kit/registry.tsxindex 0878b47..a703060 100644--- a/skills/digital-human-koubo/templates/reference/tutorial-169/src/kit/registry.tsx+++ b/skills/digital-human-koubo/templates/reference/tutorial-169/src/kit/registry.tsx@@ -44,6 +44,7 @@ const VERT: Record<string, Record<string, any>> = {};export type PackItem = { use: string; [k: string]: any };const walk = (v: any, T: (r: any) => number, key = ""): any => {+ if (key === "stepAt" && Array.isArray(v)) return v.map((x) => (typeof x === "string" || typeof x === "number" ? T(x) : x)); // 步骤时刻也能写 "段:词"if (Array.isArray(v)) return v.map((x) => walk(x, T));if (v && typeof v === "object") return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x, T, k)]));if ((key === "at" || key === "until") && (typeof v === "string" || typeof v === "number")) return T(v);