PreviewTrigger

class lib.gui.utils.image.PreviewTrigger

Bases: object

Triggers to indicate to underlying Faceswap process that the preview image should be updated.

Writes a file to the cache folder that is picked up by the main process.

Methods Summary

clear([trigger_type])

Remove the trigger file from the cache folder.

set(trigger_type)

Place the trigger file into the cache folder

Methods Documentation

clear(trigger_type: Literal['update', 'mask_toggle'] | None = None) None

Remove the trigger file from the cache folder.

Parameters:

trigger_type ([“update”, “mask_toggle”, None], optional) – The trigger to clear. ‘update’: Full preview update. ‘mask_toggle’: toggle mask on and off. None - clear all triggers. Default: None

Return type:

None

set(trigger_type: Literal['update', 'mask_toggle'])

Place the trigger file into the cache folder

Parameters:

trigger_type (["update", "mask_toggle"]) – The type of action to trigger. ‘update’: Full preview update. ‘mask_toggle’: toggle mask on and off

clear(trigger_type: Literal['update', 'mask_toggle'] | None = None) None

Remove the trigger file from the cache folder.

Parameters:

trigger_type ([“update”, “mask_toggle”, None], optional) – The trigger to clear. ‘update’: Full preview update. ‘mask_toggle’: toggle mask on and off. None - clear all triggers. Default: None

Return type:

None

set(trigger_type: Literal['update', 'mask_toggle'])

Place the trigger file into the cache folder

Parameters:

trigger_type (["update", "mask_toggle"]) – The type of action to trigger. ‘update’: Full preview update. ‘mask_toggle’: toggle mask on and off