sitcom_simulator.auto

Functions

create_sitcom([prompt, art_style, ...])

Generates a sitcom video based on a prompt or a script file.

sitcom_simulator.auto.create_sitcom(prompt=None, art_style=None, script_path=None, debug_images=False, debug_audio=False, font='Arial', max_tokens=2048, approve_script=False, manual_select_characters=True, upload_to_yt=False, audio_job_delay=30, audio_poll_delay=10, caption_bg_style='text_shadow', save_script=False, speed=1, pan_and_zoom=True, orientation='portrait', resolution=1080, narrator_dropout=False, music_url=None, audio_codec='mp3')

Generates a sitcom video based on a prompt or a script file. It combines the script generation, voice generation, image generation, music generation, and video rendering steps into a single function.

Parameters:
  • prompt (str | None) – The prompt to generate the video script. If not provided, a script path must be provided.

  • art_style (str | None) – The art style to use for the video. If not provided, the art style will be selected by the language model.

  • script_path (str | None) – The path to a TOML script file to use for the video. The TOML must map to the Script model. If not provided, a prompt must be provided.

  • debug – If True, the video will be generated using the debug mode, which uses the GTTS and Pillow engines instead of the FakeYou and Stability engines to increase speed and reduce costs.

  • font (str) – The font to use for the video. This font must be installed on the system.

  • max_tokens (int) – The maximum number of tokens to use for the language model. This will affect the length of the generated script.

  • approve_script (bool) – If True, the script must be approved by the user before generating the video.

  • manual_select_characters (bool) – If True, the user will be prompted to select the characters for the video. If False, the characters will be selected automatically by the language model.

  • upload_to_yt – If True, the video will be uploaded to YouTube after it is generated. NOTE: currently does not work.

  • audio_job_delay (int) – The number of seconds to wait between starting audio generation jobs. Lower values render faster but are more likely to get rate limited. (FakeYou only)

  • audio_poll_delay (int) – The number of seconds to wait between polling for audio generation job completion. (FakeYou only)

  • caption_bg_style (Literal['box_shadow', 'text_shadow', 'none']) – The style of the background behind the captions.

  • save_script (bool) – If True, the generated script will be saved to a file.

  • speed (float) – The speed of the final video. 1.0 is normal speed.

  • pan_and_zoom (bool) – If True, the pan and zoom effect on images will be enabled.

  • orientation (Literal['landscape', 'portrait', 'square']) – The orientation of the video. “landscape”, “portrait”, or “square”.

  • resolution (int) – The width of the video to render assuming portrait mode. This takes into account the orientation parameter.

  • narrator_dropout (bool) – If True, the narrator will be forcibly removed from the script (ChatGPT often goes heavy on the narrators).

  • music_url (str | None) – A URL to a music track to use for the video.

  • audio_codec (Literal['mp3', 'aac']) – The audio codec to use for the video. mp3 seems to be more compatible with more video players, but aac is higher quality and is necessary for viewing videos in an iPhone browser.

  • debug_images (bool)

  • debug_audio (bool)