A command-line tool for generating bad movies using GPT-3, Stable Diffusion, FakeYou, and MoviePy
- Python 3
- ImageMagick executable (download here)
- Stability API key (get one here)
- OpenAI API key (get one here)
- Download the source code (
git clone
or download zip and extract) - Open a terminal window in the root folder of the project
- Install the dependencies:
pip install -r requirements.txt
- Create a .env file in the root directory
- Put the following text into the .env file, replacing the variables with your API keys and file paths:
OPENAI_KEY='openai api key goes here'
STABILITY_KEY='stability api key goes here'
IMAGEMAGICK_BINARY='path to magick.exe goes here' # needed on windows, optional on Linux/MacOS
- (Optional) Make sure the font variable in
config.toml
is a font installed on your computer - You're all set to start making terrible movies!
Sitcom Simulator supports automated YouTube video uploads. The process for setting it up is a bit tricky, but here's a broad overview. I'll create a more in-depth tutorial if there's interest in that. Hit me up.
- Install the Google APIs Client Library for Python:
pip install --upgrade google-api-python-client google-auth-oauthlib google-auth-httplib2 oauth2client
- In Google Cloud, create a new project that has access to the YouTube Data v3 API. Then download your client_secrets csv, name it
client_secrets.json
and put it in thesocial
directory - Use the -u flag to upload the final result to YouTube (it will prompt you to log in)
python create_sitcom.py [-h] [-a] [-q IMG_QUALITY] [-l MAX_LENGTH] [-v] [-p PROMPT] [-s STYLE] [-y]
After some processing time, the video will be saved in the renders
folder in the project directory
python create_sitcom.py --prompt "Luigi tells Mario about his service in the Vietnam war" --high-quality-audio --img-quality 30 --max-length 10 --validate-script --style "on the sitcom how I met your mother (1993)"
- -h, --help: view help message
- -a, --high-quality-audio: use high quality deepfake audio instead of Google text-to-speech (significantly increases generation time)
- -q N, --img-quality N: image quality for generated images (5-100)
- -l N, --max-length N: max number of lines of dialogue in generated script
- -v, --validate-script: require user to approve generated script before creating video
- -p PROMPT, --prompt PROMPT: the prompt for the script that gets send to GPT-3
- -s STYLE, --style STYLE: a string that gets appended to image generation to customize image style
- -f PATH, --script PATH: specify a custom script (TOML format) instead of generating one (see sample_script.toml)
- -y, --yes: answer prompts automatically with 'yes' or default value
- -u, --upload: upload the video to YouTube automatically
Sitcom Simulator is essentially duct tape that combines multiple different AI tools into one unholy abomination.
- GPT-3 generates the video script
- FakeYou generates voices for the characters
- Stable Diffusion generates images for the characters
- MoviePy connects the images and voices into a movie
Want to help work on this project? I'm down! Feel free to contribute. Hit me up if you have any questions 😘