Transform any story into a professional movie screenplay and trailer with AI-powered automation.
Story2Screen is an intelligent application that takes a narrativeβwhether it's a story idea, Reddit post, or creative conceptβand automatically generates:
- β¨ A complete movie screenplay with proper formatting
- π₯ A compelling movie trailer extracted from cinematic moments
- π A downloadable PDF combining both outputs
- Story-to-Screenplay Pipeline: Intelligent conversion from narrative text to professional screenplay format
- AI-Powered Analysis: Uses Google Gemini 2.5 Flash for creative and coherent story understanding
- Scene Extraction: Automatically identifies cinematic moments from the screenplay
- Trailer Generation: Creates an engaging trailer strictly from screenplay content
- PDF Export: Download scripts and trailers in professional PDF format
- Streamlit Web Interface: User-friendly web app with real-time processing feedback
- Modular Architecture: Clean separation of concerns for easy customization
Story Input
β
Story Analysis (Analyze themes, characters, plot structure)
β
Plot Building (Create detailed plot outline)
β
Screenplay Writing (Generate formatted movie script)
β
Scene Extraction (Identify key cinematic moments)
β
Trailer Generation (Craft engaging trailer from scenes)
β
PDF Export (Download as professional document)
- Backend: Python 3.8+
- UI Framework: Streamlit - Simple and elegant web interface
- AI/LLM: Google Generative AI (Gemini 2.5 Flash) - Fast creative text generation
- PDF Generation: fpdf - Professional document export
- Environment Management: python-dotenv - Secure API key handling
- Python 3.8 or higher
- Google Gemini API key (get one free here)
git clone <repository-url>
cd "AI Movie Script Generator"python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root:
GEMINI_API_KEY=your_api_key_herestreamlit run app.pyThe web interface will open at http://localhost:8501
- Paste your story in the text area (story idea, Reddit post, plot synopsis, etc.)
- Click "π₯ Generate Script & Trailer"
- Review the outputs:
- Movie screenplay with proper formatting
- Generated trailer
- Download as PDF for sharing or printing
AI Movie Script Generator/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ verify_prompts.py # Utility for validating prompt quality
β
βββ config/
β βββ settings.py # Gemini API configuration
β βββ __pycache__/
β
βββ core/ # Core processing modules
β βββ story_analyzer.py # Analyzes narrative structure and themes
β βββ plot_builder.py # Creates detailed plot outlines
β βββ script_writer.py # Generates screenplay from plot
β βββ scene_extractor.py # Identifies cinematic moments
β βββ trailer_generator.py # Creates trailer from scenes
β βββ __pycache__/
β
βββ utils/ # Utility functions
β βββ formatter.py # Text formatting and parsing
β βββ pdf_generator.py # PDF document creation
β βββ __pycache__/
β
βββ prompts/ # AI prompt templates
β βββ analysis.txt # Story analysis prompts
β βββ plot.txt # Plot building prompts
β βββ scene_extract.txt # Scene identification prompts
β βββ screenplay.txt # Screenplay writing prompts
β βββ trailer.txt # Trailer generation prompts
β
βββ outputs/ # Generated output directory
β βββ scripts/ # Saved screenplays
β βββ trailers/ # Saved trailers
β
βββ README.md # This file
The application uses Google's Gemini 2.5 Flash model by default, configured in config/settings.py.
To use a different model:
MODEL_NAME = "gemini-pro" # or another available modelModify prompt templates in the prompts/ directory to customize:
- Story analysis approach
- Plot structure preferences
- Screenplay format
- Trailer tone and style
The application analyzes the input story to extract:
- Main themes and messages
- Character profiles and arcs
- Plot structure and key turning points
- Emotional tone and pacing
Creates a structured outline including:
- Three-act structure breakdown
- Scene-by-scene progression
- Character development points
- Dialogue and action requirements
Generates a professional screenplay with:
- Proper screenplay formatting (INT./EXT., action, dialogue)
- Scene headings and descriptions
- Character names and dialogue
- Parenthetical directions
Identifies the most cinematic and impactful moments from the screenplay based on:
- Visual interest
- Emotional impact
- Plot importance
- Entertainment value
Creates an engaging trailer that:
- Showcases the story's best moments
- Maintains narrative coherence
- Builds suspense and interest
- Stays true to screenplay content
Contributions are welcome! Feel free to:
- Report bugs and issues
- Suggest improvements
- Add new features
- Optimize existing code
- Enhance prompt templates
- API Usage: Free tier of Google Gemini API may have rate limits. Check pricing details
- Output Quality: Results depend on story clarity and length. Well-structured input produces better screenplays
- Customization: Modify prompts and models for different genres and styles
- Dependencies: Ensure all packages in requirements.txt are installed
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
You are free to:
- Use, modify, and distribute this software
- Use it for both commercial and non-commercial purposes
Under the condition that you:
- Include a copy of the license with any distribution
- Disclose the source code
- Include a notice of modifications
- Use the same license for derivative works
For more details, see the GNU GPL v3.0 License.
- Ensure
.envfile exists in project root - Verify API key is correctly set:
GEMINI_API_KEY=your_key - Restart the Streamlit app
- This is normal for longer stories (can take 1-3 minutes)
- Gemini 2.5 Flash prioritizes quality over speed
- Check internet connection
- Ensure
fpdfis installed:pip install fpdf - Check write permissions in outputs directory
For issues, questions, or suggestions, please review the code documentation or check the prompts in the prompts/ directory for customization options.
Made with β€οΈ for storytellers and screenwriters
Story2Screen - Because every great story deserves to be on screen.