Communitygithub.com

comic-to-video

在完全不改变漫画原画的基础上,将单页多格或连环漫画自动制作成高清动态漫视频(MP4),并自动匹配多角色中文神经配音、分格运镜、轻量非破坏性特效、拟声音效与氛围配乐。适用于漫画作品动态化展示、获奖漫画视频化、大屏轮播与短视频发布。

comic-to-video 是什么?

comic-to-video is a Gemini CLI agent skill that 在完全不改变漫画原画的基础上,将单页多格或连环漫画自动制作成高清动态漫视频(MP4),并自动匹配多角色中文神经配音、分格运镜、轻量非破坏性特效、拟声音效与氛围配乐。适用于漫画作品动态化展示、获奖漫画视频化、大屏轮播与短视频发布。.

兼容平台~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/didi4007/comic-to-video/tree/HEAD

在你喜欢的 AI 中提问

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

文档

Comic-to-Video Skill (comic-to-video)

When a user provides a comic directory or a set of comic images and requests to create a video with dubbing and lightweight effects without altering the original artwork in any way, follow the 4 steps below.

Core Red Lines (Never Violate)

  1. Strictly forbid redrawing or modifying the original artwork: Never call AI image generation or image-to-video models to alter the comic frames. All visuals must be 100% derived from the original high-definition image pixels.
  2. Strictly forbid cropping speech bubbles and text: When defining panel crop coordinates (crop: [x, y, w, h]), you must fully encompass speech bubbles, onomatopoeia burst boxes, and cross-panel narration boxes that extend beyond the frame borders. Non-16:9 panels automatically use a Gaussian-blurred darkened background from the same image with the original aspect ratio centered intact, without any stretching or distortion.
  3. Audio-driven pacing, natural rhythm: Generate dubbing first, then measure the speech duration to determine shot length, avoiding scenarios where "the shot changes before the speech finishes" or long, awkward silences.

Step 1: Read the Comic and Precisely Measure Panel Splits

  1. List all comic images in the target directory (sorted by filename naturally), and batch-call read_file to fully read each page's visuals, characters, emotions, and all text (narration, dialogue, onomatopoeia).
  2. For precise panel crop coordinates, use a short Python script or estimate each panel's normalized coordinates [x, y, w, h] (ranging from 0.0 to 1.0), following the principle: leave an extra 1-2% margin, never cut into the edges of bubbles.
    • If a page has multiple tightly packed small panels expressing a continuous action (e.g., a three-frame close-up sequence), split them into consecutive independent shots, using cut for a cinematic editing feel.
    • If a cross-panel narration connects two images, present it as a combined frame containing the narration's panel, or start with single panels and end with a combined frame.

Step 2: Write the Storyboard, Dubbing, and Effects Plan (storyboard.json)

In the target project directory, create <work_name>_storyboard.json, fully planning each shot with:

  • Panel Crop: image, crop: [x, y, w, h]
  • Multi-role Dubbing (lines): Eight built-in Chinese neural voice presets (role), or directly specify voice / rate / pitch:
    • narrator (steady narration, zh-CN-YunyangNeural)
    • youth / youth_excited (young male voice, zh-CN-YunxiNeural)
    • uncle / uncle_cheer (deep/cheerful middle-aged male, zh-CN-YunjianNeural)
    • female / female_lively (natural/lively female voice, zh-CN-XiaoxiaoNeural / XiaoyiNeural)
    • elder (aged, seasoned voice)
  • Camera Motion (motion): zoom_in, zoom_out, impact_zoom, pan_left, pan_right, tilt_up, tilt_down, static
  • Non-destructive Lightweight Effects (effects): Freely combinable:
    • vignette (cinematic darkening, focus)
    • candle_flicker (warm, subtle flickering of oil lamp/candlelight)
    • rain (fine slanted rain streaks)
    • steam (rising steam from hot air/alcohol)
    • sparks (firecracker/celebratory Mars particle effect)
    • sunbeams (slanted morning light rays/sunbeams)
    • film_grain (retro film micro-grain)
    • shake (brief camera shake, suitable for explosions/impact)
  • Transitions (transition_in / transition_out): fade (black fade), fadeblack (black scene change, suitable for entering/awakening from dreams), fadewhite (white flash, suitable for time travel), cut (sharp hard cut)
  • Sound Effects (sfx): rain_ambience, sizzle, bottle_open, water_drop, firecracker, chime_dream, whoosh

Example JSON structure:

{
  "title": "A Sip Across a Century",
  "fps": 30,
  "bgm_mood": "nostalgic",
  "title_card": { "title": "A Sip Across a Century", "subtitle": "That one taste of life spanning a hundred years", "duration": 2.4 },
  "end_card": { "title": "A Sip Across a Century", "subtitle": "To the past, and even more to the beautiful struggle of our generation", "duration": 2.8 },
  "shots": [
    {
      "id": "p01_1",
      "image": "01.png",
      "crop": [0.02, 0.01, 0.48, 0.46],
      "motion": "zoom_in",
      "effects": ["vignette", "film_grain"],
      "sfx": [],
      "transition_in": "fadeblack",
      "transition_out": "fade",
      "lines": [
        { "role": "narrator", "text": "In July of the sixth year of the Republic, the flags in Beijing changed faster than the sky." }
      ]
    }
  ]
}

Step 3: One-Click Render High-Definition Video and Preview Grid

Use uv to run the built-in rendering script (automatically manages edge-tts, pillow, numpy, zero system pollution; automatically degrades to macOS say when offline):

uv run --with edge-tts --with pillow --with numpy python3 \
  "$HOME/.gemini/config/skills/comic-to-video/scripts/build_comic_video.py" \
  --storyboard "<work_directory>/<work_name>_storyboard.json" \
  --output "<work_directory>/<work_name>_dynamic_comic.mp4" \
  --aspect 16:9 \
  --save-preview-frames
  • For vertical screen (Douyin/WeChat Video), change --aspect 16:9 to --aspect 9:16.
  • If the user provides external background music, append --bgm "/path/to/music.mp3"; otherwise, automatically generate a gentle pentatonic-scale ambient score with automatic voice ducking enabled.

Step 4: Visual Inspection and Delivery

  1. Use read_file to open the auto-generated <work_name>_dynamic_comic_preview_grid.jpg collage, and check each panel:
    • Are all original comic artworks 100% intact without distortion?
    • Are all speech bubbles, narration boxes, and onomatopoeia fully visible without being cropped?
    • Are the ambient effects natural, restrained, and not covering any text?
  2. Use ffprobe to verify the output MP4's resolution, frame rate, audio/video streams, and total duration.
  3. Deliver the final MP4, storyboard.json (for the user to fine-tune dialogue, change voice lines, or adjust effects for re-rendering), and a concise summary of dubbing and effects.

相关技能