story-to-handdrawn-video
中文
把中文故事文案或一组有序的手绘图片,转换成 3:4 竖屏手绘故事动画。内置 20 种可切换风格,包含彩铅日记、儿童蜡笔、极简线条、水墨、水彩、水粉绘本、Zine 拼贴、白板讲解与木刻社论等视觉家族;未指定时继续使用已确认并锁定的「彩铅日记漫画」默认风格。支持手写体字幕、从左到右的「文字 → 黑白画稿 → 彩色插画」揭示、可选右下角卷页翻书转场和安全不裁剪构图。基于 Remotion,默认输出无配音、无音乐的 H.264 画面轨,方便后期配音。
本仓库包含两部分:
- 渲染器项目(根目录):Remotion 工程,负责实际的分镜、动效和渲染。
- Codex / Agent Skill(
skill-package/):可分发的 Skill,装进 Codex 等 Agent 后用自然语言驱动渲染器,无需手动跑脚本。
功能特性
- 中文故事自动分句和动态分镜,保留原文措辞
- 上传漫画页或完整图片,保持原顺序和构图
- 自动拆分上方文字区与下方插画区
- 本地生成与彩色插画对齐的黑白层
文字 → 黑白画稿 → 彩色插画从左到右揭示- 可选右下角卷页翻书转场(纸背保留淡化的原页纹理)
- 1080×1440 正式渲染和 720×960 快速预览
- Codex Image2 工作流,以及显式选择的 OpenAI API 工作流
- 20 种内置手绘风格,支持编号、英文 id、中文名和别名选择
- 每种风格附带固定示例图,并提供统一场景的风格总览
环境要求
- Node.js 20 或更高版本
- Python 3.10 或更高版本
- FFmpeg,且
ffmpeg、ffprobe可从终端调用 - npm
- Google Chrome,或由 Remotion 管理的兼容浏览器
- 支持 Skill 的 Agent 运行时(Codex、Claude Code、Kimi Code 等)
安装
- 准备渲染器项目:
git clone https://github.com/gnipbao/story-to-handdrawn-video.git
cd story-to-handdrawn-video
npm ci
npm run check # TypeScript 检查 + 分镜结构校验,不访问网络- 把 Skill 装进 Agent 的 skills 目录:
# Codex
cp -R skill-package/story-to-handdrawn-video ~/.codex/skills/
# Claude Code / 通用 Agent
cp -R skill-package/story-to-handdrawn-video ~/.claude/skills/
# Kimi Code
cp -R skill-package/story-to-handdrawn-video ~/.agents/skills/- 告诉 Skill 渲染器项目在哪里(在渲染器项目目录内运行 Agent 时可省略):
export STORY_VIDEO_PROJECT=/absolute/path/to/story-to-handdrawn-video使用方法(Codex Skill 示例)
装好 Skill 后,全部通过自然语言驱动,分句、分镜、图片生成、导入、渲染由 Agent 按 Skill 约定自动完成。
故事文本 → 手绘动画(Skill 的默认提示词):
使用 $story-to-handdrawn-video 把这段故事生成可后期配音的手绘动画。
<在这里粘贴故事文本>也可以把故事放在 UTF-8 文本文件里:
使用 $story-to-handdrawn-video 把 /absolute/story.txt 生成手绘动画,标题叫「纸上的夏天」。上传图片 → 手绘动画(图片按播放顺序给出):
使用 $story-to-handdrawn-video 把这几张图片按顺序生成手绘动画:
/absolute/01.jpg /absolute/02.jpg /absolute/03.jpg翻书效果(保留原始页面,从右下角卷页):
使用 $story-to-handdrawn-video 把这些图片做成翻书效果的手绘动画:
/absolute/01.jpg /absolute/02.jpg先出预览(720×960,确认效果后再出正式版):
使用 $story-to-handdrawn-video 先给这个故事生成一个预览版。使用建议:
- 故事文本默认一个完整句子一个节拍;想控制节奏,直接在故事里按句分行即可。
- 遇到时间跳跃、指代不明、医疗场景或年龄敏感角色时,建议先让 Agent 给出视觉规划(两位场景编号为键的 JSON),确认后再生成。
- 默认使用 Codex Image2 生成图片;只有明确要求时才会走 OpenAI API(需
OPENAI_API_KEY)。 - 输出是静音画面轨,配音和 BGM 属于后期工作。
20 种内置手绘风格
所有示例使用同一组人物、动作和构图生成,便于直接比较画材、线条、色板与完成度。示例图只作为风格证据,生成故事时仍由原文和角色锁定控制人物、场景与动作。

查看完整菜单和每张示例图路径:
python3 scripts/run_story_video.py --list-styles选择风格时可使用编号、id、中文名或别名:
使用 $story-to-handdrawn-video 选择「水墨写意」风格,把这段故事生成静音手绘动画。python3 scripts/run_story_video.py \
--input examples/story.txt \
--title "纸上的夏天" \
--style ink-wash \
--mode plan机器可读配方位于 references/handdrawn-style-library.json。其中 contact_sheet 指向总览图,每种风格的 example_image 指向对应示例;来源于 hand-drawn-styles 的配方保留 MIT 署名,详见 references/handdrawn-styles-LICENSE.txt。
输出契约
| 输入 | 模式 | 输出路径 |
|---|---|---|
| 故事文本 | 正式 | out/picture_silent.mp4 |
| 故事文本 | 预览 | out/picture_silent-preview.mp4 |
| 上传图片 | 正式 | out/uploaded_picture_silent.mp4 |
| 上传图片 | 预览 | out/uploaded_picture_silent-preview.mp4 |
- 分辨率:正式 1080×1440,预览 720×960
- 编码:H.264,静音
Skill 的完整行为约定见 skill-package/story-to-handdrawn-video/SKILL.md。
项目结构
.
├── src/ # Remotion 组件(场景、擦除动效、翻页、缓动)
├── scripts/ # 渲染器入口与导入/校验/打包脚本(由 Skill 调用)
├── skill-package/ # 可分发的 Codex / Agent Skill
├── examples/ # 示例故事文本
├── references/ # 20 风格配方、默认风格参考板与示例图库
├── public/ # 字体与素材(generated/ 为运行时产物)
├── storyboard.json # 默认文本故事分镜示例
├── storyboard.uploaded.json # 上传图片分镜示例
└── DESIGN.md # 设计说明渲染器项目的维护命令:npm run dev(Remotion Studio)、npm run check(类型与分镜校验)、npm run build(生产构建)、npm run package:share(生成源码分享包)。
字体
项目使用随附的站酷马善政毛笔字体(Ma Shan Zheng),许可证见 public/fonts/OFL-MaShanZheng.txt(SIL Open Font License)。
贡献
欢迎贡献——请阅读 CONTRIBUTING.md。注意 skill-package/ 下的 Skill 契约与 src/、scripts/ 下的渲染器逻辑是核心部分,修改需要充分理由。
开源协议
English
Convert Chinese story copy — or ordered hand-drawn images — into a 3:4 vertical hand-drawn story animation. The project includes 20 selectable visual families spanning colored pencil, kid crayon, minimal line art, ink wash, watercolor, gouache storybooks, zine collage, whiteboard explainers, and linocut editorial illustration. When no style is requested, it preserves the approved and locked colored-pencil diary default. Built on Remotion; outputs a silent H.264 picture track ready for post-production voiceover.
This repo contains:
- The renderer project (root): the Remotion app that storyboards, animates, and renders.
- A Codex / agent skill (
skill-package/): a distributable skill that drives the renderer with natural language — no scripts to run by hand.
Requirements
- Node.js 20+, Python 3.10+, npm
- FFmpeg (
ffmpegandffprobeon PATH) - Google Chrome or a Remotion-managed compatible browser
- An agent runtime with skill support (Codex, Claude Code, Kimi Code, …)
Install
- Set up the renderer project:
git clone https://github.com/gnipbao/story-to-handdrawn-video.git
cd story-to-handdrawn-video
npm ci
npm run check- Install the skill into your agent's skills directory:
# Codex
cp -R skill-package/story-to-handdrawn-video ~/.codex/skills/
# Claude Code / generic agents
cp -R skill-package/story-to-handdrawn-video ~/.claude/skills/
# Kimi Code
cp -R skill-package/story-to-handdrawn-video ~/.agents/skills/- Point the skill at the renderer project (skip when the agent runs inside it):
export STORY_VIDEO_PROJECT=/absolute/path/to/story-to-handdrawn-videoUsage (Codex skill examples)
Everything is driven in natural language; sentence splitting, storyboarding, image generation, import, and rendering are handled by the agent per the skill contract.
Story text → animation (the skill's default prompt):
使用 $story-to-handdrawn-video 把这段故事生成可后期配音的手绘动画。
<paste your story here>Ordered images → animation:
使用 $story-to-handdrawn-video 把这几张图片按顺序生成手绘动画:
/absolute/01.jpg /absolute/02.jpg /absolute/03.jpgPage-flip effect (uploaded pages shown untouched, curled from the bottom-right corner):
使用 $story-to-handdrawn-video 把这些图片做成翻书效果的手绘动画:
/absolute/01.jpg /absolute/02.jpgPreview first (720×960, before committing to a full render):
使用 $story-to-handdrawn-video 先给这个故事生成一个预览版。Notes: one complete sentence per beat by default; Codex Image2 is the default image generator (the OpenAI API path is only used when explicitly requested and requires OPENAI_API_KEY); output is a silent picture track — voiceover and BGM are post-production.
Built-in style library
The samples below use the same characters, action, and composition so line work, material, palette, and finish can be compared directly. Samples are style evidence only; story text and the character lock still control scene content and identity.

List styles and their example paths:
python3 scripts/run_story_video.py --list-stylesSelect a style by order, id, Chinese name, English name, or alias:
python3 scripts/run_story_video.py \
--input examples/story.txt \
--title "Paper Summer" \
--style ink-wash \
--mode planThe machine-readable recipes live in references/handdrawn-style-library.json. Its contact_sheet points to the overview and each example_image points to an individual sample. Recipes adapted from hand-drawn-styles retain MIT attribution in references/handdrawn-styles-LICENSE.txt.
Outputs
| Input | Mode | Path |
|---|---|---|
| Story text | final | out/picture_silent.mp4 |
| Story text | preview | out/picture_silent-preview.mp4 |
| Uploaded images | final | out/uploaded_picture_silent.mp4 |
| Uploaded images | preview | out/uploaded_picture_silent-preview.mp4 |
Final 1080×1440, preview 720×960, H.264, silent. The full behavior contract lives in SKILL.md.
License
MIT. The bundled Ma Shan Zheng font is under the SIL Open Font License.



















