huashu-motion 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.en.md +191 -0
- package/README.md +283 -2
- package/THIRD_PARTY.md +13 -0
- package/cli/lib/audio.js +86 -0
- package/cli/lib/beats.js +325 -0
- package/cli/lib/browser.js +37 -0
- package/cli/lib/capture.js +109 -0
- package/cli/lib/cdp.js +180 -0
- package/cli/lib/check.js +341 -0
- package/cli/lib/composed.js +129 -0
- package/cli/lib/composer.js +351 -0
- package/cli/lib/dsp.js +227 -0
- package/cli/lib/export.js +358 -0
- package/cli/lib/fonts.js +40 -0
- package/cli/lib/fork.js +73 -0
- package/cli/lib/frames.js +97 -0
- package/cli/lib/fx.js +322 -0
- package/cli/lib/inbox.js +73 -0
- package/cli/lib/kokoro.py +53 -0
- package/cli/lib/learn.js +100 -0
- package/cli/lib/project.js +239 -0
- package/cli/lib/qa.js +78 -0
- package/cli/lib/render-om.js +277 -0
- package/cli/lib/render.js +76 -0
- package/cli/lib/samples-build.js +285 -0
- package/cli/lib/samples.js +147 -0
- package/cli/lib/score.js +679 -0
- package/cli/lib/server.js +155 -0
- package/cli/lib/sound.js +560 -0
- package/cli/lib/still.js +29 -0
- package/cli/lib/swatch.js +101 -0
- package/cli/lib/voice.js +710 -0
- package/cli/om.js +384 -0
- package/examples/showcase/assets/fonts/AlfaSlabOne-400.woff +0 -0
- package/examples/showcase/assets/fonts/Anton-400.woff +0 -0
- package/examples/showcase/assets/fonts/ArchivoBlack-400.woff +0 -0
- package/examples/showcase/assets/fonts/Bangers-400.woff +0 -0
- package/examples/showcase/assets/fonts/Caveat-600.woff +0 -0
- package/examples/showcase/assets/fonts/Cinzel-400.woff +0 -0
- package/examples/showcase/assets/fonts/Cinzel-700.woff +0 -0
- package/examples/showcase/assets/fonts/CormorantGaramond-500.woff +0 -0
- package/examples/showcase/assets/fonts/EBGaramond-400.woff +0 -0
- package/examples/showcase/assets/fonts/EBGaramond-600.woff +0 -0
- package/examples/showcase/assets/fonts/Exo2-800i.woff +0 -0
- package/examples/showcase/assets/fonts/GochiHand-400.woff +0 -0
- package/examples/showcase/assets/fonts/IMFellEnglish-400.woff +0 -0
- package/examples/showcase/assets/fonts/Kalam-700.woff +0 -0
- package/examples/showcase/assets/fonts/LICENSES.md +40 -0
- package/examples/showcase/assets/fonts/LibreBaskerville-700.woff +0 -0
- package/examples/showcase/assets/fonts/LilitaOne-400.woff +0 -0
- package/examples/showcase/assets/fonts/Marcellus-400.woff +0 -0
- package/examples/showcase/assets/fonts/OFL.txt +94 -0
- package/examples/showcase/assets/fonts/PlayfairDisplay-400i.woff +0 -0
- package/examples/showcase/assets/fonts/Poppins-600.woff +0 -0
- package/examples/showcase/assets/fonts/Poppins-800.woff +0 -0
- package/examples/showcase/assets/fonts/PressStart2P-400.woff +0 -0
- package/examples/showcase/assets/fonts/UnifrakturMaguntia-400.woff +0 -0
- package/examples/showcase/index.html +170 -0
- package/examples/showcase/vendor/GSAP-LICENSE.html +2053 -0
- package/examples/showcase/vendor/GSAP-LICENSE.txt +3 -0
- package/examples/showcase/vendor/art-motion/LICENSE +21 -0
- package/examples/showcase/vendor/art-motion/NOTICE.md +12 -0
- package/examples/showcase/vendor/art-motion/engine.js +265 -0
- package/examples/showcase/vendor/art-motion/eras.js +60 -0
- package/examples/showcase/vendor/art-motion/lib/brush.js +149 -0
- package/examples/showcase/vendor/art-motion/lib/kit.js +91 -0
- package/examples/showcase/vendor/art-motion/lib/paint.js +200 -0
- package/examples/showcase/vendor/art-motion/lib/post.js +108 -0
- package/examples/showcase/vendor/art-motion/lib/render.js +188 -0
- package/examples/showcase/vendor/art-motion/lib/rig.js +390 -0
- package/examples/showcase/vendor/art-motion/lib/util.js +82 -0
- package/examples/showcase/vendor/art-motion/scenes/01_cave.js +364 -0
- package/examples/showcase/vendor/art-motion/scenes/02_egypt.js +524 -0
- package/examples/showcase/vendor/art-motion/scenes/03_greek.js +448 -0
- package/examples/showcase/vendor/art-motion/scenes/04_roman.js +555 -0
- package/examples/showcase/vendor/art-motion/scenes/05_gothic.js +522 -0
- package/examples/showcase/vendor/art-motion/scenes/06_renaissance.js +338 -0
- package/examples/showcase/vendor/art-motion/scenes/08_impressionism.js +206 -0
- package/examples/showcase/vendor/art-motion/scenes/09_postimp.js +183 -0
- package/examples/showcase/vendor/art-motion/scenes/10_nouveau.js +334 -0
- package/examples/showcase/vendor/art-motion/scenes/11_cubism.js +265 -0
- package/examples/showcase/vendor/art-motion/scenes/12_bauhaus.js +214 -0
- package/examples/showcase/vendor/art-motion/scenes/13_pop.js +269 -0
- package/examples/showcase/vendor/art-motion/scenes/14_8bit.js +238 -0
- package/examples/showcase/vendor/art-motion/scenes/15_raytrace.js +300 -0
- package/examples/showcase/vendor/art-motion/scenes/16_2026.js +565 -0
- package/examples/showcase/vendor/art-motion/scenes/index.js +28 -0
- package/examples/showcase/vendor/art-motion/transitions.js +928 -0
- package/examples/showcase/vendor/gsap.min.js +11 -0
- package/examples/showcase/vendor/om.js +205 -0
- package/examples/voice-demo/assets/fonts/LICENSES.md +40 -0
- package/examples/voice-demo/assets/fonts/NotoSansSC-500.woff +0 -0
- package/examples/voice-demo/assets/fonts/NotoSansSC-900.woff +0 -0
- package/examples/voice-demo/assets/fonts/OFL.txt +94 -0
- package/examples/voice-demo/assets/voice.wav +0 -0
- package/examples/voice-demo/assets/voice.words.json +180 -0
- package/examples/voice-demo/index.html +203 -0
- package/examples/voice-demo/script.txt +4 -0
- package/examples/voice-demo/vendor/GSAP-LICENSE.html +2053 -0
- package/examples/voice-demo/vendor/GSAP-LICENSE.txt +3 -0
- package/examples/voice-demo/vendor/gsap.min.js +11 -0
- package/examples/voice-demo/vendor/om.js +205 -0
- package/fonts/AlfaSlabOne-400.woff +0 -0
- package/fonts/Anton-400.woff +0 -0
- package/fonts/ArchivoBlack-400.woff +0 -0
- package/fonts/Bangers-400.woff +0 -0
- package/fonts/Caveat-600.woff +0 -0
- package/fonts/Cinzel-400.woff +0 -0
- package/fonts/Cinzel-700.woff +0 -0
- package/fonts/CormorantGaramond-500.woff +0 -0
- package/fonts/CormorantGaramond-500i.woff +0 -0
- package/fonts/CormorantGaramond-700.woff +0 -0
- package/fonts/EBGaramond-400.woff +0 -0
- package/fonts/EBGaramond-400i.woff +0 -0
- package/fonts/EBGaramond-600.woff +0 -0
- package/fonts/Exo2-800i.woff +0 -0
- package/fonts/GochiHand-400.woff +0 -0
- package/fonts/IMFellEnglish-400.woff +0 -0
- package/fonts/IMFellEnglish-400i.woff +0 -0
- package/fonts/Inter-var.woff +0 -0
- package/fonts/JosefinSans-700.woff +0 -0
- package/fonts/Kalam-700.woff +0 -0
- package/fonts/LICENSES.md +40 -0
- package/fonts/LXGWWenKai-500.woff +0 -0
- package/fonts/LibreBaskerville-400.woff +0 -0
- package/fonts/LibreBaskerville-700.woff +0 -0
- package/fonts/LilitaOne-400.woff +0 -0
- package/fonts/Marcellus-400.woff +0 -0
- package/fonts/NotoSansSC-500.woff +0 -0
- package/fonts/NotoSansSC-700.woff +0 -0
- package/fonts/NotoSansSC-800.woff +0 -0
- package/fonts/NotoSansSC-900.woff +0 -0
- package/fonts/OFL.txt +94 -0
- package/fonts/PlayfairDisplay-400i.woff +0 -0
- package/fonts/PlayfairDisplay-700.woff +0 -0
- package/fonts/PlayfairDisplay-700i.woff +0 -0
- package/fonts/Poppins-600.woff +0 -0
- package/fonts/Poppins-700.woff +0 -0
- package/fonts/Poppins-800.woff +0 -0
- package/fonts/PressStart2P-400.woff +0 -0
- package/fonts/Righteous-400.woff +0 -0
- package/fonts/RobotoCondensed-var.woff +0 -0
- package/fonts/Rye-400.woff +0 -0
- package/fonts/UnifrakturMaguntia-400.woff +0 -0
- package/fonts/cmunrm.woff +0 -0
- package/fonts/cmunti.woff +0 -0
- package/fonts/index.json +259 -0
- package/package.json +14 -4
- package/runtime/camera-rig.js +18 -0
- package/runtime/clip/LICENSE +21 -0
- package/runtime/clip/NOTICE.md +31 -0
- package/runtime/clip/clip.js +223 -0
- package/runtime/clip/cues.js +71 -0
- package/runtime/clip/grammars/t1_3b1b.js +206 -0
- package/runtime/clip/grammars/t2_keynote_ui.js +273 -0
- package/runtime/clip/grammars/t3_finance_chart.js +196 -0
- package/runtime/clip/grammars/y1_kurzgesagt.js +153 -0
- package/runtime/clip/grammars/y2_vox.js +152 -0
- package/runtime/clip/grammars/y3_whiteboard.js +217 -0
- package/runtime/clip/grammars/y4_storytime.js +182 -0
- package/runtime/clip/grammars/y5_kinetic_type.js +138 -0
- package/runtime/clip/lib/camera.js +61 -0
- package/runtime/clip/lib/chart.js +152 -0
- package/runtime/clip/lib/collage.js +97 -0
- package/runtime/clip/lib/diagram.js +264 -0
- package/runtime/clip/lib/kit.js +91 -0
- package/runtime/clip/lib/motion.js +103 -0
- package/runtime/clip/lib/paint.js +200 -0
- package/runtime/clip/lib/toon.js +159 -0
- package/runtime/clip/lib/typo.js +122 -0
- package/runtime/clip/lib/ui.js +141 -0
- package/runtime/clip/lib/util.js +82 -0
- package/runtime/clip/test/cues.test.js +107 -0
- package/runtime/om-engine.js +269 -0
- package/runtime/om-player.js +138 -0
- package/runtime/om.js +205 -0
- package/skills/huashu-motion/SKILL.md +95 -0
- package/skills/huashu-motion/bin/om +5 -0
- package/skills/huashu-motion/references/colour.md +136 -0
- package/skills/huashu-motion/references/contract.md +59 -0
- package/skills/huashu-motion/references/craft.md +41 -0
- package/skills/huashu-motion/references/director.md +217 -0
- package/skills/huashu-motion/references/experience.md +225 -0
- package/skills/huashu-motion/references/grammars.md +57 -0
- package/skills/huashu-motion/references/library/README.md +80 -0
- package/skills/huashu-motion/references/library/formats.md +186 -0
- package/skills/huashu-motion/references/library/languages/3d-object.md +42 -0
- package/skills/huashu-motion/references/library/languages/art-styles.md +25 -0
- package/skills/huashu-motion/references/library/languages/card-montage.md +71 -0
- package/skills/huashu-motion/references/library/languages/character.md +41 -0
- package/skills/huashu-motion/references/library/languages/continuous-morph.md +79 -0
- package/skills/huashu-motion/references/library/languages/cursor-demo.md +84 -0
- package/skills/huashu-motion/references/library/languages/data-story.md +46 -0
- package/skills/huashu-motion/references/library/languages/editorial-collage.md +35 -0
- package/skills/huashu-motion/references/library/languages/flat-world.md +32 -0
- package/skills/huashu-motion/references/library/languages/generative-field.md +34 -0
- package/skills/huashu-motion/references/library/languages/hand-drawn.md +36 -0
- package/skills/huashu-motion/references/library/languages/kinetic-type.md +66 -0
- package/skills/huashu-motion/references/library/languages/liquid-glass.md +26 -0
- package/skills/huashu-motion/references/library/languages/mechanism.md +38 -0
- package/skills/huashu-motion/references/library/languages/modular-grid.md +41 -0
- package/skills/huashu-motion/references/library/languages/photo-led.md +27 -0
- package/skills/huashu-motion/references/library/languages/retro-digital.md +25 -0
- package/skills/huashu-motion/references/library/languages/showreel.md +52 -0
- package/skills/huashu-motion/references/library/languages/system-diagram.md +36 -0
- package/skills/huashu-motion/references/library/languages/talking-head.md +9 -0
- package/skills/huashu-motion/references/library/product-fit.md +100 -0
- package/skills/huashu-motion/references/library/techniques.md +349 -0
- package/skills/huashu-motion/references/product-demo-continuity.md +69 -0
- package/skills/huashu-motion/references/provenance.md +17 -0
- package/skills/huashu-motion/references/rhythm.md +194 -0
- package/skills/huashu-motion/references/scores/first-light.abc +53 -0
- package/skills/huashu-motion/references/scores/four-rooms.abc +66 -0
- package/skills/huashu-motion/references/scores/signal.abc +67 -0
- package/skills/huashu-motion/references/sound.md +141 -0
- package/skills/huashu-motion/references/talking-head.md +125 -0
- package/skills/huashu-motion/references/verification.md +13 -0
- package/skills/huashu-motion/references/visual-direction.md +78 -0
- package/studio/index.html +90 -0
- package/studio/studio.css +140 -0
- package/studio/studio.js +555 -0
- package/templates/blank/assets/fonts/LICENSES.md +40 -0
- package/templates/blank/assets/fonts/NotoSansSC-500.woff +0 -0
- package/templates/blank/assets/fonts/NotoSansSC-900.woff +0 -0
- package/templates/blank/assets/fonts/OFL.txt +94 -0
- package/templates/blank/index.html +98 -0
- package/templates/blank/template.json +6 -0
- package/templates/blank/vendor/GSAP-LICENSE.html +2053 -0
- package/templates/blank/vendor/GSAP-LICENSE.txt +3 -0
- package/templates/blank/vendor/gsap.min.js +11 -0
- package/templates/finance-chart/index.html +112 -0
- package/templates/finance-chart/template.json +27 -0
- package/templates/keynote-ui/assets/chart.png +0 -0
- package/templates/keynote-ui/index.html +112 -0
- package/templates/keynote-ui/template.json +28 -0
- package/templates/kinetic-type/index.html +96 -0
- package/templates/kinetic-type/template.json +28 -0
- package/templates/kurzgesagt/index.html +100 -0
- package/templates/kurzgesagt/template.json +27 -0
- package/templates/math-3b1b/index.html +115 -0
- package/templates/math-3b1b/template.json +28 -0
- package/templates/storytime/index.html +93 -0
- package/templates/storytime/template.json +26 -0
- package/templates/talking-head/index.html +355 -0
- package/templates/talking-head/template.json +14 -0
- package/templates/vox-collage/assets/kline.png +0 -0
- package/templates/vox-collage/assets/revenue-portrait.png +0 -0
- package/templates/vox-collage/index.html +88 -0
- package/templates/vox-collage/template.json +26 -0
- package/templates/whiteboard/index.html +99 -0
- package/templates/whiteboard/template.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Huashu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | **English**
|
|
4
|
+
|
|
5
|
+
<img src="docs/media/hero.gif" alt="Opening of the huashu-motion launch film: a wall of films, one sentence, one film" width="100%" />
|
|
6
|
+
|
|
7
|
+
# huashu-motion
|
|
8
|
+
|
|
9
|
+
> *"Commercial-grade product launch films, in one go."*
|
|
10
|
+
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://agentskills.io)
|
|
13
|
+
[](#install)
|
|
14
|
+
|
|
15
|
+
**Your coding agent makes the motion graphics, writes the score, and you point at the frame to change it.**
|
|
16
|
+
|
|
17
|
+
Tell Claude Code or Codex "make a 30-second launch film for my product". It reads the product, shows you three directions,<br>
|
|
18
|
+
writes the film, composes its music, and opens an editor in your browser.<br>
|
|
19
|
+
Click the frame where something is off, type what you want, and it changes exactly that.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npx skills add alchaincyf/huashu-motion
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[See it](#see-it) · [Install](#install) · [What it does](#what-it-does) · [How it works](#how-it-works)
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## See it
|
|
32
|
+
|
|
33
|
+
Every animation in this README was made with huashu-motion. The clip above opens the 53-second film it made about itself. 👉 [Download the full film (MP4, with sound)](https://github.com/alchaincyf/huashu-motion/releases/latest); the full Grok Bot, huashu-design and DeepSeek films are on the same page.
|
|
34
|
+
|
|
35
|
+
### Point at the frame
|
|
36
|
+
|
|
37
|
+
<img src="docs/media/point-to-edit.gif" alt="Press C in the editor, click the opening frame, write a note; the agent picks it up and the preview reloads at the same moment" width="100%" />
|
|
38
|
+
|
|
39
|
+
Press **C**, click the frame, type the change. The comment carries the time, the scene, the object under your cursor and its line in the source. The agent looks at that frame and a close-up of the spot first, changes only that, and replies in one line; the preview reloads where you were. Every version is kept and ⌘Z undoes. Titles, numbers, colours and hold times show up as fields you can edit yourself.
|
|
40
|
+
|
|
41
|
+
(The editor and terminal in this clip are rebuilt from the real interface; code details are illustrative. The comment is a real one.)
|
|
42
|
+
|
|
43
|
+
### Score first, then the picture
|
|
44
|
+
|
|
45
|
+
<img src="docs/media/score-first.gif" alt="The agent's ABC score turns into a moving staff; the picture cuts on the beat where each red scene mark lands" width="100%" />
|
|
46
|
+
|
|
47
|
+
For launch films the agent writes a score in ABC notation, with marks that land on the scenes, and a sampled grand piano, string sections and drum kits play it (after a one-time `om samples build`; otherwise synths). Each landing gets a sound effect on its frame. All of it is generated locally; no paid API.
|
|
48
|
+
|
|
49
|
+
### Twenty films in a day
|
|
50
|
+
|
|
51
|
+
<img src="docs/media/sixteen-cuts.gif" alt="Sixteen shots from seven different films, cut on the beat" width="100%" />
|
|
52
|
+
|
|
53
|
+
Sixteen shots from seven films made the same day, cut on the beat.
|
|
54
|
+
|
|
55
|
+
<img src="docs/media/grok-bot.gif" alt="Grok Bot fan film: the 'Sending to Chief…' pill stays put while each agent takes the screen in its own colour, ending in a grid of eight" width="100%" />
|
|
56
|
+
|
|
57
|
+
Grok Bot (fan-made, not official) · 30 s: hand over the work in the evening, agents work through the night, reports land on your phone at 7 am. This is the stretch where the reports go to the Chief of Staff.
|
|
58
|
+
|
|
59
|
+
<table><tr>
|
|
60
|
+
<td width="50%"><img src="docs/media/huashu-design.gif" alt="huashu-design film: one prompt pinned in the middle while the styles behind it change on the beat" width="100%" /><br/>huashu-design 3.0 · one prompt stays put, the styles behind it change on the beat</td>
|
|
61
|
+
<td width="50%" align="center"><img src="docs/media/catlight-pro.gif" alt="Catlight Pro vertical film: eight light colours, one per beat" width="60%" /><br/>Catlight Pro · eight light colours, one per beat</td>
|
|
62
|
+
</tr></table>
|
|
63
|
+
|
|
64
|
+
### It doesn't need Opus: DeepSeek V4.1 Flash
|
|
65
|
+
|
|
66
|
+
<img src="docs/media/deepseek-flash.gif" alt="A motion film made by DeepSeek V4.1 Flash: the whale logo, MOTION, MASK, GLITCH, one dot carried through" width="100%" />
|
|
67
|
+
|
|
68
|
+
This 22-second film was made with Claude Code running on DeepSeek V4.1 Flash (the 1017 release). I gave three rounds of notes (add DeepSeek's whale logo, drop a few shots); with music and effects it took under half an hour and cost ¥1.95 at the time (99.4% cache hits). The single palette, the dot carried through the film and the music locked to 124 BPM came from the skill; I never asked for them. With the method in the skill, a cheap model makes a good film too.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Install
|
|
73
|
+
|
|
74
|
+
Ask your agent:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Install the huashu-motion skill (github.com/alchaincyf/huashu-motion) and run the demo
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Or:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
npx skills add alchaincyf/huashu-motion
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or clone the repo and link `skills/huashu-motion` into your agent's skills folder; the skill's `bin/om` then runs the CLI from the clone.
|
|
87
|
+
|
|
88
|
+
It runs in Claude Code, Codex, WorkBuddy, Grok Bot, Muse, Dots and more; it follows the [Agent Skills](https://agentskills.io) standard, so any skill-capable agent can install it.
|
|
89
|
+
|
|
90
|
+
Requirements:
|
|
91
|
+
|
|
92
|
+
- Node 22+.
|
|
93
|
+
- Google Chrome, Chromium or Edge. Stills, checks and export run in the browser you already have; no renderer is downloaded.
|
|
94
|
+
- FFmpeg, for export and the soundtrack.
|
|
95
|
+
- Optional: `om samples build` downloads a ~55 MB pack of CC0 / CC-BY instrument samples once; without it the music uses synths.
|
|
96
|
+
- Optional narration: macOS system voices need nothing; Kokoro voices print a one-line setup the first time (uv and Python 3.12, a ~325 MB model); word timing needs `whisper-cli` (`brew install whisper-cpp`).
|
|
97
|
+
|
|
98
|
+
`om doctor` tells you what is missing. Tested on macOS only so far. Codex's sandbox blocks the local preview and the browser; approve them when asked.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## What it does
|
|
103
|
+
|
|
104
|
+
| You say | It does |
|
|
105
|
+
|---|---|
|
|
106
|
+
| "Make a 30-second launch film for my product, site is xxx.com" | Reads the product, shows three directions as key frames, writes a rhythm sheet, builds the film, scores it, opens the editor |
|
|
107
|
+
| "Turn data/funnel.csv into a 30-second explainer on why signups doubled" | A data story: axes, then data, then one annotation; numbers become editable fields |
|
|
108
|
+
| "Add narration from my recording: voice.m4a" | Word-level alignment, motion lands on the word, subtitles, music ducks under the voice |
|
|
109
|
+
| "Package this talking-head video" | Name plate, number cards, keyword captions, chapter cards, exported as a transparent overlay for CapCut or Premiere |
|
|
110
|
+
| "Make it vertical" | A 1080×1920 copy, with the re-layout waiting in the inbox |
|
|
111
|
+
| "Export a GIF" / "transparent" / "a page to share" | MP4, MOV (alpha), WebM, GIF, or a share page with a player and the source |
|
|
112
|
+
|
|
113
|
+
Before a film it reads your past preferences and what earlier films taught; after it, it keeps what is worth keeping. Your preferences stay on your machine.
|
|
114
|
+
|
|
115
|
+
## How it works
|
|
116
|
+
|
|
117
|
+
- **A film is one `index.html`.** GSAP, Canvas, Three.js, SVG, anything a browser draws. No video model; every frame is a function of the code and the time.
|
|
118
|
+
- **Director rules, not templates.** Measured from 21 real launch films (cuts, beats, loudness, energy curves) and 142 high-engagement launch and motion films, organised into 20 motion languages. Every film starts with a rhythm sheet: a hook within 3 s, a burst in the middle, a beat of silence before the biggest hit.
|
|
119
|
+
- **Sound is half of it.** Composer mode (the agent writes the score, sampled instruments play it), 12 product types × 3 fallback music directions, 23 sound effects placed on the line where the motion lands, narration from a system voice or your own recording.
|
|
120
|
+
- **Its own render engine.** Several Chrome instances at once (by CPU count, up to 8 by default), picture and audio encoded in parallel, unchanged music reused. A 30-second film renders in about 12–15 s on my 14-core Mac; with motion blur, about 1–1.5 min.
|
|
121
|
+
- **Checked before delivery.** `om check` (scripts, files, motion rules, cut-off or covered text), `om qa` (single-frame pops, dead time, motion curve), and the skill asks the agent to watch the frames and, when it can, have another agent review cold.
|
|
122
|
+
|
|
123
|
+
| Command | What it does |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `om new` · `om templates` | Start a project, from one of 10 templates |
|
|
126
|
+
| `om studio` | Live preview, scene strip, direct edits, frame comments |
|
|
127
|
+
| `om inbox --wait` · `om look` · `om done` | Agent side: take the next comment, see the spot, report back |
|
|
128
|
+
| `om sound` · `om voice` · `om samples` | Music and effects, narration, the instrument pack |
|
|
129
|
+
| `om check` · `om qa` · `om still` | Before and after rendering |
|
|
130
|
+
| `om render` · `om export html` · `om fork` | Export, share page, new frame size |
|
|
131
|
+
| `om learn` · `om undo` · `om doctor` | Experience, undo, environment check |
|
|
132
|
+
|
|
133
|
+
## What's inside
|
|
134
|
+
|
|
135
|
+
| | |
|
|
136
|
+
|---|---|
|
|
137
|
+
| Motion languages, each with what it says, what it suits and how to build it | 20, `skills/huashu-motion/references/library/` |
|
|
138
|
+
| Starter templates (keynote, finance chart, kinetic type, whiteboard, Vox collage, 3Blue1Brown, Kurzgesagt, talking-head package, …) | 10, `templates/` |
|
|
139
|
+
| Sound effects | 23 |
|
|
140
|
+
| Fallback music directions | 12 product types × 3 |
|
|
141
|
+
| Annotated example scores | 3, `skills/huashu-motion/references/scores/` |
|
|
142
|
+
| Fonts (CJK 500–900, serif, display) | 27, `fonts/` |
|
|
143
|
+
|
|
144
|
+
## Limits
|
|
145
|
+
|
|
146
|
+
- It can't hear. The agent checks music through the score, the energy curve and a spectrogram; the last listen is yours.
|
|
147
|
+
- It doesn't generate people or live footage. Everything is drawn in code; bring your own footage and it composes and packages it.
|
|
148
|
+
- Results depend on the model. I mostly use Opus 5.5 in Claude Code; DeepSeek V4.1 Flash does well too, but taste differs between models.
|
|
149
|
+
- It needs a machine that can run Node, Chrome and FFmpeg.
|
|
150
|
+
|
|
151
|
+
## Why it exists
|
|
152
|
+
|
|
153
|
+
On 8 October 2026 Anthropic released Claude Motion: Claude animates reports, charts and product explainers in code, and you point at a part to edit it. At launch it was a beta for Team and Enterprise only. In April I had turned Claude Design's core ideas into a skill, [huashu-design](https://github.com/alchaincyf/huashu-design); after Motion came out I gave Claude Code one line: *our skill should fully reproduce Claude Motion, and be much stronger.*
|
|
154
|
+
|
|
155
|
+
The first day's result was dull: an editor, version history, a hundred-odd tests, and a 19-second 3D city whose camera moved so evenly it was mediocre. Claude's own review said it had built a project very good at proving it wasn't lying, and nothing anyone would want to share. We started over that day. Most of the time since went into making the films good: measuring real launch films, asking for film-score music, and turning every "not cool", "boring" or "ugly font" into a rule in the skill. Then it made its own launch film, the one at the top of this page.
|
|
156
|
+
|
|
157
|
+
## Credits and license
|
|
158
|
+
|
|
159
|
+
Code and docs are MIT. Bundled third-party pieces keep their licenses: GSAP (GSAP Standard License) and the fonts (SIL OFL 1.1). Instrument samples, the Kokoro voice model and whisper.cpp models are downloaded from their sources on first use and not redistributed. The films that were measured are kept as numbers only, no frames. The `om demo` film uses the painting engine from [huashu-art-motion](https://github.com/alchaincyf/huashu-art-motion). See [THIRD_PARTY.md](THIRD_PARTY.md).
|
|
160
|
+
|
|
161
|
+
Exception: the "bean Huashu" character (drawn in `runtime/clip/lib/toon.js`, and as it appears in the storytime template and demo films) is Huashu's cartoon likeness, for demonstrating this project only, and is not licensed under MIT for other uses.
|
|
162
|
+
|
|
163
|
+
## About the author
|
|
164
|
+
|
|
165
|
+
**Huashu (花叔)** — AI-native coder and indie developer. Known for Catlight (小猫补光灯, #1 on the App Store paid chart).
|
|
166
|
+
|
|
167
|
+
| | |
|
|
168
|
+
|:---|:---|
|
|
169
|
+
| 🌐 Site | [bookai.top](https://bookai.top) · [huasheng.ai](https://www.huasheng.ai) |
|
|
170
|
+
| 𝕏 Twitter | [@AlchainHust](https://x.com/AlchainHust) |
|
|
171
|
+
| ▶️ YouTube | [@Alchain](https://www.youtube.com/@Alchain) |
|
|
172
|
+
| 📺 Bilibili | [花叔v](https://space.bilibili.com/14097567) |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
<div align="center">
|
|
177
|
+
|
|
178
|
+
**[nuwa-skill](https://github.com/alchaincyf/nuwa-skill)** makes skills. **[huashu-design](https://github.com/alchaincyf/huashu-design)** designs. **[huashu-art-motion](https://github.com/alchaincyf/huashu-art-motion)** makes paintings move. **huashu-motion** lets your agent make the launch film.
|
|
179
|
+
|
|
180
|
+
MIT License © [花叔 Huashu](https://github.com/alchaincyf)
|
|
181
|
+
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
<div align="center">
|
|
187
|
+
<sub>also by 花叔</sub>
|
|
188
|
+
|
|
189
|
+
[](https://github.com/alchaincyf/fanbox)
|
|
190
|
+
|
|
191
|
+
</div>
|
package/README.md
CHANGED
|
@@ -1,3 +1,284 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**简体中文** | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
<img src="docs/media/hero.gif" alt="huashu-motion发布片开场:一整面墙的片子,说一句,出一支片" width="100%" />
|
|
6
|
+
|
|
7
|
+
# huashu-motion
|
|
8
|
+
|
|
9
|
+
> *「一键直出商业级产品宣传片。」*
|
|
10
|
+
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://agentskills.io)
|
|
13
|
+
[](#安装)
|
|
14
|
+
|
|
15
|
+
**让你的agent做动画、作曲,指着画面改。**
|
|
16
|
+
|
|
17
|
+
跟Claude Code、Codex这些agent说一句「给我的产品做个30秒的发布片」,<br>
|
|
18
|
+
它会先读你的产品,给你三个方向挑,写出整支片子,自己写谱配乐,<br>
|
|
19
|
+
然后在浏览器里打开一个编辑器等你。哪里不满意,在画面上点一下,写下要改什么,它就只改那一处。
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npx skills add alchaincyf/huashu-motion
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[看效果](#看效果) · [安装](#安装) · [能做什么](#能做什么) · [怎么做到的](#怎么做到的) · [背后的故事](#背后的故事)
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 看效果
|
|
32
|
+
|
|
33
|
+
这篇README里的每一段动画都是huashu-motion做的。上面那段取自它给自己做的53秒发布片,👉 [下载完整发布片(MP4,带声音)](https://github.com/alchaincyf/huashu-motion/releases/latest),下面Grok Bot、huashu-design、DeepSeek这几支的完整版也在同一个页面。
|
|
34
|
+
|
|
35
|
+
### 指着画面改
|
|
36
|
+
|
|
37
|
+
<img src="docs/media/point-to-edit.gif" alt="在编辑器里按C,点中开场画面,写下「第一帧开场的效果我觉得很差,还不如核心聚焦在typing呢」,agent接单改完,预览停在原处刷新" width="100%" />
|
|
38
|
+
|
|
39
|
+
按C,在画面上点一下,写下要改什么。评论发过去的时候带着时间点、场景、点中的元素和它在源码里的位置,agent先把那一帧和你点的那一小块截图放大看一眼,再只改那一处,改完回一句人话,预览停在原来的位置刷新。每一版都留着,⌘Z随时撤回;标题、数字、颜色、停留时长这些会变成编辑器右边的输入框,自己改,不用等agent。
|
|
40
|
+
|
|
41
|
+
(这段里的编辑器和终端是照真实界面重建的,代码细节是示意;评论是真实提过的意见。)
|
|
42
|
+
|
|
43
|
+
### 先写谱,再拍片
|
|
44
|
+
|
|
45
|
+
<img src="docs/media/score-first.gif" alt="agent写的ABC乐谱变成五线谱往前走,红色场景标记落在哪一拍,画面就在哪一拍切" width="100%" />
|
|
46
|
+
|
|
47
|
+
做发布片用的是作曲家模式:agent按节奏单先写一份谱(ABC记谱法,纯文本的乐谱),谱里的标记对齐每个场景,再由三角钢琴、弦乐和鼓组的采样演奏出来(真乐器采样要先跑一次`om samples build`,不跑就用合成音色);画面上每个东西落地的那一帧,再配一个音效。配乐全部在本机现场生成,不调用任何收费接口。
|
|
48
|
+
|
|
49
|
+
### 一天,二十支
|
|
50
|
+
|
|
51
|
+
<img src="docs/media/sixteen-cuts.gif" alt="16个镜头来自七支不同的片子,按拍子快切" width="100%" />
|
|
52
|
+
|
|
53
|
+
16个镜头,来自同一天做的七支片子,按拍子切。
|
|
54
|
+
|
|
55
|
+
<img src="docs/media/grok-bot.gif" alt="Grok Bot粉丝片:Sending to Chief…的气泡钉住不动,背后每个agent各占一屏颜色,最后汇成八宫格" width="100%" />
|
|
56
|
+
|
|
57
|
+
Grok Bot(粉丝自制,非官方)· 30秒:傍晚交代任务,夜里几个agent各干各的,早上7点手机上收到汇报。这段是汇报一张张送往Chief of Staff的那几拍。
|
|
58
|
+
|
|
59
|
+
<table><tr>
|
|
60
|
+
<td width="50%"><img src="docs/media/huashu-design.gif" alt="huashu-design宣传片:一句「给社区旧书店做一份众筹PPT」钉在画面中间,背后的风格按拍子一格一格地换" width="100%" /><br/>huashu-design 3.0 · 一句提示词钉住不动,背后的风格按拍子换</td>
|
|
61
|
+
<td width="50%" align="center"><img src="docs/media/catlight-pro.gif" alt="小猫补光灯Pro竖屏片:八种补光色,一拍换一种" width="60%" /><br/>小猫补光灯Pro · 八种补光色,一拍换一种</td>
|
|
62
|
+
</tr></table>
|
|
63
|
+
|
|
64
|
+
### 不依赖Opus:DeepSeek V4.1 Flash也能做
|
|
65
|
+
|
|
66
|
+
<img src="docs/media/deepseek-flash.gif" alt="DeepSeek V4.1 Flash做的动效片:鲸鱼logo、MOTION、MASK、GLITCH,一个圆点贯穿全片" width="100%" />
|
|
67
|
+
|
|
68
|
+
这支22秒的动效片,是把Claude Code背后的模型换成DeepSeek V4.1 Flash(1017版)做的。中间我给了三轮意见(比如加上DeepSeek的鲸鱼logo、删掉几个镜头),带配乐和音效,前后不到半小时,按当时的价格花了1块9毛5(缓存命中率99.4%)。统一的配色、贯穿全片的那颗圆点、卡在124BPM上的配乐,是skill带出来的,我一句都没提过。方法写进了skill,便宜的模型也能拍出像样的片子。
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 安装
|
|
73
|
+
|
|
74
|
+
### 方式一:跟你的agent说(推荐)
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
帮我安装huashu-motion这个skill(github.com/alchaincyf/huashu-motion),装好后跑一遍demo
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 方式二:一行命令
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
npx skills add alchaincyf/huashu-motion
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
[skills](https://github.com/vercel-labs/skills)会认出你在用的agent,把skill放进对应目录;要指定的话加`-a claude-code`、`-a codex`等参数。
|
|
87
|
+
|
|
88
|
+
Claude Code、Codex、WorkBuddy、Grok Bot、Muse、Dots等产品都能跑;它遵循[Agent Skills](https://agentskills.io)协议,支持skill的agent都能装。
|
|
89
|
+
|
|
90
|
+
### 方式三:克隆整个仓库
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary>展开查看</summary>
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
git clone https://github.com/alchaincyf/huashu-motion.git
|
|
97
|
+
ln -s "$PWD/huashu-motion/skills/huashu-motion" ~/.claude/skills/huashu-motion # Codex换成~/.codex/skills/
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
skill里的`bin/om`会直接调用仓库里的命令行工具,改仓库就是改skill,本机只有一份。
|
|
101
|
+
|
|
102
|
+
</details>
|
|
103
|
+
|
|
104
|
+
### 需要什么
|
|
105
|
+
|
|
106
|
+
- Node 22以上。
|
|
107
|
+
- Chrome(或Chromium、Edge):截帧、检查、导出都用你电脑上已经装好的浏览器,不额外下载渲染器。
|
|
108
|
+
- FFmpeg:导出视频、合成配乐要用。
|
|
109
|
+
- 真乐器音色(可选):想要三角钢琴、弦乐、鼓组,让agent跑一次`om samples build`,下载约55MB的免费采样(CC0和CC-BY授权);不跑就用合成音色。
|
|
110
|
+
- 口播(可选):macOS的系统音色不用装;想用Kokoro念中文稿,第一次用时会给出一行安装命令(要uv和Python 3.12,模型约325MB);逐字对齐要装whisper-cli(`brew install whisper-cpp`)。
|
|
111
|
+
|
|
112
|
+
缺什么跑`om doctor`就知道,这些都可以直接让agent帮你装。目前只在macOS上实测过。Codex的沙箱会拦本地预览和浏览器,遇到时手动批准一下。
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 能做什么
|
|
117
|
+
|
|
118
|
+
装好以后,直接跟agent说:
|
|
119
|
+
|
|
120
|
+
| 你说 | 它做 |
|
|
121
|
+
|---|---|
|
|
122
|
+
| 「用huashu-motion给我的产品做一支30秒的发布片,官网是xxx.com」 | 先读产品,出三个方向的关键帧给你挑,写节奏单,再写片、作曲配乐,打开编辑器等你 |
|
|
123
|
+
| 「把data/funnel.csv做成30秒解说,讲清楚为什么注册率翻倍了」 | 按数据讲故事:先轴、后数据、只标一件事,数字变成可以直接改的输入框 |
|
|
124
|
+
| 「做一支发布片,要口播,用我自己的录音:voice.m4a」 | 逐字对齐,画面落在说到的那个词上,自动出字幕,配乐在说话时让位 |
|
|
125
|
+
| 「这条口播视频加个包装」 | 名字条、数字卡、关键词花字、章节卡,导出带透明通道的叠层,直接拖进剪映或Premiere |
|
|
126
|
+
| 「改成竖屏」 | 复制一份1080×1920的版本,重新排版的活儿进收件箱,接着改 |
|
|
127
|
+
| 「导出GIF」「要透明底」「做成网页分享」 | MP4、MOV(透明)、WebM、GIF;或者导出一个带播放器和源码的分享页 |
|
|
128
|
+
|
|
129
|
+
开工前,它会先读你以前的偏好和过去片子留下的经验;每支片子做完,再把你这次说过的话、在编辑器里提的评论收一遍,值得留下的记下来。你的偏好只存在你自己电脑上。
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 怎么做到的
|
|
134
|
+
|
|
135
|
+
### 一支片子就是一个`index.html`
|
|
136
|
+
|
|
137
|
+
画面用代码写,GSAP、Canvas、Three.js、SVG,浏览器能画的都能用;不调用视频生成模型,每一帧只由代码和时间决定。没有私有格式,片子就是一个网页,带走就能用。
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
你的agent ──写──▶ my-film/index.html ◀──盯着── om studio(浏览器里的编辑器)
|
|
141
|
+
▲ │
|
|
142
|
+
└── om inbox --wait ◀── .om/inbox.jsonl ◀── 你在画面上点一下、写一句
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 导演规则,不是模板
|
|
146
|
+
|
|
147
|
+
skill最大的一块是导演方法:先读产品、找出它的气质,再选片子的结构和运动语言。这些规则来自实测,不是拍脑袋:
|
|
148
|
+
|
|
149
|
+
- 拿21支真实的发布片(Apple、Nothing、GoPro、Google、Vercel、Linear、Anthropic等),用FFmpeg逐支量切点、节拍、响度和能量曲线;
|
|
150
|
+
- 拆了142支高互动的发布片和动效片,按产品类型整理出20种运动语言,每种写清楚它在说什么、适合什么产品;
|
|
151
|
+
- 每支片子开工前先写一张节奏单:3秒内要有钩子,中段要有一次爆发,最响的那一下前面先停一拍。
|
|
152
|
+
|
|
153
|
+
颜色也量过:顶级发布片的颜色几乎都是找来的(品牌色、产品外壳和界面、实拍里的光),所以三个方向先从产品里找颜色,`om swatch`把色板和对比度摆出来看。
|
|
154
|
+
|
|
155
|
+
### 声音是片子的一半
|
|
156
|
+
|
|
157
|
+
- 作曲家模式:agent写谱,程序用真乐器采样演奏,谱里的场景标记对齐画面;仓库里带了三份有注释的示范谱。
|
|
158
|
+
- 兜底配乐:不想作曲,内置12类产品、每类3种配乐方向,按片子的种子挑,不喜欢可以重抽。
|
|
159
|
+
- 23种音效:落地、甩镜、打字、盖章、故障……写在动画落地的那一行代码上,导出时自动对上。
|
|
160
|
+
- 口播:系统音色念稿,或者用你自己的录音;逐字对齐,画面可以落在某个词上。
|
|
161
|
+
|
|
162
|
+
### 自己的渲染引擎
|
|
163
|
+
|
|
164
|
+
渲染、截帧、检查都直接驱动你电脑上的Chrome:按CPU核数开几个浏览器同时渲染(默认最多8个),配乐和画面并行编码,配乐没改就直接复用。一支30秒的片子,在我这台14核的Mac上大约12–15秒渲完;加运动模糊大约1到1.5分钟。
|
|
165
|
+
|
|
166
|
+
### 交付前有人挑错
|
|
167
|
+
|
|
168
|
+
- `om check`:渲染前查脚本、缺失的文件、违反规则的动画写法,再抽帧查被裁切、被盖住、对比度不够的字;
|
|
169
|
+
- `om qa`:查成片里一闪而过的单帧、没东西在动的空档、硬切和整片的运动曲线;
|
|
170
|
+
- skill要求agent交付前真的看帧、按正常速度看一遍,能派独立的agent冷审就派。
|
|
171
|
+
|
|
172
|
+
### 常用命令
|
|
173
|
+
|
|
174
|
+
平时都是agent在敲,想自己动手也可以:
|
|
175
|
+
|
|
176
|
+
| 命令 | 做什么 |
|
|
177
|
+
|---|---|
|
|
178
|
+
| `om new` · `om templates` | 新建项目,可以从10个模板起步 |
|
|
179
|
+
| `om studio` | 编辑器:实时预览、场景条、直接改值、在画面上留评论 |
|
|
180
|
+
| `om inbox --wait` · `om look` · `om done` | agent那一侧:接下一条评论、看你点的位置、回报改了什么 |
|
|
181
|
+
| `om sound` · `om voice` · `om samples` | 配乐和音效、口播、真乐器采样包 |
|
|
182
|
+
| `om check` · `om qa` · `om still` | 渲染前检查、成片检查、任意时刻截一帧 |
|
|
183
|
+
| `om render` · `om export html` · `om fork` | 导出、分享页、换画幅 |
|
|
184
|
+
| `om learn` · `om undo` · `om doctor` | 经验、撤回、环境检查 |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 里面有什么
|
|
189
|
+
|
|
190
|
+
| | 数量 |
|
|
191
|
+
|---|---|
|
|
192
|
+
| 运动语言(每种写清楚它在说什么、适合什么、怎么做) | 20种,`skills/huashu-motion/references/library/` |
|
|
193
|
+
| 起步模板(发布会、财经图表、动态文字、白板、Vox拼贴、3Blue1Brown、Kurzgesagt、口播包装……) | 10个,`templates/` |
|
|
194
|
+
| 音效 | 23种 |
|
|
195
|
+
| 兜底配乐方向 | 12类产品 × 3种 |
|
|
196
|
+
| 示范谱 | 3份,`skills/huashu-motion/references/scores/` |
|
|
197
|
+
| 字体(中文500–900字重、衬线、展示字体) | 27款,`fonts/` |
|
|
198
|
+
| 方法文档(导演、节奏、颜色、声音、口播、产品演示、验收……) | `skills/huashu-motion/references/` |
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
huashu-motion/
|
|
202
|
+
├── skills/huashu-motion/ # skill本体:SKILL.md、方法文档、运动语言库、示范谱、经验
|
|
203
|
+
├── cli/ # om命令行:新建、编辑器、收件箱、配乐、口播、检查、渲染、导出
|
|
204
|
+
├── runtime/ # 片子里用的OM.*小工具,和逐帧渲染的引擎
|
|
205
|
+
├── studio/ # 浏览器里的编辑器
|
|
206
|
+
├── templates/ # 10个起步模板
|
|
207
|
+
├── fonts/ # 随附的开源字体
|
|
208
|
+
├── examples/ # 样片(om demo打开的那支)
|
|
209
|
+
└── test/ # 测试
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 诚实边界
|
|
215
|
+
|
|
216
|
+
- 它听不见。agent靠谱面、能量曲线和频谱图检查配乐,最后一耳朵还得是你的。
|
|
217
|
+
- 它不会凭空生成真人和实拍。画面全是代码画的;要真人、实拍,用你自己的素材,它负责合成和包装。
|
|
218
|
+
- 效果跟模型有关。我主要在Claude Code里用Opus 5.5;DeepSeek V4.1 Flash也能做得不错,但不同模型的品味差别是真实存在的。
|
|
219
|
+
- 要能跑命令的环境。预览和导出在本机跑,需要Node、Chrome和FFmpeg。
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 背后的故事
|
|
224
|
+
|
|
225
|
+
2026年10月8号,Anthropic发布了Claude Motion,让Claude用代码把报告、图表、产品讲解做成短动画,可以指着画面改,发布时只在Team和Enterprise上beta。
|
|
226
|
+
|
|
227
|
+
今年4月Claude Design出来的时候,我把它的核心能力逆向成了skill,就是后来的[huashu-design](https://github.com/alchaincyf/huashu-design)。Motion发布以后,我让Claude Code开工,要求就一句:
|
|
228
|
+
|
|
229
|
+
> 我们的skill需要能够完整复刻claude motion的能力,并且要强很多!
|
|
230
|
+
|
|
231
|
+
第一天做出来的东西,我看着都很无聊:编辑器、版本管理、一百多项测试都有了,一个19秒的3D城市样片,运镜很平稳,也就代表着很平庸。让Claude自己把项目审一遍,它的结论是:做出了一个很会证明自己没撒谎的工程,却还没有一个让人想转发的作品。当天推倒重来。
|
|
232
|
+
|
|
233
|
+
后来真正花时间的,是让片子好看:去量真实的发布片,给配乐提「电影级别」的要求,把每一次「不酷」「无聊」「字体难看」都变成规则写回skill。最后它给自己做了一支发布片,就是这篇README最上面那段。
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 致谢
|
|
238
|
+
|
|
239
|
+
- 动画库[GSAP](https://gsap.com)(GSAP Standard License),随附字体均为SIL OFL 1.1开源字体,清单见`fonts/LICENSES.md`。
|
|
240
|
+
- 真乐器采样来自CC0和CC-BY授权的开源采样库,`om samples build`时从原处下载,不随仓库分发;口播用到[Kokoro](https://github.com/thewh1teagle/kokoro-onnx)和[whisper.cpp](https://github.com/ggml-org/whisper.cpp),第一次用时下载模型。详见[THIRD_PARTY.md](THIRD_PARTY.md)。
|
|
241
|
+
- 导演规则里量过、拆过的发布片和动效片,仓库只记测量出来的参数,不含它们的画面。
|
|
242
|
+
- `om demo`打开的样片用的是[huashu-art-motion](https://github.com/alchaincyf/huashu-art-motion)的绘画引擎。
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## 关于作者
|
|
247
|
+
|
|
248
|
+
**花叔 Huashu** — AI Native Coder,独立开发者,代表作:小猫补光灯(AppStore 付费榜 Top1)
|
|
249
|
+
|
|
250
|
+
| | |
|
|
251
|
+
|:---|:---|
|
|
252
|
+
| 🌐 官网 | [bookai.top](https://bookai.top) · [huasheng.ai](https://www.huasheng.ai) |
|
|
253
|
+
| 𝕏 Twitter | [@AlchainHust](https://x.com/AlchainHust) |
|
|
254
|
+
| 📺 B站 | [花叔v](https://space.bilibili.com/14097567) |
|
|
255
|
+
| ▶️ YouTube | [@Alchain](https://www.youtube.com/@Alchain) |
|
|
256
|
+
| 📕 小红书 | [花叔](https://www.xiaohongshu.com/user/profile/5abc6f17e8ac2b109179dfdf) |
|
|
257
|
+
| 💬 公众号 | 微信搜「花叔」 |
|
|
258
|
+
|
|
259
|
+
## 许可证
|
|
260
|
+
|
|
261
|
+
代码和文档:MIT。随便用,随便改,随便造。
|
|
262
|
+
|
|
263
|
+
随附的第三方部分保留各自的许可:GSAP(GSAP Standard License)、字体(SIL OFL 1.1),见[THIRD_PARTY.md](THIRD_PARTY.md)。
|
|
264
|
+
|
|
265
|
+
例外:「豆子花叔」角色(`runtime/clip/lib/toon.js`里的角色绘制,以及它在storytime模板和示范片里的形象)是花叔的卡通形象,只用于本项目的示范,不随MIT授权用于其他用途。
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
<div align="center">
|
|
270
|
+
|
|
271
|
+
**[女娲](https://github.com/alchaincyf/nuwa-skill)** 造Skill。**[huashu-design](https://github.com/alchaincyf/huashu-design)** 做设计。**[艺术动画](https://github.com/alchaincyf/huashu-art-motion)** 让画动起来。**huashu-motion** 让你的agent拍发布片。
|
|
272
|
+
|
|
273
|
+
MIT License © [花叔 Huashu](https://github.com/alchaincyf)
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
<div align="center">
|
|
280
|
+
<sub>作者的其他项目 · also by 花叔</sub>
|
|
281
|
+
|
|
282
|
+
[](https://github.com/alchaincyf/fanbox)
|
|
283
|
+
|
|
284
|
+
</div>
|
package/THIRD_PARTY.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Third-party components
|
|
2
|
+
|
|
3
|
+
huashu-motion's own code and docs are MIT. These bundled pieces keep their own licenses:
|
|
4
|
+
|
|
5
|
+
| Component | Where | License |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| GSAP 3.14.2 | `templates/blank/vendor/`, copied into new projects | GSAP Standard "no charge" License, see `GSAP-LICENSE.html` next to the file |
|
|
8
|
+
| Font library: Noto Sans SC (GB2312 subsets, 500–900), LXGW WenKai, Inter, Playfair Display, Anton and 22 more | `fonts/`, copied into projects by `om new` / `om fonts add` | SIL Open Font License 1.1, per-font copyright in `fonts/LICENSES.md`, full text in `fonts/OFL.txt`; taken from huashu-art-motion |
|
|
9
|
+
| huashu-art-motion engine (showcase film) | `examples/showcase/` | MIT, plus per-font licenses kept in that folder |
|
|
10
|
+
|
|
11
|
+
Not under MIT: the "bean Huashu" (豆子花叔) character drawn in `runtime/clip/lib/toon.js`, and its appearance in the storytime template and demo films, is the author's cartoon likeness. It is included to demonstrate this project only and is not licensed for other uses.
|
|
12
|
+
|
|
13
|
+
Rendering, stills and the preview use the Chrome (or Chromium / Edge) already installed on the machine; nothing is downloaded. `om voice` downloads the Kokoro model files from the kokoro-onnx releases and whisper.cpp models from Hugging Face on first use; they keep their own licenses and are not redistributed here.
|
package/cli/lib/audio.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// The film's sound track: whatever the composition declares as audio, put under the picture with as little
|
|
2
|
+
// processing as possible. One track that starts at 0 is wrapped as it is — no filter touches it, so the
|
|
3
|
+
// film is exactly as loud as the file (a mix filter that averages its inputs would make it quieter).
|
|
4
|
+
// Several tracks are placed with adelay/atrim/volume and summed without normalising.
|
|
5
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
6
|
+
import { OmError } from './project.js';
|
|
7
|
+
|
|
8
|
+
const ff = (args) => spawnSync('ffmpeg', ['-v', 'error', '-y', ...args], { encoding: 'utf8', maxBuffer: 64 << 20 });
|
|
9
|
+
const r3 = (n) => Math.round(n * 1000) / 1000;
|
|
10
|
+
|
|
11
|
+
// Integrated loudness (LUFS) and true peak (dBTP) of the first audio stream; null when there is none.
|
|
12
|
+
export function loudness(file) {
|
|
13
|
+
const r = spawnSync('ffmpeg', ['-nostats', '-hide_banner', '-i', file, '-vn', '-af', 'ebur128=peak=true', '-f', 'null', '-'], { encoding: 'utf8', maxBuffer: 64 << 20 });
|
|
14
|
+
const tail = (r.stderr || '').split('Summary:').pop();
|
|
15
|
+
const I = /\bI:\s+(-?[\d.]+|-inf)\s+LUFS/.exec(tail)?.[1];
|
|
16
|
+
const P = /Peak:\s+(-?[\d.]+|-inf)\s+dBFS/.exec(tail)?.[1];
|
|
17
|
+
if (I == null || I === '-inf') return null;
|
|
18
|
+
return { lufs: Number(I), peak: P == null ? null : Number(P) };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const hasAudio = (file) => spawnSync('ffprobe', ['-v', 'error', '-select_streams', 'a:0', '-show_entries', 'stream=codec_type', '-of', 'csv=p=0', file], { encoding: 'utf8' }).stdout.trim() === 'audio';
|
|
22
|
+
|
|
23
|
+
const amixNormalizes = () => /normalize/.test(spawnSync('ffmpeg', ['-hide_banner', '-h', 'filter=amix'], { encoding: 'utf8' }).stdout || '');
|
|
24
|
+
|
|
25
|
+
// How ffmpeg reads the tracks: the inputs and either the one stream as it is (mode 'direct') or a filter graph that
|
|
26
|
+
// places and sums them (mode 'mix'). `first` is the input index of the first track.
|
|
27
|
+
// tracks: [{ file, start, duration, mediaStart, rate, volume }] (seconds; duration may be Infinity)
|
|
28
|
+
function placeTracks(tracks, duration, first) {
|
|
29
|
+
const plain = (t) => t.start === 0 && !t.mediaStart && (t.rate || 1) === 1 && (t.volume ?? 1) === 1;
|
|
30
|
+
const limit = (t) => (Number.isFinite(t.duration) ? Math.min(t.duration, duration) : duration);
|
|
31
|
+
const inputs = tracks.flatMap((t) => ['-i', t.file]);
|
|
32
|
+
if (tracks.length === 1 && plain(tracks[0])) return { mode: 'direct', inputs, map: ['-map', `${first}:a:0`], length: r3(limit(tracks[0])) };
|
|
33
|
+
const parts = tracks.map((t, i) => {
|
|
34
|
+
const f = [];
|
|
35
|
+
const rate = t.rate || 1;
|
|
36
|
+
f.push(`atrim=start=${r3(t.mediaStart || 0)}${Number.isFinite(t.duration) ? `:end=${r3((t.mediaStart || 0) + t.duration * rate)}` : ''}`, 'asetpts=PTS-STARTPTS');
|
|
37
|
+
if (rate !== 1) f.push(`atempo=${rate}`);
|
|
38
|
+
if ((t.volume ?? 1) !== 1) f.push(`volume=${t.volume}`);
|
|
39
|
+
if (t.start > 0) f.push(`adelay=${Math.round(t.start * 1000)}:all=1`);
|
|
40
|
+
return `[${i + first}:a:0]${f.join(',')}[a${i}]`;
|
|
41
|
+
});
|
|
42
|
+
const n = tracks.length;
|
|
43
|
+
const sum = amixNormalizes() ? `amix=inputs=${n}:duration=longest:dropout_transition=0:normalize=0` : `amix=inputs=${n}:duration=longest:dropout_transition=0,volume=${n}`;
|
|
44
|
+
const graph = `${parts.join(';')};${tracks.map((_, i) => `[a${i}]`).join('')}${sum},alimiter=limit=0.98[aout]`;
|
|
45
|
+
return { mode: 'mix', inputs, map: ['-filter_complex', graph, '-map', '[aout]'], length: r3(duration) };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Writes `out` (video stream copied from `video`) and returns { mode: 'direct' | 'mix' | 'none', tracks }.
|
|
49
|
+
export function muxAudio(video, tracks, out, { duration, bitrate = '256k' } = {}) {
|
|
50
|
+
tracks = tracks.filter((t) => t.file);
|
|
51
|
+
if (!tracks.length) {
|
|
52
|
+
const r = ff(['-i', video, '-map', '0:v', '-c:v', 'copy', '-t', String(duration), out]);
|
|
53
|
+
if (r.status !== 0) throw new OmError(`could not finish the video: ${r.stderr.trim().split('\n').pop()}`);
|
|
54
|
+
return { mode: 'none', tracks: 0 };
|
|
55
|
+
}
|
|
56
|
+
const t = placeTracks(tracks, duration, 1);
|
|
57
|
+
const r = ff(['-i', video, ...t.inputs, '-map', '0:v', ...t.map, '-c:v', 'copy', '-c:a', 'aac', '-b:a', bitrate, '-ar', '48000', '-t', String(t.length), out]);
|
|
58
|
+
if (r.status !== 0) throw new OmError(`could not put the sound under the picture: ${r.stderr.trim().split('\n').pop()}`);
|
|
59
|
+
return { mode: t.mode, tracks: tracks.length };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// The sound track on its own, encoded while the picture is still rendering (the renderer then only copies streams).
|
|
63
|
+
// codec: ffmpeg audio codec arguments for the target container. Resolves to { mode, tracks } ('none' writes nothing).
|
|
64
|
+
export function encodeAudio(tracks, out, { duration, codec = ['-c:a', 'aac', '-b:a', '256k', '-ar', '48000'] } = {}) {
|
|
65
|
+
tracks = tracks.filter((t) => t.file);
|
|
66
|
+
if (!tracks.length) return Promise.resolve({ mode: 'none', tracks: 0 });
|
|
67
|
+
const t = placeTracks(tracks, duration, 0);
|
|
68
|
+
return new Promise((ok, fail) => {
|
|
69
|
+
const child = spawn('ffmpeg', ['-v', 'error', '-y', ...t.inputs, ...t.map, '-vn', ...codec, '-t', String(t.length), out], { stdio: ['ignore', 'ignore', 'pipe'] });
|
|
70
|
+
let err = '';
|
|
71
|
+
child.stderr.on('data', (b) => { err += b; });
|
|
72
|
+
child.on('error', (e) => fail(new OmError(`could not start ffmpeg: ${e.message}`)));
|
|
73
|
+
child.on('close', (code) => (code === 0 ? ok({ mode: t.mode, tracks: tracks.length }) : fail(new OmError(`could not encode the sound: ${err.trim().split('\n').pop()}`))));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// After the mux: a single wrapped file must come out as loud as it went in (AAC moves it by hundredths of a dB).
|
|
78
|
+
export function checkLoudness(out, sources, { tolerance = 0.5 } = {}) {
|
|
79
|
+
const got = loudness(out);
|
|
80
|
+
const want = sources.length === 1 ? loudness(sources[0]) : null;
|
|
81
|
+
const res = { lufs: got?.lufs ?? null, peak: got?.peak ?? null, source: want?.lufs ?? null };
|
|
82
|
+
if (got && want && Math.abs(got.lufs - want.lufs) > tolerance) {
|
|
83
|
+
throw new OmError(`the film's sound is ${got.lufs.toFixed(1)} LUFS but its source is ${want.lufs.toFixed(1)} LUFS (more than ${tolerance} LU apart)`);
|
|
84
|
+
}
|
|
85
|
+
return res;
|
|
86
|
+
}
|