Text To Video AI
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
Sample Videos
Here are sample videos generated end-to-end directly by this project using the React/Remotion composition engine:
"Wonders of Outer Space" — An educational video about the cosmos, galaxies, and black holes. Generated using local EdgeTTS voiceover, whisper-timestamped local word captions, Suno AI background music, and Veo3 AI B-roll video segments.
"Exploring the Deep Ocean" — A cinematic short exploring deep sea depths, bioluminescent creatures, and thermal vents. Generated using local EdgeTTS voiceover, whisper-timestamped local word captions, Suno AI background music, and Veo3 AI B-roll video segments.
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 .envEdit .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=whisperVideo Settings
# Orientation: portrait (1080x1920) or landscape (1920x1080)
# Portrait recommended for YouTube Shorts, Instagram Reels, TikTok
VIDEO_ORIENTATION=portraitAI Video Generation (Muapi)
# Muapi API credentials
MUAPI_BASE_URL=https://api.muapi.ai
MUAPI_API_KEY=your_key
# Video Model to use
MUAPI_VIDEO_MODEL=veo3-fast-text-to-videoSupported Muapi Video Models:
- Google Veo:
veo3-fast-text-to-video,veo3-text-to-video,veo3.1-fast-text-to-video,veo3.1-text-to-video,veo3.1-lite-text-to-video - xAI Grok:
grok-imagine-text-to-video - ByteDance Seedance:
sd-2-t2v(Seedance 2),seedance-2-vip-text-to-video,seedance-pro-t2v,seedance-lite-t2v - Wan:
wan2.7-text-to-video,wan2.6-text-to-video,wan2.5-text-to-video,wan2.1-text-to-video - LTX:
ltx-2.3-text-to-video,ltx-2-pro-text-to-video,ltx-2-fast-text-to-video - Kling:
kling-v3.0-pro-text-to-video,kling-v3.0-standard-text-to-video - Vidu:
vidu-q3-pro-text-to-video,vidu-q2-pro-text-to-video - OpenAI Sora:
openai-sora-2-pro-text-to-video,openai-sora-2-standard-text-to-video - MiniMax:
minimax-hailuo-2.3-pro-t2v,minimax-hailuo-2.3-standard-t2v - Alibaba:
happy-horse-1-text-to-video-1080p
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_centerCaption 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-WilliamNeuralPopular 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_idTutorials
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.