Gemini Storybook Framework
- Gemini Storybook is a modular, multimodal framework that integrates narrative text, images, speech, and music into cohesive storybook videos using a multi-agent DAG architecture.
- It employs specialized agents for tasks like brainstorming, chapter writing, and synchronized media generation to achieve iterative refinement and precise cross-modal alignment.
- The framework allows seamless substitution of core models via structured JSON interfaces and supports rigorous evaluation with both automated metrics and human review.
Gemini Storybook refers to a modular, extensible framework for producing fully multimodal, AI-generated narrated storybooks, building on the MM-StoryAgent system. It delivers end-to-end pipelines that generate immersive storybook videos—synthesizing narrative text, semantically aligned images, speech narration, sound effects, and music—by orchestrating a suite of generative models and tools via a multi-agent paradigm. The architecture formalizes agent interactions as a directed acyclic graph (DAG), enabling compositionality, agent modularity, and seamless substitution of core models (including text, image, and audio backbones) using unified data interfaces (Xu et al., 7 Mar 2025).
1. System Architecture and Multi-Agent Coordination
The core of Gemini Storybook is a network of autonomous agents, each specialized for a stage or modality in story creation. The process begins with a user-provided setting and proceeds through sequential and parallelized modules, formalized as agents A₁ through A₁₄. Key responsibilities include:
- Story-Setting Agent (A₁): Receives initial scenario or theme.
- Attractiveness-Oriented Story Agents:
- QA Dialogue Agent (A₁): Iterative brainstorming via turn-based Q&A with LLMs.
- Outline Writer (A₂): Produces structured outlines from dialogue transcripts.
- Chapter Writer (A₃): Expands outline into sequential narrative chapters.
- Modality-Specific Agents:
- Image Prompt Generator (A₄): Encodes chapter semantics into concise prompts.
- Role Extractor (A₅): Identifies and canonizes main characters.
- Prompt Revisers & Reviewers (A₆↔A₇): Iterative refinement of image prompts.
- Image Generator (A₈): Utilizes StoryDiffusion (Stable Diffusion XL variant) for coherent frame synthesis with self-attention over prior images.
- Speech Agent (A₉): Deploys CosyVoice TTS for narration.
- Sound/Music Agents (A₁₀–A₁₃): Extract, refine, and synthesize SFX via AudioLDM 2/Freesound and background music via MusicGen.
- Video Composition Agent (A₁₄): Integrates all media (via MoviePy) into an aligned video artifact.
Inter-agent communication utilizes typed JSON payloads, formalized as , in a DAG topology. The process is sketched by a LaTeX pipeline:
This system architecture enables both pipeline extensibility and the integration of new model APIs, as all agents operate with structured, swappable I/O schemas.
2. Multi-Stage Writing and Brainstorming Pipeline
Gemini Storybook applies a multi-stage authorial process designed to maximize narrative expressiveness and control:
- Dialogue-Enhanced Brainstorming (A₁):
For turns: - LLM simulating "Amateur Writer" initiates questions based on setting/history. - LLM as "Expert Writer" provides domain-refined answers.
- Outline Generation (A₂):
- Sequential Chapter Writing (A₃):
For : - -
This pipeline supports iterative control and refinement at every writing stage, facilitating authoring of both plot and role continuity.
3. Generative Modules for Multimodal Asset Synthesis
3.1 Image Generation
- Prompt Engineering: A₅ extracts canonical role vectors , A₄ generates visual prompts from chapter text, and a loop of A₆ (reviser) and A₇ (reviewer) iteratively refines prompts within steps.
- StoryDiffusion Backbone: Enforces cross-frame role consistency. For timestep , image is generated as:
3.2 Audio Synthesis
- Narration: CosyVoice TTS processes entire narrative, producing .
- Sound Effects: A₁₀/A₁₁ loop extracts and polishes SFX prompts; AudioLDM 2 or Freesound API synthesizes .
- Music: Single prompt to MusicGen (or retrieval) generates , matched to the story context.
4. Temporal and Multimodal Alignment Strategies
Precise multimedia synchronization is critical for immersive storybook experiences.
- Temporal Assignment: For chapter/page , narrated duration determines image display; SFX is stretched or truncated to ; music is adjusted to fit .
- Fine-Grained Audio-Visual Sync: Embeddings (framestamp), (mel-frames) are temporally aligned via DTW (Dynamic Time Warping):
This allows optional speech warping to match visual transitions.
- Visual Effects: Includes random slow pans/zooms for each , with slide transitions for inter-chapter continuity.
5. Evaluation Metrics and Benchmarking
Gemini Storybook includes rigorous objective and subjective evaluation protocols.
- Automated Metrics:
- Textual Story Quality: Scored using GPT-4 on [Attractiveness (A), Warmth (W), Education (E)], 1–5 scale.
- Cross-Modal Alignment:
- I–T (image-text): CLIPScore
- S–T / M–T (speech/music-text): CLAPScore
- I–S / I–M (image-sound/music): Wav2CLIP
| Metric | Direct Baseline | StoryAgent |
|---|---|---|
| Attractiveness (A) | 3.80 | 3.94 |
| Warmth (W) | 4.18 | 4.21 |
| Education (E) | 3.58 | 3.79 |
| I–T (CLIPScore) | 0.297 | 0.316 |
| S–T | 0.214 | 0.240 |
| M–T | 0.301 | 0.525 |
| I–S | 0.054 | 0.049 |
| I–M | 0.042 | 0.049 |
- Human Evaluation: Three raters review 20 videos, scoring 1–5 on text and modality alignment. Gains for StoryAgent over Direct pipeline include +0.17 for Warmth and Education, image alignment (2.77→3.47), and music alignment (2.57→2.93).
6. Extensibility, Agent Swappability, and Open Source
A defining feature is agent modularity. Each module communicates using structured JSON, permitting its replacement with alternative models that comply with the same schema. To integrate an AI model such as a future Gemini component:
- Textual Generation: Swap LLM (A₁–A₃) with Gemini-Text.
- Image Synthesis: Replace StoryDiffusion with Gemini-Image.
- Audio Synthesis: Substitute CosyVoice, MusicGen, and AudioLDM with Gemini-Audio API.
No core pipeline reengineering is necessary; new endpoints are registered via the agent registry. The open-source codebase (on GitHub) and demo (via HuggingFace Spaces) provide reference implementations and extensibility blueprints.
This design enables research and enterprise users to adopt, extend, and customize Gemini Storybook pipelines for specialized or production-grade multimodal storytelling scaffolds, maintaining strict separation of concerns and promoting rapid innovation.