Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cd5946f
Added Sphynx documentation and GitHub action to auto-deploy it to Git…
joshmoody24 Feb 10, 2024
70a5a06
updated dependencies
joshmoody24 Feb 13, 2024
5d137c2
improved support for callbacks
joshmoody24 Feb 13, 2024
12b7768
added lazy loading to the heavier dependencies
joshmoody24 Feb 13, 2024
1d2c23d
added more lazy loading
joshmoody24 Feb 13, 2024
38c4965
added support for remote images
joshmoody24 Feb 14, 2024
2ead7b9
unfroze models for convenience
joshmoody24 Feb 14, 2024
e708c1d
added support for remote audio
joshmoody24 Feb 14, 2024
59290a4
ffmpeg bugfix
joshmoody24 Feb 14, 2024
8f603ff
more audio probing bug fixes
joshmoody24 Feb 14, 2024
3815b4d
made metadata more flexible
joshmoody24 Feb 17, 2024
e6aeba6
added audio delay settings and font settings to the API and CLI
joshmoody24 Feb 17, 2024
0fb0dc3
renamed some parameters for clarity
joshmoody24 Feb 17, 2024
bd9c8f9
added custom instructions
joshmoody24 Feb 22, 2024
bf09a04
added the ability to customize the style of video captions
joshmoody24 Feb 27, 2024
d00ba7c
added fakeyou authorization
joshmoody24 Feb 27, 2024
7ca3c7a
reduced the number of sign-in requests to fakeyou
joshmoody24 Feb 27, 2024
6577656
fixed bugs related to toml script file loading
joshmoody24 Feb 27, 2024
40610d6
added many more video customization optoins
joshmoody24 Mar 1, 2024
3bd92c4
added curated voices list
joshmoody24 Mar 1, 2024
c6bdea9
added audio balancing and narrator dropout
joshmoody24 Mar 1, 2024
a98c094
fixed various minor bugs with the previous release and made the orien…
joshmoody24 Mar 1, 2024
6a0523b
fixed potential error with using unlisted character
joshmoody24 Mar 5, 2024
7cfc291
added ability to customize background music
joshmoody24 Mar 5, 2024
f8c2cea
fixed bug in background music selector
joshmoody24 Mar 5, 2024
69efe01
minor documentation updates
joshmoody24 Mar 5, 2024
b62958d
Update README.md to fix broken env link
joshmoody24 Mar 5, 2024
19f19fe
Update installation.rst
joshmoody24 Mar 5, 2024
b4899aa
gitignored .vscode
joshmoody24 Mar 6, 2024
f9344f9
added support for aac audio codec
joshmoody24 Mar 7, 2024
07cf7b8
improved character detection and video rendering settings
joshmoody24 Mar 18, 2024
0506990
fixed crash when trying to use obscure characters
joshmoody24 Mar 22, 2024
6caa587
Linked web app in README
joshmoody24 Aug 6, 2024
fd3c569
Update README.md
joshmoody24 Aug 6, 2024
132c669
changed default chatgpt model to gpt-4o-mini
joshmoody24 Aug 11, 2024
92769c0
Changed text background to text_shadow by default, instaed of box_shadow
joshmoody24 Aug 11, 2024
de6b9c2
fixed problem with new text defaults
joshmoody24 Aug 11, 2024
c2c0a60
Fix to accommodate FakeYou API changes
joshmoody24 Feb 10, 2025
ff2a1c6
Bumping from release candidate to release
joshmoody24 Feb 10, 2025
fd3d99a
Updated README with new web app domain name
joshmoody24 Apr 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Deploy Documentation

on:
push:
branches: ["master"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Python Packages
run: pip install sphinx && pip install -r docs/requirements.txt && pip install -r requirements.txt
- name: Build Docs
run: sphinx-build -M html ./docs ./docs/_build/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/_build/html/


deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ ffmpeg.exe
ffprobe.exe
*.ttf
*.mp4
# Sphinx
docs/_build/
docs/_autosummary/
docs/_static/
docs/doctrees/
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class


# C extensions
*.so

Expand Down
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

101 changes: 20 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Sitcom Simulator
A highly-customizable tool that automatically creates AI-generated meme videos

## Update

Sitcom Simulator's web app has moved to [https://sitcom-simulator.net](https://sitcom-simulator.net), instead of `.com` due to the old domain expiring and getting scalped 😅

`pip install sitcom-simulator`

## Examples
## Documentation

[View the documentation](https://joshmoody24.github.io/sitcom-simulator/) for setup instructions and code samples.

## Example Videos

<p float="left">
<a href="https://youtube.com/shorts/NQezju-_vtw?si=s2IcfYIhdK6oaE6o">
Expand Down Expand Up @@ -48,7 +56,7 @@ Sitcom Simulator is designed to be simple to use, but also supports extreme cust

### 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](#environment-variables) before it will work.
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](https://joshmoody24.github.io/sitcom-simulator/installation.html#environment-variables) before it will work.

```bash
sitcom-simulator --prompt "Elon Musk teleports a toaster into the ocean" --style "beautiful renaissance oil painting"
Expand All @@ -67,92 +75,23 @@ create_sitcom(
)
```

Power users can completely customize the video creation process:

```python
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](https://ffmpeg.org/download.html) (see below for more details)
- Stability API key (get one [here](https://beta.dreamstudio.ai/membership?tab=apiKeys))
- OpenAI API key (get one [here](https://openai.com/api/))

#### 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](https://ffmpeg.org/download.html) 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](#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:

```bash
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.
Sitcom Simulator is essentially duct tape that combines various AI tools into one unholy abomination.
1. [ChatGPT](https://chat.openai.com/) generates the video script
2. [FakeYou](https://fakeyou.com) generates voices for the characters
3. [Stable Diffusion](https://stability.ai/stable-image) generates images for the characters
3. [Stable Diffusion](https://stability.ai/stable-image) generates images of the characters
4. [Freepd](https://freepd.com/) provides the background music
5. [FFmpeg](https://ffmpeg.org/) 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 :)
Want to help work on this project? I'm down! [Contact me](https://joshmoody.org/contact/) if you want to contribute or have any questions :)

Have fun!!!

## Links

Have fun!!!
- [Documentation](https://joshmoody24.github.io/sitcom-simulator/)
- [sitcom-simulator.net](https://sitcom-simulator.net)
- Formerly `sitcom-simulator.com`
9 changes: 0 additions & 9 deletions config.toml

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API
===

.. autosummary::
:toctree: _autosummary
:recursive:

sitcom_simulator
69 changes: 69 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import toml
import os
import sys
sys.path.insert(0, os.path.abspath('..')) # enable importing sitcom_simulator

pyproject = toml.load('../pyproject.toml')

project = pyproject['project']['name']
author = pyproject['project']['authors'][0]['name']
copyright = f'2024, {author}'
version = pyproject['project']['version']
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx_autodoc_typehints',
]

autosummary_generate = True
autodoc_typehints = "description" # description, signature, none
autodoc_typehints_format = "short"
autodoc_default_options = {
'members': True,
'member-order': 'bysource',
'special-members': '__init__',
'undoc-members': True,
'exclude-members': '__weakref__',
# make function params alphabetical
}


templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'furo' # 'alabaster'
html_static_path = ['_static']

html_logo = "sitcom-simulator-logo.png"
html_theme_options = {
"light_css_variables": {
"color-brand-primary": "green",
"color-brand-content": "green",
"color-admonition-background": "green",
},
"dark_css_variables": {
"color-brand-primary": "springgreen",
"color-brand-content": "springgreen",
"color-admonition-background": "green",
},
}
36 changes: 36 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. Sitcom Simulator documentation master file, created by
sphinx-quickstart on Sat Feb 10 23:00:30 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Sitcom Simulator
============================================

**Sitcom Simulator** is a highly-customizable tool for automatically creating AI-generated meme videos. It combines numerous generative AI tools like `ChatGPT <https://chat.openai.com/>`_, `Stable Diffusion <https://stability.ai/stable-image/>`_, and `FakeYou <https://fakeyou.com>`_ to create short, funny videos in many styles.

.. toctree::
:maxdepth: 2
:caption: Getting Started

overview
installation
usage

.. toctree::
:maxdepth: 2
:caption: Reference

llm_instructions
api

Index
----------------

* :ref:`genindex`
* :ref:`modindex`

External Links
----------------

* `GitHub <https://github.com/joshmoody24/sitcom-simulator>`_
* `PyPi <https://pypi.org/project/sitcom-simulator/>`_
Loading