Bryan Agents is an advanced multi-agent system designed for generating music videos based on lyrics. This project analyzes the lyrics and creates detailed prompts based on the analysis results to generate story-like images, ultimately producing an image-to-image music video. The system leverages the OpenAI API, specifically the GPT-4o model for text processing and the DALL-E 3 model for image generation, to provide an end-to-end solution for video content creation.
Before you begin, ensure you have met the following requirements:
ffmpeg installed and available in your system's PATHffmpegffmpeg from the official website.bin folder to your system's PATH:
Path variable in the "System variables" section and select it. Click on "Edit".bin folder of the extracted ffmpeg archive. Click "OK" to apply the changes.Install Homebrew if you don't have it installed. Open the Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Use Homebrew to install ffmpeg:
brew install ffmpegFor Debian-based distributions (e.g., Ubuntu), open the Terminal and run:
sudo apt update
sudo apt install ffmpegFor Red Hat-based distributions (e.g., Fedora), open the Terminal and run:
sudo dnf install ffmpegClone the repository:
git clone https://github.com/tanbryan/ai-mv-generator
cd bryan-agentCreate and activate a virtual environment (optional):
python -m venv venv
source venv/bin/activate # On Windows use `venvScriptsactivate`Install the required dependencies:
pip install -r requirements.txtSet up your OpenAI API key:
Create a .env file in the project root and add your OpenAI API key:
OPENAI_API_KEY= "your_openai_api_key_here"Run the main script:
Ensure that the lyrics file (.lrc) and music file (.mp3) are located within a dedicated directory.
❗️Please make sure both files are named in the format of 'SongName-ArtistName.lrc or .mp3'
Go into the main script runner.py and add your complete paths to both files:
Then run:
python runner.pyAgent Execution and Result Saving:
Each agent will work sequentially on the provided lyrics file:
During the execution, an agent_status.json file will be created in the base_agent directory. This file keeps track of the status of each agent. If any agent completes, its status will be set to true. You can always set the status to false to rerun a specific agent if needed.
Review the generated prompts:
The script will pause after generating the prompts. Review them in the generated JSON file within the lyrics directory. Once reviewed, press Enter to continue.
Complete the image and video generation:
Follow the prompts to complete the image and video generation process.
In the test directory, after running, you will find sample outputs based on the "Love Story" by Taylor Swift lyrics file:
LoveStory-TaylorSwift.mp4: The preview of the final generated video.background.mp4: Clean pre generated background video.generated_prompts.json: The JSON file containing the detailed prompts generated for the images.logo.png: The generated logo for the music video.results.json: The JSON file containing the results from each agent.background_images/: A folder containing the background images generated based on the prompts.These samples provide an example of the output you can expect from the system.
This project is licensed under the MIT License. See the LICENSE file for details.