Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

story-to-handdrawn-video

中文 | English

License: MIT


中文

把中文故事文案或一组有序的手绘图片,转换成 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,且 ffmpegffprobe 可从终端调用
  • npm
  • Google Chrome,或由 Remotion 管理的兼容浏览器
  • 支持 Skill 的 Agent 运行时(Codex、Claude Code、Kimi Code 等)

安装

  1. 准备渲染器项目:
git clone https://github.com/gnipbao/story-to-handdrawn-video.git
cd story-to-handdrawn-video
npm ci
npm run check      # TypeScript 检查 + 分镜结构校验,不访问网络
  1. 把 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/
  1. 告诉 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 种内置手绘风格

所有示例使用同一组人物、动作和构图生成,便于直接比较画材、线条、色板与完成度。示例图只作为风格证据,生成故事时仍由原文和角色锁定控制人物、场景与动作。

20 种手绘风格总览

#示例Style id中文名视觉特征推荐题材
1彩铅日记漫画示例colored-pencil-diary彩铅日记漫画(默认)笨拙黑色毡尖笔轮廓、低饱和彩铅乱涂、大留白家庭、生活、纪实情感
2极简黑白线条讲解示例minimal-line-explainer极简黑白线条讲解米白纸、细黑单线、火柴人与极少道具科普、流程、观点
3五岁儿童蜡笔坏画示例kid-crayon五岁儿童蜡笔坏画歪扭比例、线条不闭合、明亮蜡笔涂出边界童年、亲子、轻喜剧
4潦草家庭投稿蜡笔示例rawkid-crayon潦草家庭投稿蜡笔家长歪线稿、孩子粗乱上色、大片露白家庭连载、温暖日常
5小豆人涂鸦信息图示例bean-doodle-infographic小豆人涂鸦信息图黑色圆豆人、白点眼、单一橙色强调步骤、清单、知识卡
6鼠标烂涂鸦示例ms-paint-bad-doodle鼠标烂涂鸦锯齿鼠标线、荒谬比例、粗糙纯色块吐槽、反转、荒诞
7圆珠笔缠绕线速写示例ballpoint-scribble圆珠笔缠绕线速写单色圆珠笔缠绕线、疏密塑形、现场手稿感肖像、动物、独白
8真实蜡笔纸实拍示例real-crayon-paper真实蜡笔纸实拍可见纸纹、蜡质结块、压力变化与大量漏白儿童视角、成长记录
9水墨写意示例ink-wash水墨写意宣纸、浓淡干湿、飞白枯笔与朱红点睛文化、寓言、感悟
10情绪叙事淡彩速写示例emotional-watercolor-sketch情绪叙事淡彩速写靛蓝松散速写、透明淡彩、单一暖橙焦点回忆、关系、克制纪实
11中古动画水粉概念稿示例retro-gouache-concept中古动画水粉概念稿奶油纸、水粉大形、橙蓝互补、干刷边缘怀旧、城市、温暖剧情
12暖光童画绘本示例sunlit-storybook暖光童画绘本柔软水粉、暖边光、蓬松形状与未完成感治愈、童话、亲情
13北欧低饱和水粉绘本示例nordic-gouache-storybook北欧低饱和水粉绘本丹宁蓝与芥末黄、哑光颗粒、安静留白日常、自然、睡前故事
14墨线淡彩绘本示例inked-storybook墨线淡彩绘本清晰墨线、轻薄水彩、角色表演突出角色、青春、对白
15暖色几何扁平绘本示例warm-flat-storybook暖色几何扁平绘本简化几何块面、暖色平涂、清楚视觉层级关系、品牌、轻科普
16稚拙马克笔笔记示例naive-marker-notes稚拙马克笔笔记粗黑马克笔、荧光重点与随手批注感社媒、观点、年轻化内容
17Zine 孔版拼贴示例zine-riso-collageZine 孔版拼贴复印颗粒、撕纸拼贴、有限孔版套色成长、旅行、音乐文化
18有机轮廓品牌涂鸦示例organic-contour-doodle有机轮廓品牌涂鸦松弛轮廓、温暖点色、生活方式插画感餐饮、生活方式、品牌故事
19白板讲解动画示例whiteboard-explainer白板讲解动画白底黑线、少量红蓝标记、步骤清晰教程、商业解释、时间线
20粗粝木刻社论插画示例linocut-editorial粗粝木刻社论插画高反差刻痕、套色偏移、纸张颗粒社会议题、历史、寓言

查看完整菜单和每张示例图路径:

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/ 下的渲染器逻辑是核心部分,修改需要充分理由。

开源协议

MIT


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 (ffmpeg and ffprobe on PATH)
  • Google Chrome or a Remotion-managed compatible browser
  • An agent runtime with skill support (Codex, Claude Code, Kimi Code, …)

Install

  1. 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
  1. 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/
  1. Point the skill at the renderer project (skip when the agent runs inside it):
export STORY_VIDEO_PROJECT=/absolute/path/to/story-to-handdrawn-video

Usage (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.jpg

Page-flip effect (uploaded pages shown untouched, curled from the bottom-right corner):

使用 $story-to-handdrawn-video 把这些图片做成翻书效果的手绘动画:
/absolute/01.jpg /absolute/02.jpg

Preview 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.

20-style hand-drawn library

#SampleStyle idEnglish nameBest fit
1Colored-pencil diary comic samplecolored-pencil-diaryColored-pencil diary comic (default)family, everyday life, documentary emotion
2Minimal line explainer sampleminimal-line-explainerMinimal line explainereducation, process, ideas
3Kid crayon bad drawing samplekid-crayonKid crayon bad drawingchildhood, parenting, light comedy
4Raw family crayon card samplerawkid-crayonRaw family crayon cardfamily serials, warm daily moments
5Bean doodle infographic samplebean-doodle-infographicBean doodle infographicsteps, lists, knowledge cards
6MS Paint bad doodle samplems-paint-bad-doodleMS Paint bad doodlesatire, reversal, absurdity
7Ballpoint scribble sketch sampleballpoint-scribbleBallpoint scribble sketchportraits, animals, monologue
8Real crayon paper samplereal-crayon-paperReal crayon paperchild viewpoint, growth records
9Expressive ink wash sampleink-washExpressive ink washculture, fables, reflection
10Emotional light-watercolor sketch sampleemotional-watercolor-sketchEmotional light-watercolor sketchmemory, relationships, restrained documentary
11Mid-century gouache concept sampleretro-gouache-conceptMid-century gouache conceptnostalgia, cities, warm drama
12Sunlit storybook samplesunlit-storybookSunlit storybook vis-devhealing stories, fairy tales, family
13Nordic gouache storybook samplenordic-gouache-storybookNordic gouache storybookquiet daily life, nature, bedtime stories
14Inked light-watercolor storybook sampleinked-storybookInked light-watercolor storybookcharacter scenes, youth, dialogue
15Warm flat storybook samplewarm-flat-storybookWarm flat storybookrelationships, branding, light education
16Naive marker notes samplenaive-marker-notesNaive marker notessocial posts, opinions, youth content
17Zine risograph collage samplezine-riso-collageZine risograph collagegrowth, travel, music culture
18Organic contour doodle sampleorganic-contour-doodleOrganic contour doodlelifestyle, food, brand stories
19Whiteboard explainer samplewhiteboard-explainerWhiteboard explainertutorials, business concepts, timelines
20Linocut editorial samplelinocut-editorialLinocut editorialsocial issues, history, fables

List styles and their example paths:

python3 scripts/run_story_video.py --list-styles

Select 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 plan

The 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

InputModePath
Story textfinalout/picture_silent.mp4
Story textpreviewout/picture_silent-preview.mp4
Uploaded imagesfinalout/uploaded_picture_silent.mp4
Uploaded imagespreviewout/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.

关于 About

Agent skill: convert Chinese story copy or ordered images into a hand-drawn diary-comic animation (silent MP4 picture track).

语言 Languages

JavaScript66.0%
TypeScript22.8%
Python10.9%
CSS0.3%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
6
Total Commits
峰值: 3次/周
Less
More

核心贡献者 Contributors