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)
- 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.
- 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. - 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
- List all comic images in the target directory (sorted by filename naturally), and batch-call
read_fileto fully read each page's visuals, characters, emotions, and all text (narration, dialogue, onomatopoeia). - For precise panel crop coordinates, use a short Python script or estimate each panel's normalized coordinates
[x, y, w, h](ranging from0.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
cutfor 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.
- 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
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 specifyvoice/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:9to--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
- Use
read_fileto open the auto-generated<work_name>_dynamic_comic_preview_grid.jpgcollage, 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?
- Use
ffprobeto verify the output MP4's resolution, frame rate, audio/video streams, and total duration. - 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.