A comprehensive application that generates children's stories and converts them into multimedia content using various AI services from Google Cloud Platform.
- Story Generation using Gemini 1.5 Pro
- Text-to-Speech Narration
- AI Image Generation for Story Scenes
- Automated Video Creation from Generated Content
- Flashcard Generation for Story Scenes
- Google Cloud Platform Services:
- Vertex AI (Gemini 1.5 Pro)
- Text-to-Speech API
- Imagen 3.0 for Image Generation
- LangChain Framework
- MoviePy for Video Generation
- Python 3.x
- Python 3.x
- Google Cloud Platform Account
- Required API Credentials:
- Google Cloud Service Account Credentials
- Vertex AI API Access
- Text-to-Speech API Access
- Clone the repository:
git clone <repository-url>
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables in
.env
file:
GOOGLE_APPLICATION_CREDENTIALS=path/to/credentials.json
GOOGLE_APPLICATION_CREDENTIALS2=path/to/credentials2.json
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_REGION=your-region
GOOGLE_CLOUD_REGION2=your-region-2
- Initialize the application:
from app import generate_story, flashcard_generator, text_to_speech, extract_and_generate_scenes
- Generate a story:
context = "Your story context here"
story = generate_story(context)
- Generate flashcards and multimedia content:
flashcard = flashcard_generator(story)
text_to_speech(story)
extract_and_generate_scenes(flashcard, story)
app.py
- Main application entry pointservices/
storyGenerationService.py
- Story and flashcard generationtextToSpeechService.py
- Audio narration generationtextToImageService.py
- AI image generationvideoGenerationService.py
- Video compilation
core/
config.py
- Configuration management
The application generates:
- A written story in children's book style
- Flashcards with scene descriptions
- Audio narration (MP3 format)
- AI-generated images for each scene
- A compiled video with images and narration
- Keep your Google Cloud credentials secure
- Do not commit credential files to version control
- Use environment variables for sensitive information