Communitygithub.com

sticker-collage-video

把中文文稿做成横版动画短片(1920×1080 / 30fps),两种画风:贴纸拼贴、卡通绘本。默认走 HTML + window.draw(t) 逐帧确定性渲染(无头浏览器截图 + ffmpeg),也可回退 Remotion。产线覆盖:两个方向提案 + 关键帧 → 分镜表 → 配音对时 → 美术资产 → 页面实现 → 九帧评审(六项各 ≥8 分)→ 15 秒样片 → 全片。适用于科普/历史人物/口播稿转动画、需要中文逐句对时、需要 3:4 与 4:3 封面。

sticker-collage-video 是什么?

sticker-collage-video is a Claude Code agent skill that 把中文文稿做成横版动画短片(1920×1080 / 30fps),两种画风:贴纸拼贴、卡通绘本。默认走 HTML + window.draw(t) 逐帧确定性渲染(无头浏览器截图 + ffmpeg),也可回退 Remotion。产线覆盖:两个方向提案 + 关键帧 → 分镜表 → 配音对时 → 美术资产 → 页面实现 → 九帧评审(六项各 ≥8 分)→ 15 秒样片 → 全片。适用于科普/历史人物/口播稿转动画、需要中文逐句对时、需要 3:4 与 4:3 封面。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/gugugaga188/sticker-collage-video/tree/HEAD

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Sticker / Picture Book Educational Shorts

A complete pipeline: Direction Proposal → Storyboard → Voice-over Timing → Art Assets → Page Implementation → Nine-Frame Review → Sample → Full Video → Cover.

Choose one of two styles, don't mix:

StyleWhat It Looks LikeReference
Sticker CollageElements pasted on paper, white borders + hard drop shadows, cut-out feel, snappy, fast-pacedreferences/sticker-system.md
Cartoon Picture BookElements have depth on the page, hand-drawn strokes, generous negative space, slightly slower pacereferences/picture-book.md

One-sentence rule: If the script is sarcastic/infographic → sticker; if the script is narrative/emotional → picture book.

Default Parameters (pre-determined, don't ask again)

ItemValue
Aspect Ratio / Frame Rate1920×1080 / 30fps
Duration~3 minutes (180s ±30s, adjust based on script length)
Voice-overLocal GPT-SoVITS · Paimon (--engine gptsovits --gsv-voice Paimon), backup Breeze Palace Chatterbox
BGM"Fluffing a Duck", gain 0.30, CC BY 4.0, must credit Kevin MacLeod in final video description; if duration ≥ 4 minutes, remind user to change the track during voice-over phase (see motion-infographic-video/references/bgm.md)
Audio Track StructureVoice-over placed sentence-by-sentence + one continuous BGM track (mixing script is already sealed, don't manually stitch)
SubtitlesBottom center (W/2, baseline H−96), single line max 34 characters, wrap to center if exceeded. Don't left-align—assets/html-template/index.html's subtitle() is already correct, don't write your own version
Subtitle Safety Zoney ∈ [H−152, H−40] is the protected zone: main visuals, stickers, flagpoles, door panels, cards—none may intrude
RenderingHTML draw(t) frame-by-frame → PNG → ffmpeg; Remotion is not the default

Workflow

Phase 0 · Two Directions (cannot skip)

After the user provides the topic and "the one sentence to remember," first submit two directions that differ structurally:

Each direction includes five items: one-sentence style description / tech stack / color palette and fonts / shot-by-shot storyboard (seven columns) / one actually rendered keyframe. The seven columns are: Shot · Start-End Seconds · Visual · On-screen Text · Action & Camera Movement · Sound Effect · Transition.

See references/direction-proposal.md for details. Only proceed to the next phase after the user selects a direction.

Phase 1 · Storyboard

Write storyboard/storyboard.md using the composition language of the chosen direction. One sentence per shot, each shot labeled with a 2–4 character keyword (unique across the entire video).

Produce two deliverables simultaneously: a list of characters that need to appear (a shopping list), and the transition type for each shot.

Phase 2 · Voice-over Timing

python ~/.workbuddy/skills/motion-infographic-video/scripts/generate_tts.py \
    --input lines.json --out public/voice --engine gptsovits --gsv-voice Paimon

Default is local GPT-SoVITS with the Paimon voice (v4 architecture, 48kHz, Genshin Impact Chinese voiceover). lines.json has one sentence per shot, key is the shot number. Output is timing.json (duration / frames for each sentence). Frame count = voice-over frames + 4 breathing frames, calculated automatically by mk_timeline.mjs, do not add manually.

Adjust performance:

# More lively (higher pitch, faster speed, suitable for sarcastic sections)
--gsv-temperature 1.2 --gsv-speed 1.1

# More stable (calm tone, suitable for serious explanations)
--gsv-temperature 0.9

Change character: edit D:\GPT-SoVITS\voice-over-characters.json (just add one entry, no need to modify code).

Backup (when GPT-SoVITS is unavailable): --engine breeze --breeze-voice Palace Chatterbox.

Phase 3 · Art Assets (use image generation models first, don't hand-draw to cut corners)

bash scripts/matte_batch.sh <clientTempToken> art_src art_cut
python scripts/normalize_assets.py --src art_cut --dst public/art/cut --manifest src/artManifest.json

Characters, animals, props, clothing, objects, architectural stickers must go through image generation models → output with white background → matting → normalize. Use ImageGen or any available text-to-image model (use the user's choice if specified); lock one model + one prompt template for the entire video to keep style consistent across shots. Only pure geometric UI (form boxes, stamps, coordinate lines, popups, progress bars, map administrative boundaries) can be drawn with code. art_cut/ is the only source directory.

Don't cheat with "code-drawn chibi characters" — the face is the identity of sticker style; hand-drawn faces look fake and cost more to redo than generating them.

Phase 4 · Write the Page

cp -r ~/.workbuddy/skills/sticker-collage-video/assets/html-template ./<project>

Only modify SCENES in index.html, one key per shot. Four iron rules:

  1. Visuals are calculated only from t: don't read Date, don't use rAF/timers, random numbers must be fixed with mulberry32(seed)
  2. Timestamps are relative seconds: seg(T, 0.4, 1.0), never absolute frame numbers
  3. Main visual pop(seg(T, 0, 0.55)): ensure there's something on screen at the first frame of each cut
  4. Bake paper texture/noise once: only drawImage per frame, otherwise it drops below 8fps

See references/deterministic-html.md for contracts and pitfalls.

Phase 5 · Nine-Frame Review (Gate 1)

S=~/.workbuddy/skills/sticker-collage-video/scripts/html
node $S/render.mjs --html index.html --out frames --dur <duration>
node $S/sheet.mjs --timeline timeline.json --auto --out out/sheet.png
# Machine scan for overlaps first, then human inspection of the nine-frame grid
python ~/.workbuddy/skills/sticker-collage-video/scripts/check_overlap.py \
    --timeline timeline.json --frames frames

Score six categories from references/review-rubric.md (layout / motion / shot transitions / readability / consistency / completeness), any category < 8 → reject and redo, max 3 rounds, write scores in out/review.md. Don't "eyeball it and move on"—this step is the entire quality check.

The key focus of the nine-frame grid is occlusion detection, not composition praise. Nine frames cover only 9 shots; an 81-shot video has large blind spots. So the order is: first run check_overlap.py to get a list of suspicious shots → then open the nine-frame grid and ask four questions per frame:

  1. Does any sticker/prop/card overlap the subtitle? (even one character counts)
  2. Does the main visual overlap the upper-left keyword or title?
  3. Are two groups of text (keyword vs subtitle vs text in a card) closer than 24px in the same frame?
  4. Is any text on a noisy background (dot matrix, stripes, sticker outlines, behind gradient blocks)?

If any of the four triggers, note the shot number and what's causing the occlusion, fix, and re-render that shot. See references/review-rubric.md's "Occlusion Check" section. Don't assume you can think of it during writing—occlusion is almost always caused by coordinate placement and can only be caught at this stage.

Phase 6 · 15-Second Sample (Gate 2)

Select the most information-dense, most complex-transition continuous 15 seconds (not the beginning), render it, and show the user. Only render the full video if the user approves.

node $S/mix_audio.mjs --timeline timeline.json --bgm public/music/bgm.mp3 --out out/mix.m4a
node $S/encode.mjs --frames frames --fps 30 --out out/<video-name>.mp4 --audio out/mix.m4a --loudnorm --clean

--clean = after final video passes validation (ffprobe duration > 0.5s), automatically delete the frame sequence. Must include, otherwise a single full video leaves 5–7GB of PNGs on disk (tested 2026-11-21: 2400 frames = 6.06GB, eating 20GB of C drive). Derived directories (like tmpmove / tmpstamp / frames_v1 saved during re-renders) should be cleaned with --clean-extra tmpmove,tmpstamp. If you want to keep frames for re-rendering, don't use this parameter, but clean up manually before delivery.

Phase 7 · Full Video + Cover

python scripts/make_covers.py --art public/art/cut --out out/cover

3:4 (1080×1440) + 4:3 (1440×1080). For picture book style covers, use the same draw() rendered to a 1080×1440 canvas, don't draw separately.


Hard Constraints (violating any means rework)

  • One sentence per shot. If a sentence contains two pieces of information, split it into two shots.
  • One composition per shot. Two compositions overlaid confuse the viewer about where to look.
  • No color mixing. An accent color appears only once per shot, given only to "the current action."
  • No fade-outs. To exit, move off-screen or turn the page; transparency fades turn gray.
  • No hardcoded frame numbers. All times relative seconds.
  • Random numbers must be seeded. Otherwise lines flicker frame by frame.
  • Final video must pass deterministic validation (render.mjs exit code 0). Non-deterministic = frames can't form the video.
  • Only one BGM track. Stitching segments creates seams.
  • Subtitles are always bottom-center, not left-aligned, not center-floating, not jumping up and down.
  • No visual elements in the subtitle safety zone (y ∈ [H−152, H−40]). Sticker feet, flagpoles, door panels, cards all count; when writing a scene, mentally draw a bottom line, and the main subject's bottom should not exceed H−160.
  • Leave at least 24px between text elements. Keywords, subtitles, card labels, stamps should not overlap; if they overlap, it's not "tight layout," it's unreadable.
  • After each round of fixes, render the entire video, not just a single frame.
  • Delete frames after final video is saved (encode.mjs --clean). Frame sequences are intermediate artifacts; one video is 5–7GB, keeping them will fill the C drive; final video and review images in out/ should not be deleted.

What to Say During Delivery

  1. Final video path, duration, frame count, loudness (mean ≈ -17dB / max ≈ -1.5dB)
  2. storyboard/storyboard.md
  3. Nine-frame contact sheet + final scores from out/review.md (six categories)
  4. Two cover images
  5. Proactively list two things you're not satisfied with—better than waiting for the user to find them

Resource Index

  • references/direction-proposal.md — Format and pitfalls for two-direction proposals
  • references/review-rubric.md — Six-category scoring criteria + occlusion check + gate process
  • scripts/check_overlap.py — Occlusion check (measures edge energy in the subtitle band, catches "image over text / text on noisy background")
  • references/picture-book.md — Cartoon picture book visual system (color palette / strokes / six composition types / six transition types)
  • references/sticker-system.md — Sticker collage visual system
  • references/deterministic-html.md — draw(t) contract, script usage, measured performance, 12 pitfalls
  • references/art-pipeline.md — ImageGen prompts, matting, normalization
  • references/pitfalls.md — 19 pitfalls (symptom → cause → fix)
  • assets/html-template/ — HTML + Canvas 2D starter (includes paper texture cache, easing, subtitles, scene dispatch)
  • assets/template/ — Remotion skeleton (legacy route, use when embedding video footage)
  • scripts/html/render.mjs — Frame-by-frame rendering + deterministic validation + --times for keyframes
  • scripts/html/mk_timeline.mjs — timing.json → timeline.json / timeline.js
  • scripts/html/mix_audio.mjs — Sentence-by-sentence voice-over placement + BGM + −14 LUFS
  • scripts/html/encode.mjs — PNG sequence → mp4
  • scripts/html/sheet.mjs — Nine-frame contact sheet (--auto evenly distributes across shots)
  • scripts/ — Sticker asset legacy scripts (matte_batch / normalize_assets / make_covers / contact_sheet / flicker_check)

相关技能