How joshmoody24/sitcom-simulator works
Main Modules & Components
• Command Line Interface (CLI) & Entry Point:
• Represented by components such as the “cli.py” file. This module accepts user inputs (via command-line arguments or as parameters in a Python script) that trigger the simulation.
• Script Generation Module:
• Includes the “script” directory and modules like “llm.py” and “llm_instructions.txt”.
• Integration with ChatGPT is used to generate the video script based on the provided prompt.
• Image Generation Module:
• Located in the “image” directory, with integrations for both Pillow (for image handling) and Stability (to interface with Stable Diffusion or similar).
• Responsible for creating images for the video frames.
• Music Generation Module:
• Found under the “music” directory with integrations to Freepd.
• This module identifies or generates background music.
• Speech Generation Module:
• Under the “speech” directory, with integrations to FakeYou and GTTS.
• It produces synthesized voices for the characters using deepfake voice generation tools.
• Video Generation Module:
• Present in the “video” directory, integrates tools like FFmpeg and MoviePy.
• This step combines images, synthesized speech, and music to produce the final meme video.
• Additional Modules:
• “auto.py” for automated generation workflows.
• “user_input.py” to capture and process user-provided parameters.
• “social” module (e.g., “yt_uploader.py”) indicated for potential automatic YouTube uploads.
External Service Integrations
• ChatGPT API – for generating scripts.
• Stable Diffusion (via Stability integration) – for image creation.
• FakeYou API – for voice deepfakes and character voice synthesis.
• Freepd – for obtaining background music.
• FFmpeg/MoviePy – for video editing and integration.
Establish Relationships and Interactions
• Flow of Data:
• Start at the CLI/user input, which passes a prompt and style.
• The script module uses ChatGPT to generate a script.
• The generated script is then sent to the image module and speech module to create visual assets and voice overs, respectively.
• The music module selects background audio.
• The video module takes these outputs (images, voice, audio) and assembles them into a final video.
• CLI → Script Generation
• Script Generation → Image & Speech Generation
• Music Generation → Video Generation
• Image, Speech, and Music modules → Video Generation
Architectural Patterns & Design Principles
• Modular Design:
• Each major functionality (script, image, music, speech, video) is encapsulated in its own module with separate interface integrations.
• Integration Points:
• Separate “integrations” directories under each feature (e.g., image/integrations, speech/integrations) emphasize the plug-and-play nature of external API dependency.
• Pipeline Flow:
• The overall architecture follows a pipeline pattern where the output from one module becomes the input for the next stage.
• Customizability:
• The design supports extensibility; for example, easy swapping of voice generation from FakeYou to another tool without major changes to the pipeline.