AI-Driven YouTube Shorts Generator

Introducing an innovative, AI-powered video creation platform designed to help you effortlessly generate engaging YouTube Shorts. This project combines the creativity of GPT-4 for scriptwriting, the visual brilliance of Stable Diffusion XL for image synthesis, and powerful tools for text-to-speech and video editing—all in a single, streamlined workflow. Whether you’re a developer or content creator, experience a new level of automation that transforms text prompts into captivating, professional-grade videos with auto-generated subtitles.

Description


Installation Instructions

Requirements:

  • Python 3.8 or newer

  • ffmpeg (ensure it’s installed and added to your system PATH)

  • (Optional) A compatible GPU for faster image generation

Step 1: Clone or Download the Repository
Download or clone the repository containing the files “sd_server.py” and “app.py”.

Step 2: Create and Activate a Virtual Environment
Open your terminal, navigate to your project’s directory, and run the following commands:

For macOS/Linux: python3 -m venv venv
source venv/bin/activate

For Windows: python -m venv venv
venv\Scripts\activate

Step 3: Install Required Dependencies
Run this command to install the necessary packages: pip install flask torch diffusers safetensors Pillow requests pysrt whisper mutagen moviepy langchain langchain_openai

Note: The diffusers package (along with safetensors) downloads model weights at runtime from StabilityAI, so ensure you have a stable internet connection. Additionally, you might need to install extra system dependencies like ffmpeg based on your platform.

Step 4: Configure API Keys
Open the file “app.py” in your preferred text editor and update the API key placeholders: • Replace “sk-proj-000-000-000” with your actual OPENAI_API_KEY. • Replace “sk_0000000000000000000000000000000000000” with your actual ELEVENLABS_API_KEY.

Step 5: Start the Flask Server and Run the App

  1. In your terminal, start the Stable Diffusion server by running: python sd_server.py
    The server will start at http://0.0.0.0:5000

  2. In another terminal (with your virtual environment activated), run: python app.py
    Follow the on-screen prompts to enter a topic. The app will generate a script, create images via the local Flask API, convert text to speech, produce subtitles, and assemble a YouTube Short video.