Papermorph

DozenTwelveMIT活跃维护

把整本书自动转换成带动画、旁白和交互的网页课件,适合做互动教材和在线课程,无需手动剪辑。

An AI skill that turns books into animated, narrated, interactive web experiences

engine-v2.11发布于 2026-11-07 01:56 UTC1,494star +105 / 7 天194fork同步于 2026-11-10 05:54 UTC

怎么上手

由 README 提炼,执行前请确认
npx skills add DozenTwelve/Papermorph --skill papermorph --agent claude-code
uv run --with playwright playwright install chromium firefox
硬件要求按 README 说明

README 未说明显存或 GPU 要求;旁白可用本地 Kokoro,也可用在线 Edge TTS,其余步骤依赖 uv、ffmpeg 和 Playwright 浏览器。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把教材、故事或书籍变成带动画、配音和交互的静态网页,无需服务器和数据库

把整本书自动转换成带动画、旁白和交互的网页课件,适合做互动教材和在线课程,无需手动剪辑。

核心能力

  • 按章节规划脚本与分镜,再按旁白时间轴逐帧动画
  • 用 Edge TTS 或 Kokoro 生成旁白,每个词带时间戳
  • 模型自检输出(接触表、空帧检查、端到端测试)并修正
  • 统一播放器支持暂停、倍速、字幕、快捷键和进度保存
  • 章节可导出 1080p MP4 加 SRT,或打包成 SCORM 课件

容易踩的坑

需先装 uv、ffmpeg 和 Playwright 浏览器,否则无法渲染;ElevenLabs 配音、OpenRouter 生成片段和绘制布景是付费可选项,需自备 API key;本地预览示例要跑 serve.py 8765 并访问 http://localhost:8765/。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本engine-v2.11
  1. engine-v2.11Engine v2.11最新正式版2026-11-07 · 2026-11-07 01:56 UTC

    Sound on iPhone and iPad. Sync with python3 .claude/skills/papermorph/scripts/engine.py site.

    iOS lets a media element play on its own only if that same element once played inside a real tap. The engine made a new Audio element for every beat, so on every iOS browser the narration after the first beat was refused and the film went on silent; a listen-and-find stop's lines and chime were refused the same way.

    • Narration plays through a fixed pair of media elements (the current clip and the next one's preload), readied inside the first tap, so every beat is heard on iOS.
    • Listen-and-find lines and the chime play through elements readied the same way.
    • Elements are readied only on a real tap (touchend, click, a key, a mouse press): iOS plays muted sound on a touch's pointerdown without counting it as a tap, which had left the narration looking ready when it was not.
    • The silence used to ready an empty element is an MP3 that iOS decodes.
    • A narration clip whose play never took is asked again twice a second instead of leaving the beat silent.

    A chapter's own new Audio() played outside a tap is still silent on iOS; engine.md says so.

  2. engine-v2.10Engine v2.102026-11-06 · 2026-11-06 22:41 UTC
    查看更新说明

    Fixes from the 2026-11-06 review. Books keep working as before; sync with python3 .claude/skills/papermorph/scripts/engine.py site.

    Playback on a weak network

    • A narration clip that stalls mid-way no longer freezes the chapter.
    • A clip that failed while preloading shows the sound note at once instead of costing every later beat an 8-second wait.

    Errors that name themselves

    • tw, fx, show, draw, … with a start or length that is not a number of seconds stop with the call and the beat named (before: the beat never ended).
    • A tween key that does nothing, and an opacity attribute that o replaces, warn once per page.
    • A beat with no timings is named at boot, with the command that makes them.
    • The opening lead-in says which beat it moved and by how much (P.lead, a column in ?lengths, one console line).

    Determinism and interaction

    • Overlapping tweens on one key draw the same frame whether played or sought to.
    • Seeking replays earlier beats with no music lag left over.
    • findWords waits while the help is open.
    • boot() takes BEATS as the arrays engine.md shows.
    • The step bar takes a click on its whole height, and a click lands where its fill would show.

    Accessibility and right-to-left

    • Play and speed buttons tell a screen reader their state; the help takes the focus while open and gives it back; Space plays and pauses with the volume slider focused.
    • Right-to-left question cards space their keys and mark the current row at its start.
  3. engine-v2.9Engine v2.92026-10-31 · 2026-10-31 23:58 UTC
    查看更新说明

    Engine v2.9

    Listen and find replaces point and read, beds run to the end of a scene, and the interface reads right to left in Arabic.

    Breaking: tapWords is removed. A book that called it switches to findWords (below); no book on the site used it.

    Listen and find

    • findWords(things, asks, done, opts) in a film's ask beat: a character asks for one thing at a time ("Can you find the bird? Touch it!"). A wrong tap says that thing's name and asks again; help grows (a shake, then paper stars), and after giveUpAfter (20 s) the character shows it, so a child is never stuck and nothing is ever called wrong. A tap on nothing leaves a paper ripple.
    • things: [{ g, word, side?, clip?, talk? }] (clip defaults to w-<word>), asks: [{ word, clip, again? }] (again defaults to r-<word>), opts.end / opts.there (q-done, q-there). FIND, findMouth() and findSaw() let the scene move the asker's mouth and eyes.
    • Keyboard: arrows go left to right, Enter taps the focused thing. Captions for every line; a seek out of the stop no longer leaves one behind.
    • References: The Little Horse Crosses the River (/little-horse/ch01/) and Little Red Riding Hood's meadow (/little-red-riding-hood/ch01/).

    A scene that keeps living

    • Every ask of a film chapter keeps the scene's frame functions drawing while the page waits (P.idleAt(s) for export), not only point-and-read.

    Beds

    • sfx(beat, at, name, vol, { loop: true, to }): an ambience file laid again every (its length − 0.5 s) until to or the beat's end, and through an ask wait. A number as the 5th argument still means the seek-join length (SFX_BED).

    Arabic, right to left (#36, by @mostafaelqaseir)

    • ar interface strings, RTL_LANGUAGES, logical CSS properties; stage, player bar and mathematics stay left to right.

    Contents covers

    • The cover's meta line passes 4.5:1, no tracked eyebrow or single italic word in the title, plainer meta in all five languages.

    Checked

    • engine/check_find.py (new, replaces check_tapwords.py), check_i18n, check_latex, check_volume pass; CI (check_site, check_skill) passes.
    • Both picture books play to the end with 0 errors in Chromium and Firefox; their film lengths are unchanged.

    Syncing

    engine.py in the Skill syncs from the latest compatible release, now engine-v2.9.

  4. engine-v2.8Engine v2.82026-10-29 · 2026-10-29 01:02 UTC
    查看更新说明

    Engine v2.8

    Picture books get a point-and-read moment for young readers. Books made with v2 need no change.

    Point and read

    • tapWords(things, done) in a film's ask beat (CHAPTER.film): once the narration is over, every thing in the picture turns tappable. A tap hops it, shows its word in large letters beside it and says it (audio/<lang>/w-<word>.mp3), with the music ducked under it. A counter and Continue wait in the corner; Continue lights up once every word has been heard. Seeking or replaying clears it.
    • side: 'above' | 'below' | 'left' | 'right' places a word; without it the word goes where it fits on the stage. Hit boxes are at least 120 stage px, a child's finger on a phone.
    • The scene's continuous motion runs on while the page waits, so puppets keep breathing and blinking.
    • Things that are missing, off the stage or covered by another element are named in the console, not skipped silently.
    • The video (export.py) cannot tap: P.tapDemo shows the words one by one while it holds.
    • Interface strings in en, ru, zh and ja. A book can set --word-font for its early-reader letters.

    Stage tap questions

    • The focusable-button logic of the stage tap questions is shared with tapWords; ← / → now start from the focused target. Behaviour is otherwise unchanged.

    Checked

    • engine/check_tapwords.py (new), check_i18n, check_latex, check_volume pass.
    • Full suite: 143 of 144 pass, plus the known, unrelated failure (math-notebook/audit_chapter23, a missing timings file).
    • Little Red Riding Hood's meadow scene (/little-red-riding-hood/ch01/) is the reference.

    Syncing

    engine.py in the Skill syncs from the latest compatible release, now engine-v2.8.

  5. engine-v2.7Engine v2.72026-10-27 · 2026-10-27 11:47 UTC
    查看更新说明

    Engine v2.7

    The engine keeps its internals to itself, beats can be silent or held to a minimum, and music can be set up before the beats. Books made with v2 need no change.

    Private internals

    • The engine body runs in a closure. The 117 documented API names stay global; 67 internal names (clock, fit, frame, last, ui, segs, frameStep, …) are private, so a chapter can declare its own without "Identifier already declared" and a blank page. engine.md lists every global name.

    Beats

    • Silent beats: { dur: s } on a beat with no clip and no TIMINGS entry (a series card without voice no longer needs a silent clip).
    • { minDur: s }: the least a beat lasts, for mirrored beats that must match.
    • ?lengths prints each beat's voice length against its real length, to find beats a tween past D lengthened.

    Sound

    • music() and sfx() may be called before BEATS exists.

    Checked

    • Full suite: 141 of 143 pass, plus the known, unrelated failure; after rebasing onto main, walk_pages walks all 118 pages with no errors.
    • Old against new engine: every beat of 125 chapters in 12 books seeked; every chapter's total length identical, no new page errors. SCORM still reports the finish.

    Syncing

    engine.py in the Skill syncs from the latest compatible release, now engine-v2.7.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    1,000 stars. Thank you to everyone who starred Papermorph, tried the Skill, filed issues and sent pull requests. The first roadmap is done; the next is below.

    Everything is a static web page: no server, no database, no account. A book is a folder you can host anywhere.

    On the shelf

    Lessons, from a textbook PDF

    Formulas, diagrams and scenes change step by step as the narration explains, with quick checks and chapter practice that grade the maths, not the string. Elementary Algebra (68 chapters) · Linear Algebra (40, planes you can drag in 3D) · Elementary Mathematics (23) · Elementary Physics (9)

    Picture books, from a story, a joke or a fairy tale

    Paper puppets in front of sets drawn in code or painted by an image model, with acted voices, subtitles, sound effects, music and camera work. For children who can't read yet, the film stops for a game: a character asks for one thing at a time, the child touches it in the picture, and nothing is ever called wrong. A scanned picture book can bring its own art: the figures, sets and hand lettering are cut from the pages and moved as puppets. The Little Horse Crosses the River (小马过河) · Little Red Riding Hood · Millions of Cats (Wanda Gág, 1928, cut from the book's own pages) · Joke Collection (7 episodes)

    Documentaries and upright shorts, from a book or an idea

    Public-domain engravings, paintings, maps and charts, moved in step with the voice, with music. A documentary can be recut as a series of upright shorts for a phone feed. Madness and Civilization (10 minutes, and 4 shorts) · The Pandemic (7 minutes, 6 shorts and a scroll story)

    Pages you play

    A film can stop and hand the reader the next move, a map can be walked a year at a time, and a story can unfold as the reader scrolls. The Skill makes all three: explorable maps and scroll stories have their own starting kits. Shooting an Elephant (Orwell's essay; you hold the rifle) · Explorable maps: Time of the Magicians (Europe 1919–1929, four philosophers on the map) and The Map Redrawn (Japan 1868–1878) · The Pandemic as a scroll story

    Get started

    Install the Skill in your project, for Claude Code or OpenCode:

    npx skills add DozenTwelve/Papermorph --skill papermorph --agent claude-code   # or --agent opencode
    

    Then type /papermorph. It finds the PDF in your project (or asks for your story), tells you what kind of book it is, suggests a chapter to try first and how much animation it needs, and offers a recommended option at every step. Your choices are saved in style.json, so every later chapter is made to the same style.

    In OpenCode, a clone of this repository already has the command (.opencode/commands/papermorph.md) and the Skill; with a global install, copy that file to ~/.config/opencode/commands/.

    You need uv, ffmpeg, and Playwright's browsers (uv run --with playwright playwright install chromium firefox). Narration uses Edge TTS (online) or Kokoro (local), free. A few steps are paid, optional and need an API key: acted ElevenLabs voices for picture books and documentaries, clips made from a still (OpenRouter), and painted sets for picture books (OpenRouter or OpenAI). The newest picture books cost under $0.45 each in voices.

    How it works

    A book is planned before it is drawn: chapters or scenes, then a script, then a storyboard. The narration is voiced and every word gets a time, and the picture is animated to those times. The model then watches its own output (contact sheets, overlap and blank-frame checks, end-to-end tests, a director's review against approved books) and fixes what it sees. Large chapters are made by a team of subagents, each step on the model you choose (core/team.md). The books on the shelf were made with Opus 5.5, GPT-6.1-Sol and Sonnet 5.5; an illustrated physics chapter costs about $10–18 of model usage.

    Every book plays in the same player: pause anywhere, step back and forth, speed, captions, keyboard shortcuts, and progress saved per book, with the interface in English, Russian, Chinese, Japanese or Arabic (right to left). The player lives in engine/ and every book keeps its own copy, so a book never breaks when the engine changes; scripts/engine.py site updates them from the latest release (--from you/your-fork@main from your own).

    Any chapter or episode also renders to a 1080p MP4 with an .srt, frame by frame from the lesson clock (scripts/export.py), and a book can be packaged for an LMS as SCORM (scripts/scorm.py, courses.md).

    Roadmap

    The first roadmap is done: maths books, science books, picture books, a model of your choice for every step, documentaries, and upright shorts. So are picture books for children who can't read yet: layered paper sets, four-legged puppets and listen-and-find games, in The Little Horse and the second Little Red Riding Hood; and a picture book cut from a scanned book's own pages, Millions of Cats. A rifle, explorable maps and a scroll story came along the way, and the Skill now makes the maps and scroll stories too. Next:

    • More from a PDF of pictures. Millions of Cats cut its figures into puppets; next, tap to hear names over the painting and layers that drift in parallax. For your own books or a publisher's; our own examples use public-domain books or pictures we draw.
    • Lessons with their own examples. The textbook sets what is taught, in what order and how hard; the Skill writes new worked examples and exercises, with answers computed in code, so nothing is copied from the book.
    • One source, every shape. A single Wikipedia article made into a documentary, shorts, an interactive page and a scroll story, side by side.
    • Elementary Physics, remade with what the newer books can do.

    Working with us

    The shelf is a set of examples: the shapes that suit a maths book, a language course, a picture book or a documentary, and one source can take several of them (The Pandemic is a film, six shorts and a scroll story). For publishers, schools and studios we build the pipeline around your own titles and your own style. See the work page, or write to [email protected] with what the titles are, who they are for, and how many you have in mind.

    FAQ

    How is this different from Claude Motion? Claude Motion makes animated explainers. Papermorph makes whole books: many chapters in one consistent style, quizzes that are graded, progress that is saved, and a static site you own and can host anywhere.

    Can I make a book from any PDF? Yes, for your own use. The finished book contains new explanations and drawings, not the PDF's pages, but publishing a book based on someone else's textbook is your call to check.

    Contributing

    Fixes to the Skill and the player are welcome. Please don't open pull requests that add a copyrighted book, its PDF, or lessons made from one. Agents and people changing the repository: start with AGENTS.md.

    To try the examples locally:

    git clone --depth 1 https://github.com/DozenTwelve/Papermorph.git
    cd Papermorph
    python3 .claude/skills/papermorph/scripts/serve.py 8765 site   # then open http://localhost:8765/
    

    License

    MIT. The bundled MathJax (engine/vendor/mathjax) is under the Apache License 2.0. The MIT licence covers the code. Pictures, recordings and data under site/ keep their own licences, listed beside them (for example site/pandemic/img/SOURCES.md); toned copies of CC BY-SA pictures stay CC BY-SA.