sitcom_simulator.image.image_generator

Functions

add_images(script[, orientation, ...])

Given a script, returns the same script but with the image paths filled in.

generate_images(script[, orientation, ...])

Generates and returns a list of image paths for the given script.

sitcom_simulator.image.image_generator.generate_images(script, orientation='portrait', on_image_generated=None, engine='stability')

Generates and returns a list of image paths for the given script.

More procedural in nature than add_images.

Parameters:
  • script (Script) – The script to generate images for

  • orientation (Literal['landscape', 'portrait', 'square']) – The orientation of the images to generate

  • on_image_generated (Optional[Callable[[int, str], None]]) – A callback to call after each image is generated which takes the clip index and path to the generated image

  • engine (Literal['stability', 'pillow']) – The engine to use for generating images

sitcom_simulator.image.image_generator.add_images(script, orientation='portrait', on_image_generated=None, engine='stability')

Given a script, returns the same script but with the image paths filled in.

More functional in nature than generate_images.

Parameters:
  • script (Script) – The script to add images to

  • orientation (Literal['landscape', 'portrait', 'square']) – The orientation of the images to generate

  • on_image_generated (Optional[Callable[[int, str], None]]) – A callback to call after each image is generated which takes the clip index and path to the generated image

  • engine (Literal['stability', 'pillow']) – The engine to use for generating images

Return type:

Script