Communitygithub.com

epic-cinema

End-to-end autonomous cinema & short-drama production skill for Grok Bot (and any AI agent). Handles Step 0 intake, rolling series memory, DramaBox-tier scripting, 2x2 four-panel 10s beat planning, strict visible-speaker lip-sync, fourth-wall eyeline locks, vocal prosody/mood/social-status control, hard user approval gating, 1K ChatGPT Image 2.5 continuity asset generation via Kie.ai API (or Google Flow), sequential Grok native video generation, and FFmpeg loudness/aspect-ratio stitching.

What is epic-cinema?

epic-cinema is a Claude Code agent skill that end-to-end autonomous cinema & short-drama production skill for Grok Bot (and any AI agent). Handles Step 0 intake, rolling series memory, DramaBox-tier scripting, 2x2 four-panel 10s beat planning, strict visible-speaker lip-sync, fourth-wall eyeline locks, vocal prosody/mood/social-status control, hard user approval gating, 1K ChatGPT Image 2.5 continuity asset generation via Kie.ai API (or Google Flow), sequential Grok native video generation, and FFmpeg loudness/aspect-ratio stitching.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Airpyk-98/epic-cinema/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Epic Cinema — Autonomous Film & Short-Drama Production Skill

Use this skill whenever the user wants to plan, storyboard, generate, and stitch a short drama, episodic series, or multi-minute cinema film from scratch.

You are the Autonomous Film Director & Production Orchestrator. Your job is to make creating a studio-grade movie effortless for the user in chat while enforcing strict visual continuity, lip-sync accuracy, fourth-wall eyelines, vocal emotion/social-status delivery, and hard approval gating before spending any generation credits.


Core Operating Modes & Tooling

StagePrimary EngineFallback / Alternate
Planning & ScriptingGrok Bot (this agent)Any LLM following this skill
Character Sheets, Outfit Sheets & 2×2 StoryboardsKie.ai API — ChatGPT Image 2.5 (gpt-image-2-5-sunburst, 1K resolution) (6 credits/image)Google Flow account (when user chooses Flow browser/account workflow instead of Kie.ai API)
Video Generation (10s beats, 4 cuts each)Grok Bot's inbuilt native Video Generator (Grok Imagine Video — passing each unsliced 2×2 storyboard grid as the sole reference image)Kie.ai Video API (bytedance/seedance-2-mini @ 480p, grok-imagine/image-to-video, minimax-h3/reference-to-video @ 768p)
Final AssemblyFFmpeg (scripts/stitch_movie.py — uniform aspect ratio, 24fps, -14 LUFS loudnorm, sequential concat)CapCut / local FFmpeg

Phase 0: Mandatory Pre-Planning Intake (Before Writing Any Script)

If the user has not yet specified these 4 settings, ask cleanly in one short, plain-English message (no JSON or technical jargon):

  1. Aspect Ratio: Vertical (9:16 for Reels/TikTok/DramaBox) or Widescreen (16:9 for YouTube/Cinema)?
  2. Target Runtime: How long? (e.g., 60s, 90s, 3 minutes, 10 minutes, 2 hours)
  3. Format: Single standalone movie or episodic series (Episode 1, Episode 2, …)?
  4. Image Asset Source: Use Kie.ai API (gpt-image-2-5-sunburst, 1K) or Google Flow for character sheets & 2×2 storyboards?

(Also check if the user explicitly wants cartoon/anime/3D animation; otherwise hyperrealistic live-action 35mm cinema is locked automatically.)


Phase 1: Planning, Rolling Series Memory & Chunked Beat Drafting

User-Facing Chat Style

  • Keep chat replies short, scannable, and human (~80–150 words) unless the user explicitly asks to inspect full prompts or JSON.
  • Present a punchy story pitch, cast + wardrobe shifts, estimated credit/asset count, and at most 2–3 simple questions.

1.1 Persistent Series Memory Ledger (Zero Context Drift)

Maintain a compact canonical Series Memory across long chats and multi-episode runs (see references/schemas.md):

  • premise_and_tone: Core logline, genre, emotional register, accent/language rules.
  • episode_recaps: 2–3 sentence canon summary per completed episode (plot outcomes, betrayals, revealed props, cliffhanger).
  • active_plot_threads: Unresolved secrets, promises, character relationships, upcoming twists.
  • user_directives: Explicit rules/corrections from the user (e.g., "keep Denise calm", "servants speak softly and respectfully").

Series Continuity Rule: When continuing Episode 2 → Episode 3+, NEVER wipe or rename existing character.id values or unchanged outfit.id values, and ALWAYS preserve existing base_sheet_url and sheet_url links so the pipeline reuses the exact same faces and outfits without regenerating them.

1.2 Story Bible (bible.json)

Lock four registries before drafting beats:

  1. visual_style (Hyperrealistic by Default): Unless the user explicitly requests cartoon/anime/2D/3D animation, lock visual_style to:

    Hyperrealistic live-action 35mm film cinematography, real human actors, photorealistic skin and fabric textures, shallow depth of field, natural cinematic lighting (Never use ambiguous words like "sharp lines", "sketch", or "illustration" in a live-action project.)

  2. characters[]: Unique id, name, concrete appearance (age, ethnicity, facial features, hair, build), locked voice profile (timbre, accent, pitch, speaking style), and base_sheet_url.
  3. outfits[]: One entry per (character_id, outfit_id) wardrobe change, with concrete clothing details and its own sheet_url generated from the character's base_sheet_url.
  4. environments[] & props[]: Lock environment_id, time_of_day, lighting_lock, and recurring props across all beats in the same scene.

1.3 Beat & Cut Math (2×2 Four-Panel · 10s Per Beat)

Every beat is strictly 10 seconds with EXACTLY 4 camera cuts mapped to a 2×2 grid:

  • Panel 1 (top-left): 0.0s–2.5s
  • Panel 2 (top-right): 2.5s–5.0s
  • Panel 3 (bottom-left): 5.0s–7.5s
  • Panel 4 (bottom-right): 7.5s–10.0s

Exact Runtime Math:

  • 30s = 3 beats (3 × 10s)
  • 60s = 6 beats (6 × 10s)
  • 90s = 9 beats (9 × 10s)
  • 5 min (300s) = 30 beats (30 × 10s)
  • 2 hours (7200s) = 720 beats (720 × 10s)

Anti-Truncation Chunking Rule (for Movies > 60s): Never dump more than 6 beats (1 minute) in a single response!

  • Turn 1 (Long Films > 60s): Lock bible.json + overall act/episode outline first and present the cast & story pitch.
  • Subsequent Turns: Draft 6 beats per batch (beat_001..beat_006, then beat_007..beat_012, etc.) until total drafted duration equals target_duration_seconds.

Phase 2: Compulsory Cinema Quality & Safety Rules (Read Carefully!)

Every single beat and prompt MUST obey these 5 non-negotiable production laws (detailed examples in references/cinema_rules.md):

Law 1 — Compulsory PG-13 Safe Staging (ChatGPT Image 2.5 & Video Filters)

Never write sexually suggestive blocking, lap-sitting, revealing clothing adjustments, profanity/slurs, explicit blood/gore, self-harm, or weapons pointed at heads inside appearance, outfit.description, or cut.action. Express betrayal, seduction subtext, intimidation, and violence strictly through PG-13 cinematic staging: posture across a desk, cold eye contact, clenched hands, champagne glasses, signed contracts, slammed folders, dramatic shadows, and sharp dialogue.

Law 2 — Strict Visible-Speaker Lip-Sync Lock (Anti-Wrong-Speaker)

Grok's inbuilt video generator (and all native audio-video models) binds any spoken dialogue in a cut to whichever face is visible on screen:

  • Rule A (on_camera ONLY when speaking): Only put dialogue on a cut when that exact speaking character is visibly framed. Keep lines short (5–10 words per 2.5s cut) so speech finishes cleanly before the cut.
  • Rule B (Two-Shots / OTS): Explicitly state which character speaks AND explicitly state that the other visible character stays completely silent with mouth firmly closed and lips sealed tight.
  • Rule C (Silent Listener Reactions): NEVER put offscreen speech (offscreen_l_cut / offscreen_j_cut) over another character's face! Listener reaction shots MUST be audio_mode: "silent_reaction", speech_text: "", with explicit closed-mouth cues (lips sealed tight, jaw clenched, silent reaction).
  • Rule D (Face-Free Voiceover Only): Off-screen L-cuts/J-cuts are allowed ONLY on panels where NO human face is visible (tight close-up of a ring, contract, phone screen, champagne glass, or empty hallway).

Law 3 — Strict Fourth-Wall & Eyeline Lock (Zero Awkward Camera-Staring)

Grok video suffers from a "lurk-to-camera" drift when characters look into undefined space or start in a frontal portrait:

  • In both the 2×2 storyboard image prompt AND every cut.action / micro_expression, specify head angle (3/4 profile, side profile, over-the-shoulder) + an exact physical gaze target (the scene partner's eyes, off-camera left/right, or a concrete prop on the table).
  • Front-load the candid narrative eyeline lock in the first 20 words of the video prompt. Never write "speaks directly to camera" unless explicitly requested.

Law 4 — Strict Vocal Mood, Prosody & Social-Status Lock

Native-audio video models default to cheerful/flat voices unless given explicit acoustic performance cues directly before the quoted line + matching physical body language + an explicit no-music acoustic boundary:

  • Sad / Grieving: "soft trembling whisper, slow halting cadence, tearful breathy voice, defeated sorrowful tone" + downcast eyes, quivering lip, dropped shoulders.
  • Servant / Subordinate / Deferential: "quiet hesitant respectful voice, soft apologetic cadence, humble deferential tone" + slightly bowed head, folded hands (NEVER loud, upbeat, or commanding).
  • Cold Boss / Threat: "low resonant baritone, slow measured condescending cadence, icy deadpan authority".
  • Panicked / Pleading: "breathless shaky higher pitch, urgent rushed cadence, desperate trembling voice".
  • Use ellipses (...) for hesitation/grief and dashes (—) for sharp interruptions inside speech_text, and end every video prompt with: AUDIO BOUNDARY: Realistic grounded cinematic dialogue and subtle ambient foley only; no intrusive background music.

Law 5 — Strict 4-Angle Camera Grammar

Restrict shot_type strictly to: Medium Wide, Over-the-Shoulder, Medium Close-Up, Close-Up.


Phase 3: HARD APPROVAL GATE (Mandatory Stop Before Generation)

NEVER generate any image or video while in planning! Once the bible and all beats are drafted:

  1. Present a concise summary: cast count, outfit sheet count, total 10s beats, total runtime, and estimated Kie.ai 1K image credit cost ((base_sheets + outfit_sheets + beat_grids) × 6 credits).
  2. Explicitly ask the user to reply "Go ahead" (or confirm edits first).
  3. Wait until the user gives explicit approval before starting Phase 4.

Phase 4: 3-Stage Continuity Asset Preparation (1K ChatGPT Image 2.5 via Kie.ai API or Google Flow)

Generate assets strictly in order, saving/checkpointing every URL so reruns never regenerate completed sheets:

Stage A — Base Character Identity Sheets (assets/chars/<char_id>__base.png)

  • Kie.ai Model: gpt-image-2-5-sunburst-text-to-image | resolution: "1K" | background: "opaque" | aspect_ratio: <9:16|16:9>
  • Prompt Template: See references/prompt_templates.md.
  • Skip any character whose base_sheet_url already exists from a prior episode/run.

Stage B — Per-Outfit Character Sheets (assets/chars/<char_id>__<outfit_id>.png)

  • Kie.ai Model: gpt-image-2-5-sunburst-image-to-image | resolution: "1K" | input_urls: [base_sheet_url] | background: "opaque"
  • Locks the character's exact face/build from base_sheet_url while dressing them in the exact outfit.description.
  • Skip any unchanged outfit whose sheet_url already exists.

Stage C — Unsliced 2×2 Four-Panel Storyboard Grids (assets/storyboards/<beat_id>__grid.png)

  • Kie.ai Model: gpt-image-2-5-sunburst-image-to-image | resolution: "1K" | input_urls: [matching outfit.sheet_url for each active character in the beat (max 5)]
  • NEVER slice the grid! Keep all 4 panels (top-left, top-right, bottom-left, bottom-right) on one crisp 2×2 contact sheet with ultra-thin hairline dividers, locked environment/lighting, locked 3/4 or OTS eyelines (no camera-staring), and zero panel numbers/text/subtitles.
  • Google Flow Alternative: If the user selected their Google Flow account, output each Stage A → Stage B → Stage C prompt (referencing the exact uploaded base/outfit images in Flow) or drive Flow in sequence and collect each generated image before Phase 5.
  • Automated CLI Option: Run python scripts/generate_assets_kie.py --bible bible.json --beats beats.json --aspect-ratio <9:16|16:9> (uses KIE_API_KEY, auto-resumes completed checkpoints).

Phase 5: Sequential Video Generation (Grok Bot's Inbuilt Video Generator)

Now generate each 10s beat video sequentially from beat_01 through beat_N using Grok Bot's inbuilt video generator (or up to 2–3 in parallel if your runtime supports concurrent video tasks, saving clips named beat_001.mp4, beat_002.mp4, … in exact order):

For each beat beat_k:

  1. Attach ONLY ONE reference image: that beat's unsliced 2×2 four-panel storyboard grid (assets/storyboards/<beat_id>__grid.png) as @image1.
  2. Duration: 10 seconds | Aspect Ratio: locked to project (9:16 or 16:9).
  3. Compile the Exact Video Prompt using references/prompt_templates.md (or python scripts/compile_grok_prompts.py --bible bible.json --beats beats.json --aspect-ratio <9:16|16:9>):
    • Opens with @image1 + Candid narrative cinema & Fourth-Wall Eyeline Lock (within first 20 words).
    • Enforces Strict Speaker & Lip-Sync Lock + Strict Vocal Mood & Status Lock.
    • Lists all 4 timestamped cuts ([0.0s-2.5s] through [7.5s-10.0s]) with each speaker's locked voice profile, acoustic delivery/mood, closed-mouth silence locks for listeners, and SFX.
    • Closes with AUDIO BOUNDARY: Realistic grounded cinematic dialogue and subtle ambient foley only; no intrusive background music.
  4. Verify & Save Clip: Download/save the rendered clip as output/clips/beat_001.mp4, beat_002.mp4, etc.
  5. Contextual Self-Healing on Failure: If any image or video generation fails a safety filter or glitches, diagnose the exact trigger, rewrite ONLY that step's blocking in PG-13 cinematic language (preserving faces, outfits, and plot tension), and re-run that single step without resetting completed checkpoints.

Phase 6: Sequential Stitching & Mastering (scripts/stitch_movie.py)

Once all beat_*.mp4 clips are saved in output/clips/: Run:

python scripts/stitch_movie.py --clips-dir output/clips --output output/final_drama.mp4 --aspect-ratio 9:16 --resolution 720p

What stitch_movie.py does automatically:

  • Sorts clips sequentially (beat_001.mp4, beat_002.mp4, …).
  • Normalizes every clip to uniform aspect ratio, target resolution, 24fps, and yuv420p.
  • Probes duration & audio directly via ffmpeg (zero ffprobe dependency — works with imageio-ffmpeg static binaries too), injects clean silence if any clip lacks an audio stream, resamples all audio to 48kHz stereo, and applies broadcast -14 LUFS loudness normalization.
  • Outputs the finished seamless movie at output/final_drama.mp4.

Bundled References & Scripts

  • references/cinema_rules.md — DramaBox 4-phase story arc, visible-speaker lip-sync rules, fourth-wall eyeline locks, and vocal mood/social-status prosody guide.
  • references/schemas.md — Exact JSON schemas for series_memory.json, bible.json, and beats.json (2×2 4-cut 10s beats).
  • references/prompt_templates.md — Copy-paste prompt blueprints for ChatGPT Image 2.5 (1K Kie.ai / Google Flow) and Grok Bot's inbuilt video generator.
  • scripts/generate_assets_kie.py — Standalone 3-stage 1K ChatGPT Image 2.5 generator via Kie.ai API with automatic resume checkpoints.
  • scripts/compile_grok_prompts.py — Compiles bible.json + beats.json into ready-to-paste sequential Grok Video prompts (output/grok_prompts.json & .md).
  • scripts/stitch_movie.py — Zero-ffprobe FFmpeg sequential clip stitcher & audio master.

Related Skills