From 787cb893a775b132c351c43c14805b4dd316207e Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 22 Jul 2026 13:17:01 +0200 Subject: [PATCH] Add workflow mode dropdown to the UI, drop the empty common options Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01M8GqDtmNT89ei6EJrQKWXx --- facefusion/locales.py | 2 +- facefusion/metadata.py | 2 +- facefusion/uis/choices.py | 1 - facefusion/uis/components/common_options.py | 28 --------------------- facefusion/uis/components/workflow.py | 27 ++++++++++++++++++++ facefusion/uis/layouts/default.py | 8 +++--- 6 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 facefusion/uis/components/common_options.py create mode 100644 facefusion/uis/components/workflow.py diff --git a/facefusion/locales.py b/facefusion/locales.py index ccdbd81b..835a86d0 100644 --- a/facefusion/locales.py +++ b/facefusion/locales.py @@ -201,9 +201,9 @@ LOCALES : Locales =\ 'benchmark_cycle_count_slider': 'BENCHMARK CYCLE COUNT', 'benchmark_resolutions_checkbox_group': 'BENCHMARK RESOLUTIONS', 'clear_button': 'CLEAR', - 'common_options_checkbox_group': 'OPTIONS', 'download_providers_checkbox_group': 'DOWNLOAD PROVIDERS', 'execution_providers_checkbox_group': 'EXECUTION PROVIDERS', + 'workflow_mode_dropdown': 'WORKFLOW MODE', 'execution_thread_count_slider': 'EXECUTION THREAD COUNT', 'face_detector_angles_checkbox_group': 'FACE DETECTOR ANGLES', 'face_detector_model_dropdown': 'FACE DETECTOR MODEL', diff --git a/facefusion/metadata.py b/facefusion/metadata.py index 13086cc6..fd9083dc 100644 --- a/facefusion/metadata.py +++ b/facefusion/metadata.py @@ -4,7 +4,7 @@ METADATA =\ { 'name': 'FaceFusion', 'description': 'Industry leading face manipulation platform', - 'version': '3.7.1', + 'version': '3.8.0', 'license': 'OpenRAIL-AS', 'author': 'Henry Ruhs', 'url': 'https://facefusion.io' diff --git a/facefusion/uis/choices.py b/facefusion/uis/choices.py index 4f2113b3..cd586619 100644 --- a/facefusion/uis/choices.py +++ b/facefusion/uis/choices.py @@ -6,7 +6,6 @@ from facefusion.uis.types import JobManagerAction, JobRunnerAction, PreviewMode job_manager_actions : List[JobManagerAction] = [ 'job-create', 'job-submit', 'job-delete', 'job-add-step', 'job-remix-step', 'job-insert-step', 'job-remove-step' ] job_runner_actions : List[JobRunnerAction] = [ 'job-run', 'job-run-all', 'job-retry', 'job-retry-all' ] -common_options : List[str] = [] preview_modes : List[PreviewMode] = [ 'default', 'frame-by-frame', 'face-by-face' ] preview_resolutions : List[str] = [ '512x512', '768x768', '1024x1024' ] diff --git a/facefusion/uis/components/common_options.py b/facefusion/uis/components/common_options.py deleted file mode 100644 index 3d099196..00000000 --- a/facefusion/uis/components/common_options.py +++ /dev/null @@ -1,28 +0,0 @@ -from typing import List, Optional - -import gradio - -from facefusion import translator -from facefusion.uis import choices as uis_choices - -COMMON_OPTIONS_CHECKBOX_GROUP : Optional[gradio.Checkboxgroup] = None - - -def render() -> None: - global COMMON_OPTIONS_CHECKBOX_GROUP - - common_options = [] - - COMMON_OPTIONS_CHECKBOX_GROUP = gradio.Checkboxgroup( - label = translator.get('uis.common_options_checkbox_group'), - choices = uis_choices.common_options, - value = common_options - ) - - -def listen() -> None: - COMMON_OPTIONS_CHECKBOX_GROUP.change(update, inputs = COMMON_OPTIONS_CHECKBOX_GROUP) - - -def update(common_options : List[str]) -> None: - pass diff --git a/facefusion/uis/components/workflow.py b/facefusion/uis/components/workflow.py new file mode 100644 index 00000000..a9c35e1f --- /dev/null +++ b/facefusion/uis/components/workflow.py @@ -0,0 +1,27 @@ +from typing import Optional + +import gradio + +import facefusion.choices +from facefusion import state_manager, translator +from facefusion.types import WorkflowMode + +WORKFLOW_MODE_DROPDOWN : Optional[gradio.Dropdown] = None + + +def render() -> None: + global WORKFLOW_MODE_DROPDOWN + + WORKFLOW_MODE_DROPDOWN = gradio.Dropdown( + label = translator.get('uis.workflow_mode_dropdown'), + choices = facefusion.choices.workflow_modes, + value = state_manager.get_item('workflow_mode') + ) + + +def listen() -> None: + WORKFLOW_MODE_DROPDOWN.change(update_workflow_mode, inputs = WORKFLOW_MODE_DROPDOWN) + + +def update_workflow_mode(workflow_mode : WorkflowMode) -> None: + state_manager.set_item('workflow_mode', workflow_mode) diff --git a/facefusion/uis/layouts/default.py b/facefusion/uis/layouts/default.py index cf0aeace..1b34d14f 100755 --- a/facefusion/uis/layouts/default.py +++ b/facefusion/uis/layouts/default.py @@ -1,7 +1,7 @@ import gradio from facefusion import state_manager -from facefusion.uis.components import about, age_modifier_options, background_remover_options, common_options, deep_swapper_options, download, execution, execution_thread_count, expression_restorer_options, face_debugger_options, face_detector, face_editor_options, face_enhancer_options, face_landmarker, face_masker, face_selector, face_swapper_options, face_tracker, frame_colorizer_options, frame_enhancer_options, instant_runner, job_manager, job_runner, lip_syncer_options, memory, output, output_options, preview, preview_options, processors, source, target, temp_frame, terminal, trim_frame, ui_workflow, voice_extractor +from facefusion.uis.components import about, age_modifier_options, background_remover_options, deep_swapper_options, download, execution, execution_thread_count, expression_restorer_options, face_debugger_options, face_detector, face_editor_options, face_enhancer_options, face_landmarker, face_masker, face_selector, face_swapper_options, face_tracker, frame_colorizer_options, frame_enhancer_options, instant_runner, job_manager, job_runner, lip_syncer_options, memory, output, output_options, preview, preview_options, processors, source, target, temp_frame, terminal, trim_frame, ui_workflow, voice_extractor, workflow def pre_check() -> bool: @@ -40,6 +40,8 @@ def render() -> gradio.Blocks: lip_syncer_options.render() with gradio.Blocks(): voice_extractor.render() + with gradio.Blocks(): + workflow.render() with gradio.Blocks(): execution.render() execution_thread_count.render() @@ -81,8 +83,6 @@ def render() -> gradio.Blocks: face_detector.render() with gradio.Blocks(): face_landmarker.render() - with gradio.Blocks(): - common_options.render() return layout @@ -99,6 +99,7 @@ def listen() -> None: frame_colorizer_options.listen() frame_enhancer_options.listen() lip_syncer_options.listen() + workflow.listen() execution.listen() execution_thread_count.listen() download.listen() @@ -121,7 +122,6 @@ def listen() -> None: face_detector.listen() face_landmarker.listen() voice_extractor.listen() - common_options.listen() def run(ui : gradio.Blocks) -> None: