Skip to main content

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

And several hundred more.

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:

Command 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.

  1. ChatGPT generates the video script
  2. FakeYou generates voices for the characters
  3. Stable Diffusion generates images for the characters
  4. Freepd provides the background music
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sitcom_simulator-0.0.8.tar.gz (26.7 kB view hashes)

Uploaded Source

Built Distribution

sitcom_simulator-0.0.8-py3-none-any.whl (35.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page