diff --git a/facefusion/choices.py b/facefusion/choices.py index c3b98aa4..3eb245d9 100755 --- a/facefusion/choices.py +++ b/facefusion/choices.py @@ -45,7 +45,7 @@ face_mask_regions : List[FaceMaskRegion] = list(face_mask_region_set.keys()) voice_extractor_models : List[VoiceExtractorModel] = [ 'kim_vocal_1', 'kim_vocal_2', 'uvr_mdxnet' ] -workflows : List[WorkFlow] = [ 'auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frame' ] +workflows : List[WorkFlow] = [ 'auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frames' ] audio_type_set : AudioTypeSet =\ { diff --git a/facefusion/core.py b/facefusion/core.py index 40c8214b..014c2210 100755 --- a/facefusion/core.py +++ b/facefusion/core.py @@ -20,7 +20,7 @@ from facefusion.processors.core import get_processors_modules from facefusion.program import create_program from facefusion.program_helper import validate_args from facefusion.types import Args, ErrorCode, WorkFlow -from facefusion.workflows import audio_to_image, image_to_image, image_to_video, image_to_video_as_sequence +from facefusion.workflows import audio_to_image, image_to_image, image_to_video, image_to_video_as_frames def cli() -> None: @@ -342,8 +342,8 @@ def conditional_process() -> ErrorCode: return image_to_image.process(start_time) if state_manager.get_item('workflow') == 'image-to-video': return image_to_video.process(start_time) - if state_manager.get_item('workflow') == 'image-to-video:frame': - return image_to_video_as_sequence.process(start_time) + if state_manager.get_item('workflow') == 'image-to-video:frames': + return image_to_video_as_frames.process(start_time) return 0 @@ -352,7 +352,7 @@ def detect_workflow() -> WorkFlow: if has_video([ state_manager.get_item('target_path') ]): if get_file_extension(state_manager.get_item('output_path')): return 'image-to-video' - return 'image-to-video:frame' + return 'image-to-video:frames' if has_audio(state_manager.get_item('source_paths')) and has_image([ state_manager.get_item('target_path') ]): return 'audio-to-image:video' diff --git a/facefusion/locales.py b/facefusion/locales.py index 4000dff3..9f23050c 100644 --- a/facefusion/locales.py +++ b/facefusion/locales.py @@ -40,8 +40,8 @@ LOCALES : Locales =\ 'processing_stopped': 'processing stopped', 'processing_image_succeeded': 'processing to image succeeded in {seconds} seconds', 'processing_image_failed': 'processing to image failed', - 'processing_sequence_succeeded': 'processing to sequence succeeded in {seconds} seconds', - 'processing_sequence_failed': 'processing to sequence failed', + 'processing_frames_succeeded': 'processing to frames succeeded in {seconds} seconds', + 'processing_frames_failed': 'processing to frames failed', 'processing_video_succeeded': 'processing to video succeeded in {seconds} seconds', 'processing_video_failed': 'processing to video failed', 'choose_image_source': 'choose an image for the source', diff --git a/facefusion/types.py b/facefusion/types.py index 3a2aa58c..109c2cd0 100755 --- a/facefusion/types.py +++ b/facefusion/types.py @@ -55,7 +55,7 @@ Language = Literal['en'] Locales : TypeAlias = Dict[Language, Dict[str, Any]] LocalePoolSet : TypeAlias = Dict[str, Locales] -WorkFlow = Literal['auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frame'] +WorkFlow = Literal['auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frames'] VideoCaptureSet : TypeAlias = Dict[str, cv2.VideoCapture] VideoWriterSet : TypeAlias = Dict[str, cv2.VideoWriter] diff --git a/facefusion/workflows/core.py b/facefusion/workflows/core.py index 109290f4..f173cdce 100644 --- a/facefusion/workflows/core.py +++ b/facefusion/workflows/core.py @@ -69,7 +69,7 @@ def conditional_get_source_voice_frame(frame_number: int) -> AudioFrame: def conditional_get_reference_vision_frame() -> VisionFrame: - if state_manager.get_item('workflow') in [ 'image-to-video', 'image-to-video:frame' ]: + if state_manager.get_item('workflow') in [ 'image-to-video', 'image-to-video:frames' ]: return read_static_video_frame(state_manager.get_item('target_path'), state_manager.get_item('reference_frame_number')) return read_static_image(state_manager.get_item('target_path')) diff --git a/facefusion/workflows/image_to_video_as_sequence.py b/facefusion/workflows/image_to_video_as_frames.py similarity index 83% rename from facefusion/workflows/image_to_video_as_sequence.py rename to facefusion/workflows/image_to_video_as_frames.py index 018ae603..f47b9ead 100644 --- a/facefusion/workflows/image_to_video_as_sequence.py +++ b/facefusion/workflows/image_to_video_as_frames.py @@ -19,7 +19,7 @@ def process(start_time : float) -> ErrorCode: create_temp_frames, process_frames, copy_temp_frames, - partial(finalize_sequence, start_time), + partial(finalize_frames, start_time), clear ] @@ -45,10 +45,10 @@ def copy_temp_frames() -> ErrorCode: return 0 -def finalize_sequence(start_time : float) -> ErrorCode: +def finalize_frames(start_time : float) -> ErrorCode: if are_images(resolve_file_paths(state_manager.get_item('output_path'))): - logger.info(translator.get('processing_sequence_succeeded').format(seconds = calculate_end_time(start_time)), __name__) + logger.info(translator.get('processing_frames_succeeded').format(seconds = calculate_end_time(start_time)), __name__) else: - logger.error(translator.get('processing_sequence_failed'), __name__) + logger.error(translator.get('processing_frames_failed'), __name__) return 1 return 0 diff --git a/tests/test_cli_age_modifier.py b/tests/test_cli_age_modifier.py index 8a5bbea6..1af9675d 100644 --- a/tests/test_cli_age_modifier.py +++ b/tests/test_cli_age_modifier.py @@ -38,8 +38,8 @@ def test_modify_age_to_video() -> None: assert is_test_output_file('test-age-face-to-video.mp4') is True -def test_modify_age_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'age_modifier', '--age-modifier-direction', '100', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-age-face-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_modify_age_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'age_modifier', '--age-modifier-direction', '100', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-age-face-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-age-face-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-age-face-to-video-as-frames')) is True diff --git a/tests/test_cli_background_remover.py b/tests/test_cli_background_remover.py index 94d8428e..cbd7e026 100644 --- a/tests/test_cli_background_remover.py +++ b/tests/test_cli_background_remover.py @@ -39,8 +39,8 @@ def test_remove_background_to_video() -> None: assert is_test_output_file('test-remove-background-to-video.mp4') is True -def test_remove_background_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'background_remover', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-remove-background-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_remove_background_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'background_remover', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-remove-background-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-remove-background-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-remove-background-to-video-as-frames')) is True diff --git a/tests/test_cli_expression_restorer.py b/tests/test_cli_expression_restorer.py index e6372a68..a362010a 100644 --- a/tests/test_cli_expression_restorer.py +++ b/tests/test_cli_expression_restorer.py @@ -38,8 +38,8 @@ def test_restore_expression_to_video() -> None: assert is_test_output_file('test-restore-expression-to-video.mp4') is True -def test_restore_expression_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'expression_restorer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-restore-expression-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_restore_expression_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'expression_restorer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-restore-expression-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-restore-expression-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-restore-expression-to-video-as-frames')) is True diff --git a/tests/test_cli_face_debugger.py b/tests/test_cli_face_debugger.py index c861ccda..cf42a08c 100644 --- a/tests/test_cli_face_debugger.py +++ b/tests/test_cli_face_debugger.py @@ -39,8 +39,8 @@ def test_debug_face_to_video() -> None: assert is_test_output_file('test-debug-face-to-video.mp4') is True -def test_debug_face_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_debugger', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-debug-face-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_debug_face_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_debugger', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-debug-face-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-debug-face-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-debug-face-to-video-as-frames')) is True diff --git a/tests/test_cli_face_editor.py b/tests/test_cli_face_editor.py index 918eb1b1..90535f77 100644 --- a/tests/test_cli_face_editor.py +++ b/tests/test_cli_face_editor.py @@ -39,8 +39,8 @@ def test_edit_face_to_video() -> None: assert is_test_output_file('test-edit-face-to-video.mp4') is True -def test_edit_face_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_editor', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-edit-face-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_edit_face_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_editor', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-edit-face-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-edit-face-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-edit-face-to-video-as-frames')) is True diff --git a/tests/test_cli_face_enhancer.py b/tests/test_cli_face_enhancer.py index 652b929c..e42935c4 100644 --- a/tests/test_cli_face_enhancer.py +++ b/tests/test_cli_face_enhancer.py @@ -39,8 +39,8 @@ def test_enhance_face_to_video() -> None: assert is_test_output_file('test-enhance-face-to-video.mp4') is True -def test_enhance_face_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_enhancer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-enhance-face-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_enhance_face_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_enhancer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-enhance-face-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-enhance-face-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-enhance-face-to-video-as-frames')) is True diff --git a/tests/test_cli_face_swapper.py b/tests/test_cli_face_swapper.py index b5bfc742..2537a956 100644 --- a/tests/test_cli_face_swapper.py +++ b/tests/test_cli_face_swapper.py @@ -39,8 +39,8 @@ def test_swap_face_to_video() -> None: assert is_test_output_file('test-swap-face-to-video.mp4') is True -def test_swap_face_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_swapper', '-s', get_test_example_file('source.jpg'), '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-swap-face-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_swap_face_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'face_swapper', '-s', get_test_example_file('source.jpg'), '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-swap-face-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-swap-face-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-swap-face-to-video-as-frames')) is True diff --git a/tests/test_cli_frame_colorizer.py b/tests/test_cli_frame_colorizer.py index 0a87a10e..ea93a7b6 100644 --- a/tests/test_cli_frame_colorizer.py +++ b/tests/test_cli_frame_colorizer.py @@ -40,8 +40,8 @@ def test_colorize_frame_to_video() -> None: assert is_test_output_file('test-colorize-frame-to-video.mp4') is True -def test_colorize_frame_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'frame_colorizer', '-t', get_test_example_file('target-240p-0sat.mp4'), '-o', get_test_output_path('test-colorize-frame-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_colorize_frame_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'frame_colorizer', '-t', get_test_example_file('target-240p-0sat.mp4'), '-o', get_test_output_path('test-colorize-frame-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-colorize-frame-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-colorize-frame-to-video-as-frames')) is True diff --git a/tests/test_cli_frame_enhancer.py b/tests/test_cli_frame_enhancer.py index 8a7b3ef6..dba68704 100644 --- a/tests/test_cli_frame_enhancer.py +++ b/tests/test_cli_frame_enhancer.py @@ -39,8 +39,8 @@ def test_enhance_frame_to_video() -> None: assert is_test_output_file('test-enhance-frame-to-video.mp4') is True -def test_enhance_frame_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'frame_enhancer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-enhance-frame-to-video-as-sequence'), '--trim-frame-end', '1' ] +def test_enhance_frame_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'frame_enhancer', '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test-enhance-frame-to-video-as-frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test-enhance-frame-to-video-as-sequence')) is True + assert is_test_output_sequence(get_test_output_path('test-enhance-frame-to-video-as-frames')) is True diff --git a/tests/test_cli_lip_syncer.py b/tests/test_cli_lip_syncer.py index b6ff196d..e1d27adb 100644 --- a/tests/test_cli_lip_syncer.py +++ b/tests/test_cli_lip_syncer.py @@ -40,8 +40,8 @@ def test_sync_lip_to_video() -> None: assert is_test_output_file('test_sync_lip_to_video.mp4') is True -def test_sync_lip_to_video_as_sequence() -> None: - commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frame', '--jobs-path', get_test_jobs_directory(), '--processors', 'lip_syncer', '-s', get_test_example_file('source.mp3'), '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test_sync_lip_to_video_as_sequence'), '--trim-frame-end', '1' ] +def test_sync_lip_to_video_as_frames() -> None: + commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video:frames', '--jobs-path', get_test_jobs_directory(), '--processors', 'lip_syncer', '-s', get_test_example_file('source.mp3'), '-t', get_test_example_file('target-240p.mp4'), '-o', get_test_output_path('test_sync_lip_to_video_as_frames'), '--trim-frame-end', '1' ] assert subprocess.run(commands).returncode == 0 - assert is_test_output_sequence(get_test_output_path('test_sync_lip_to_video_as_sequence')) is True + assert is_test_output_sequence(get_test_output_path('test_sync_lip_to_video_as_frames')) is True