An automated Python pipeline that transforms Reddit stories into high-quality TikTok, Reels, and YouTube Shorts using AI.
Shorts Flow is a professional-grade content creation tool. It automates the tedious process of syncing AI-generated voiceovers, transcribing subtitles with high accuracy, and overlaying them onto background gameplay footage.
The script handles the "hook" namecard (Title/Username) at the start and intelligently splits long stories into multiple parts so you can upload them as a series.
To see exactly how the script performs, I have provided the assets used for a test run and the final results.
Inputs Used:
- Hook Title: "I have matured so much, and instead of just waiting for my boyfriend to cheat, I have taken control."
- Username:
1000andonenites - Story File: storyNew.txt ( it's not full reddit post )
- Background Video: 📥 Download 2GB Background (External Link)
- Target Duration: 50 Seconds
Generated Output: The story was automatically split into 3 parts. You can view the rendered results here:
The application is designed to be a "set and forget" pipeline for short-form content.
- Input: Place your story in
story.txtand a background video (like Minecraft parkour or GTA) asbackground.mp4. - Voice Generation: Uses Kokoro TTS to create a natural, human-like narration.
- Transcription: Uses Faster-Whisper to generate word-level timestamps for perfectly synced subtitles.
- Auto-Splitting: You input a target duration (e.g., 50 seconds). The script splits the story into Part 1, Part 2, etc., automatically.
- Rendering: The script composites the background, the "hook" card, and the animated text into a finished
.mp4.
Directory Structure:
Project_Folder/
├── main.py # The main script
├── story.txt # Your Reddit story text
├── background.mp4 # Your 9:16 background footage
└── videos/ # Where your finished videos appear
- Because manual editing takes hours, and this takes minutes. Plus, it's free.
| Feature | Description |
|---|---|
| Kokoro TTS | Integrated high-fidelity text-to-speech for realistic narration |
| Faster-Whisper | AI-powered transcription for pixel-perfect subtitle timing |
| Auto-Splitting | Automatically breaks long stories into parts based on your duration input |
| Hook Generator | Creates the iconic "Reddit UI" intro card with custom Title/User |
| Dynamic Subtitles | Word-for-word text overlays rendered via MoviePy and PIL |
| Batch Processing | Handles audio generation and video rendering in one workflow |
Requirements:
- Python 3.10 or higher
- FFmpeg installed and added to your System PATH
Installation Steps:
# Clone the repository
git clone https://github.com/TerzicScript/shorts-flow.git
cd shorts-flow
# Install dependencies
pip install faster-whisper kokoro moviepy soundfile pillowThis project leverages some of the best open-source AI tools available:
- Audio: Kokoro & Soundfile
- Transcription: Faster-Whisper
- Video Editing: MoviePy
- Image/Text Rendering: Pillow (PIL)
Ensure story.txt and background.mp4 are in the project folder.
Run the script:
python main.pyFollow the terminal prompts:
- Enter the Video Title (for the hook).
- Enter the Username (to show on the card).
- Enter the Max Duration per part (e.g., 60 for one minute).
The script will generate audio and ask for confirmation. Press Y to start the final video render.
Contributions are welcome! If you have a better way to style the subtitles or handle transitions, feel free to help out.
- Fork the repository
- Create your feature branch (
git checkout -b feature/CoolUpdates) - Commit your changes
- Push and open a Pull Request
- The AI Community - For providing the TTS and Whisper models.
- My Coffee Machine - For keeping me awake while debugging MoviePy errors.