File size: 635 Bytes
3284138 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | from functools import partial
from facefusion import process_manager
from facefusion.types import ErrorCode
from facefusion.workflows.core import clear, setup
from facefusion.workflows.to_image import analyse_image, finalize_image, prepare_image, process_image
def process(start_time : float) -> ErrorCode:
tasks =\
[
analyse_image,
clear,
setup,
prepare_image,
process_image,
partial(finalize_image, start_time),
clear
]
process_manager.start()
for task in tasks:
error_code = task() #type:ignore[operator]
if error_code > 0:
process_manager.end()
return error_code
process_manager.end()
return 0
|