mirror of
https://github.com/facefusion/facefusion.git
synced 2026-07-27 12:30:55 +02:00
Add workflow mode dropdown to the UI, drop the empty common options
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M8GqDtmNT89ei6EJrQKWXx
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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' ]
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user