pyrit.prompt_converter.AddImageVideoConverter#
- class AddImageVideoConverter(video_path: str, output_path: str = None, img_position: tuple = (10, 10), img_resize_size: tuple = (500, 500))[source]#
Bases:
PromptConverter
Adds an image to a video at a specified position. Also, currently the image is placed in the whole video, not at a specific timepoint
- Parameters:
video_path (str) – File path of video to add image to
output_path (str, Optional) – File path of output video. Defaults to None.
img_position (tuple, Optional) – Position to place image in video. Defaults to (10, 10).
img_resize_size (tuple, Optional) – Size to resize image to. Defaults to (500, 500).
- __init__(video_path: str, output_path: str = None, img_position: tuple = (10, 10), img_resize_size: tuple = (500, 500))[source]#
Methods
__init__
(video_path[, output_path, ...])convert_async
(*, prompt[, input_type])Converter that adds an image to a video
convert_tokens_async
(*, prompt[, ...])Converts substrings within a prompt that are enclosed by specified start and end tokens.
get_identifier
()input_supported
(input_type)Checks if the input type is supported by the converter
output_supported
(output_type)Checks if the output type is supported by the converter
Attributes
supported_input_types
Returns a list of supported input types for the converter.
supported_output_types
Returns a list of supported output types for the converter.
- async convert_async(*, prompt: str, input_type: Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error'] = 'image_path') ConverterResult [source]#
Converter that adds an image to a video
- Parameters:
prompt (str) – The image file name to be added to the video.
input_type (PromptDataType) – type of data
- Returns:
The filename of the converted video as a ConverterResult Object
- Return type:
- input_supported(input_type: Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error']) bool [source]#
Checks if the input type is supported by the converter
- Parameters:
input_type – The input type to check
- Returns:
True if the input type is supported, False otherwise
- Return type:
- output_supported(output_type: Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'error']) bool [source]#
Checks if the output type is supported by the converter
- Parameters:
output_type – The output type to check
- Returns:
True if the output type is supported, False otherwise
- Return type: