This commit is contained in:
harisreedhar 2024-11-08 14:03:05 +05:30
parent c7a85e327f
commit ccbb797450
10 changed files with 41 additions and 1 deletions

View File

@ -24,6 +24,7 @@ from facefusion.thread_helper import thread_semaphore
from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import match_frame_color, read_image, read_static_image, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -25,6 +25,7 @@ from facefusion.thread_helper import conditional_thread_semaphore, thread_semaph
from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import get_video_frame, read_image, read_static_image, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -24,6 +24,7 @@ from facefusion.thread_helper import conditional_thread_semaphore, thread_semaph
from facefusion.typing import ApplyStateItem, Args, Face, FaceLandmark68, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import read_image, read_static_image, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -23,6 +23,7 @@ from facefusion.thread_helper import thread_semaphore
from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import read_image, read_static_image, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -25,6 +25,7 @@ from facefusion.thread_helper import conditional_thread_semaphore
from facefusion.typing import ApplyStateItem, Args, Embedding, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import read_image, read_static_image, read_static_images, unpack_resolution, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -18,6 +18,7 @@ from facefusion.thread_helper import thread_semaphore
from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import read_image, read_static_image, unpack_resolution, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -18,6 +18,7 @@ from facefusion.thread_helper import conditional_thread_semaphore
from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ModelOptions, ModelSet, ProcessMode, QueuePayload, UpdateProgress, VisionFrame
from facefusion.vision import create_tile_frames, merge_tile_frames, read_image, read_static_image, write_image
def create_model_set() -> ModelSet:
return\
{

View File

@ -0,0 +1,29 @@
from typing import List, Optional
import gradio
import facefusion.choices
from facefusion import state_manager, wording
from facefusion.typing import DownloadProvider
DOWNLOAD_PROVIDERS_CHECKBOX_GROUP : Optional[gradio.CheckboxGroup] = None
def render() -> None:
global DOWNLOAD_PROVIDERS_CHECKBOX_GROUP
DOWNLOAD_PROVIDERS_CHECKBOX_GROUP = gradio.CheckboxGroup(
label = wording.get('uis.download_providers_checkbox_group'),
choices = facefusion.choices.download_providers,
value = state_manager.get_item('download_providers')
)
def listen() -> None:
DOWNLOAD_PROVIDERS_CHECKBOX_GROUP.change(update_download_providers, inputs = DOWNLOAD_PROVIDERS_CHECKBOX_GROUP, outputs = DOWNLOAD_PROVIDERS_CHECKBOX_GROUP)
def update_download_providers(download_providers : List[DownloadProvider]) -> gradio.CheckboxGroup:
download_providers = download_providers or facefusion.choices.download_providers
state_manager.set_item('download_providers', download_providers)
return gradio.CheckboxGroup(value = state_manager.get_item('download_providers'))

View File

@ -1,7 +1,7 @@
import gradio
from facefusion import state_manager
from facefusion.uis.components import about, age_modifier_options, common_options, deep_swapper_options, execution, execution_queue_count, 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, frame_colorizer_options, frame_enhancer_options, instant_runner, job_manager, job_runner, lip_syncer_options, memory, output, output_options, preview, processors, source, target, temp_frame, terminal, trim_frame, ui_workflow
from facefusion.uis.components import about, age_modifier_options, common_options, deep_swapper_options, download, execution, execution_queue_count, 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, frame_colorizer_options, frame_enhancer_options, instant_runner, job_manager, job_runner, lip_syncer_options, memory, output, output_options, preview, processors, source, target, temp_frame, terminal, trim_frame, ui_workflow
def pre_check() -> bool:
@ -73,6 +73,8 @@ def render() -> gradio.Blocks:
face_detector.render()
with gradio.Blocks():
face_landmarker.render()
with gradio.Blocks():
download.render()
with gradio.Blocks():
common_options.render()
return layout
@ -109,6 +111,7 @@ def listen() -> None:
face_masker.listen()
face_detector.listen()
face_landmarker.listen()
download.listen()
common_options.listen()

View File

@ -229,6 +229,7 @@ WORDING : Dict[str, Any] =\
'benchmark_runs_checkbox_group': 'BENCHMARK RUNS',
'clear_button': 'CLEAR',
'common_options_checkbox_group': 'OPTIONS',
'download_providers_checkbox_group': 'DOWNLOAD PROVIDERS',
'deep_swapper_model_dropdown': 'DEEP SWAPPER MODEL',
'execution_providers_checkbox_group': 'EXECUTION PROVIDERS',
'execution_queue_count_slider': 'EXECUTION QUEUE COUNT',