Text To Video AI
February 5, 2026 ยท View on GitHub
Generate engaging videos from text prompts using AI. Perfect for creating YouTube Shorts, Instagram Reels, TikTok videos, and more.
Want to skip the setup? Use our Premium API to generate videos instantly - no installation required, production-ready, and scales with your needs.
Demo
https://github.com/user-attachments/assets/1e440ace-8560-4e12-850e-c532740711e7
Features
- AI-Powered Script Generation - Automatically generates engaging scripts from any topic
- Multiple LLM Providers - Choose from OpenAI, Groq, or Google Gemini
- Text-to-Speech - Natural-sounding voiceovers with EdgeTTS (free) or ElevenLabs
- Automatic B-Roll - Fetches relevant background videos from Pexels
- Customizable Captions - Full control over font, color, position, and styling
- Multiple Orientations - Portrait (9:16) for shorts or Landscape (16:9) for traditional video
- Speech-to-Text - Accurate caption timing with Whisper or Deepgram
Quick Start
Option 1: Use the Premium API (Recommended)
Skip all setup and generate videos with a single API call:
Option 2: Google Colab
Run directly in your browser with our Colab Notebook
Option 3: Local Installation
See installation instructions below.
Installation
Prerequisites
- Python 3.8+
- FFmpeg
- ImageMagick
Windows users: See INSTALL_WINDOWS.md for detailed setup instructions.
Setup
# Clone the repository
git clone https://github.com/SamurAIGPT/Text-To-Video-AI.git
cd Text-To-Video-AI
# Install dependencies
pip install -r requirements.txt
# Create your configuration file
cp .env.example .env
Edit .env with your API keys (see Configuration below).
Usage
python app.py "Your topic here"
Output will be saved as rendered_video.mp4
Configuration
All settings are configured via the .env file. Copy .env.example to get started.
API Keys
| Service | Required | Get API Key |
|---|---|---|
| Pexels | Always | pexels.com/api |
| OpenAI | If using OpenAI | platform.openai.com |
| Groq | If using Groq | console.groq.com |
| Google Gemini | If using Gemini | makersuite.google.com |
| Deepgram | If using Deepgram STT | console.deepgram.com |
| ElevenLabs | If using ElevenLabs TTS | elevenlabs.io |
Provider Selection
# LLM Provider: openai, groq, or gemini
LLM_PROVIDER=openai
# Text-to-Speech: edgetts (free) or elevenlabs
TTS_PROVIDER=edgetts
# Speech-to-Text: whisper (free) or deepgram
STT_PROVIDER=whisper
Video Settings
# Orientation: portrait (1080x1920) or landscape (1920x1080)
# Portrait recommended for YouTube Shorts, Instagram Reels, TikTok
VIDEO_ORIENTATION=portrait
Caption Settings
# Enable or disable captions
CAPTIONS_ENABLED=true
# Caption styling
CAPTION_FONT_SIZE=100
CAPTION_FONT_COLOR=white
CAPTION_FONT_FACE=Arial-Bold
CAPTION_STROKE_WIDTH=3
CAPTION_STROKE_COLOR=black
CAPTION_POSITION=bottom_center
Caption Position Options: center, top, bottom, bottom_center, bottom_left, bottom_right
Font Color Options: white, yellow, cyan, red, green, blue, magenta
Voice Configuration
EdgeTTS (Free):
EDGETTS_VOICE=en-AU-WilliamNeural
Popular voices:
en-US-ChristopherNeural- American maleen-US-JennyNeural- American femaleen-GB-RyanNeural- British maleen-GB-SoniaNeural- British femaleen-AU-WilliamNeural- Australian male
ElevenLabs:
ELEVENLABS_API_KEY=your_key
ELEVENLABS_VOICE_ID=your_voice_id
Tutorials
Contributing
We welcome contributions! To get started:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Premium API
Looking for a production-ready solution? Our Premium API offers:
- No installation or setup required
- Multiple video durations (30s to 10 minutes)
- Advanced voice and language options
- Custom styling and branding
- Scalable infrastructure
Related Projects
| Project | Description |
|---|---|
| AI Influencer Generator | Create AI-powered virtual influencers |
| AI YouTube Shorts Generator | Automated YouTube Shorts creation |
| Faceless Video Generator | Create videos without showing your face |
| AI B-roll Generator | Generate B-roll footage with AI |
Vadoo AI Tools
- AI Video Generator
- Text to Video AI
- Autoshorts AI
- Pixverse Alternative
- Hailuo AI Alternative
- Minimax AI Alternative
Support
If you find this project useful, please consider giving it a star! Your support helps us continue improving the project.