workflows rename

This commit is contained in:
harisreedhar
2025-12-17 19:24:10 +05:30
committed by henryruhs
parent 23f865640a
commit 0773403d4b
24 changed files with 30 additions and 30 deletions
+1 -1
View File
@@ -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', 'image-to-image', 'image-to-video', 'image-to-video-as-sequence' ]
workflows : List[WorkFlow] = [ 'auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frame' ]
audio_type_set : AudioTypeSet =\
{
+4 -4
View File
@@ -336,13 +336,13 @@ def conditional_process() -> ErrorCode:
if not processor_module.pre_process('output'):
return 2
if state_manager.get_item('workflow') == 'audio-to-image':
if state_manager.get_item('workflow') == 'audio-to-image:video':
return audio_to_image.process(start_time)
if state_manager.get_item('workflow') == 'image-to-image':
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-as-sequence':
if state_manager.get_item('workflow') == 'image-to-video:frame':
return image_to_video_as_sequence.process(start_time)
return 0
@@ -352,9 +352,9 @@ 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-as-sequence'
return 'image-to-video:frame'
if has_audio(state_manager.get_item('source_paths')) and has_image([ state_manager.get_item('target_path') ]):
return 'audio-to-image'
return 'audio-to-image:video'
return 'image-to-image'
@@ -108,7 +108,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -441,7 +441,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -299,7 +299,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -125,7 +125,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -46,7 +46,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -176,7 +176,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -315,7 +315,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -551,7 +551,7 @@ def pre_process(mode : ProcessMode) -> bool:
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -207,7 +207,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
@@ -594,7 +594,7 @@ def pre_process(mode : ProcessMode) -> bool:
if mode in [ 'output', 'preview' ] and not is_image(state_manager.get_item('target_path')) and not is_video(state_manager.get_item('target_path')):
logger.error(translator.get('choose_image_or_video_target') + translator.get('exclamation_mark'), __name__)
return False
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-image', 'image-to-video' ]:
if mode == 'output' and not in_directory(state_manager.get_item('output_path')):
logger.error(translator.get('specify_image_or_video_output') + translator.get('exclamation_mark'), __name__)
return False
+1 -1
View File
@@ -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', 'image-to-image', 'image-to-video', 'image-to-video-as-sequence']
WorkFlow = Literal['auto', 'audio-to-image:video', 'image-to-image', 'image-to-video', 'image-to-video:frame']
VideoCaptureSet : TypeAlias = Dict[str, cv2.VideoCapture]
VideoWriterSet : TypeAlias = Dict[str, cv2.VideoWriter]
+3 -3
View File
@@ -39,7 +39,7 @@ def analyse_image() -> ErrorCode:
def conditional_get_source_audio_frame(frame_number : int) -> AudioFrame:
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-video' ]:
source_audio_path = get_first(filter_audio_paths(state_manager.get_item('source_paths')))
output_video_fps = state_manager.get_item('output_video_fps')
@@ -54,7 +54,7 @@ def conditional_get_source_audio_frame(frame_number : int) -> AudioFrame:
def conditional_get_source_voice_frame(frame_number: int) -> AudioFrame:
if state_manager.get_item('workflow') in [ 'audio-to-image', 'image-to-video' ]:
if state_manager.get_item('workflow') in [ 'audio-to-image:video', 'image-to-video' ]:
source_audio_path = get_first(filter_audio_paths(state_manager.get_item('source_paths')))
output_video_fps = state_manager.get_item('output_video_fps')
@@ -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-as-sequence' ]:
if state_manager.get_item('workflow') in [ 'image-to-video', 'image-to-video:frame' ]:
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'))
+1 -1
View File
@@ -39,7 +39,7 @@ def test_modify_age_to_video() -> None:
def test_modify_age_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-age-face-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_remove_background_to_video() -> None:
def test_remove_background_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-remove-background-to-video-as-sequence')) is True
+1 -1
View File
@@ -39,7 +39,7 @@ def test_restore_expression_to_video() -> None:
def test_restore_expression_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-restore-expression-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_debug_face_to_video() -> None:
def test_debug_face_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-debug-face-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_edit_face_to_video() -> None:
def test_edit_face_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-edit-face-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_enhance_face_to_video() -> None:
def test_enhance_face_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-enhance-face-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_swap_face_to_video() -> None:
def test_swap_face_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-swap-face-to-video-as-sequence')) is True
+1 -1
View File
@@ -41,7 +41,7 @@ def test_colorize_frame_to_video() -> None:
def test_colorize_frame_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-colorize-frame-to-video-as-sequence')) is True
+1 -1
View File
@@ -40,7 +40,7 @@ def test_enhance_frame_to_video() -> None:
def test_enhance_frame_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test-enhance-frame-to-video-as-sequence')) is True
+2 -2
View File
@@ -27,7 +27,7 @@ def before_each() -> None:
def test_sync_lip_to_image() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'audio-to-image', '--jobs-path', get_test_jobs_directory(), '--processors', 'lip_syncer', '-s', get_test_example_file('source.mp3'), '-t', get_test_example_file('target-240p.jpg'), '-o', get_test_output_path('test_sync_lip_to_image.mp4') ]
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'audio-to-image:video', '--jobs-path', get_test_jobs_directory(), '--processors', 'lip_syncer', '-s', get_test_example_file('source.mp3'), '-t', get_test_example_file('target-240p.jpg'), '-o', get_test_output_path('test_sync_lip_to_image.mp4') ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_file('test_sync_lip_to_image.mp4') is True
@@ -41,7 +41,7 @@ def test_sync_lip_to_video() -> None:
def test_sync_lip_to_video_as_sequence() -> None:
commands = [ sys.executable, 'facefusion.py', 'run', '--workflow', 'image-to-video-as-sequence', '--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' ]
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' ]
assert subprocess.run(commands).returncode == 0
assert is_test_output_sequence(get_test_output_path('test_sync_lip_to_video_as_sequence')) is True