A highly-cusotmizable tool that automatically creates AI-generated meme videos
Project description
Sitcom Simulator
A highly-customizable tool that automatically creates AI-generated meme videos
pip install sitcom-simulator
Examples
Features
- AI-generated scripts
- AI-generated images
- Deepfaked character voices
- Automatic background music finder
- Limitless customizability
- (coming soon) Automatic YouTube uploading
Usage
Sitcom Simulator is designed to be simple to use, but also supports extreme customizability for power users who know exactly what they want. Sitcom Simulator can be used from the command line or can be imported in Python scripts.
Command Line
The most basic usage is simply running the sitcom-simulator
command with no arguments. Many optional arguments are supported as well. Note that you must set your API key environment variables before it will work.
sitcom-simulator --prompt "Elon Musk teleports a toaster into the ocean" --style "beautiful renaissance oil painting"
Python
Sitcom Simulator can also be imported in Python scripts:
from sitcom_simulator import create_sitcom
# generate a short meme video and save it in the project folder
create_sitcom(
prompt="Mario hits Luigi with a stapler",
)
Power users can completely customize the video creation process:
from sitcom_simulator import (
script_from_file,
add_voices,
add_images,
add_music,
render_video,
)
def upload_to_s3(index, file_path):
... # arbitrary code
initial_script = script_from_file("custom_script.toml")
script_with_voices = add_voices(
initial_script,
engine="fakeyou",
on_voice_generated=upload_to_s3)
script_with_images = add_images(
script_with_voices,
engine="stability",
on_image_generated=upload_to_s3)
script_with_music = add_music(script_with_images)
render_video(
script=final_script,
font="Papyrus",
output_path=f"./{final_script.metadata.title}.mp4")
More documentation on the advanced features will be coming soon.
Getting Started
Several things must be completed before running Sitcom Simulator for the first time.
Prerequisites
- Python 3
- ffmpeg (see below for more details)
- Stability API key (get one here)
- OpenAI API key (get one here)
FFmpeg
The ffmpeg command must be accessible on your machine. This will vary depending on your system, but you can install it from the official download page or various package managers, e.g., apt install ffmpeg
on Debian/Ubuntu, brew install ffmpeg
on Mac, etc.
Alternatively, instead of installing ffmpeg on your system, you can place the ffmpeg
and ffprobe
binaries in your project's root directory, which will work equally well.
Environment Variables
This package requires API keys from OpenAI and Stability AI to be stored in environment variables.
First, acquire API keys for OpenAI and Stability AI (see prerequisites)
How you set the environment variables will depend on your use case:
Comamnd Line
Set the environments in the terminal, i.e., export OPENAI_API_KEY=<value>
(Linux) set OPENAI_API_KEY=<value>
(Windows)
Python Projects
Create a .env
file in your project's root directory, with the following structure:
STABILITY_API_KEY='your_key_here'
OPENAI_API_KEY='your_key_here'
The .env
file will be automatically detected by the program.
How it Works
Sitcom Simulator is essentially duct tape that combines multiple different AI tools into one unholy abomination.
- ChatGPT generates the video script
- FakeYou generates voices for the characters
- Stable Diffusion generates images for the characters
- Freepd provides the background music
- FFmpeg connects the images and voices into a movie
Contributions
Want to help work on this project? I'm down! Feel free to reach out to me if you want to contribute or have any questions :)
Have fun!!!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sitcom_simulator-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b455340e502d0ddb918c4e2b2c4d74f0916fa18b3f4453349c8a59544dbc205 |
|
MD5 | 6bbc386dc1df941760cf69b66e1e0bd0 |
|
BLAKE2b-256 | 8d8ab3f5861ded8f261737311fe8d83ce803c0ad1fcccf079362c70f0f56e438 |