Polish types

This commit is contained in:
henryruhs
2025-06-16 12:27:15 +02:00
parent 505432cfde
commit 6340d67c96
2 changed files with 10 additions and 9 deletions

View File

@@ -250,6 +250,10 @@ StateKey = Literal\
'source_pattern', 'source_pattern',
'target_pattern', 'target_pattern',
'output_pattern', 'output_pattern',
'download_providers',
'download_scope',
'benchmark_resolutions',
'benchmark_cycles',
'face_detector_model', 'face_detector_model',
'face_detector_size', 'face_detector_size',
'face_detector_angles', 'face_detector_angles',
@@ -294,10 +298,6 @@ StateKey = Literal\
'execution_providers', 'execution_providers',
'execution_thread_count', 'execution_thread_count',
'execution_queue_count', 'execution_queue_count',
'download_providers',
'benchmark_resolutions',
'benchmark_cycles',
'download_scope',
'video_memory_strategy', 'video_memory_strategy',
'system_memory_limit', 'system_memory_limit',
'log_level', 'log_level',
@@ -318,6 +318,10 @@ State = TypedDict('State',
'source_pattern' : str, 'source_pattern' : str,
'target_pattern' : str, 'target_pattern' : str,
'output_pattern' : str, 'output_pattern' : str,
'download_providers': List[DownloadProvider],
'download_scope': DownloadScope,
'benchmark_resolutions': List[BenchmarkResolution],
'benchmark_cycles': int,
'face_detector_model' : FaceDetectorModel, 'face_detector_model' : FaceDetectorModel,
'face_detector_size' : str, 'face_detector_size' : str,
'face_detector_angles' : List[Angle], 'face_detector_angles' : List[Angle],
@@ -362,10 +366,6 @@ State = TypedDict('State',
'execution_providers' : List[ExecutionProvider], 'execution_providers' : List[ExecutionProvider],
'execution_thread_count' : int, 'execution_thread_count' : int,
'execution_queue_count' : int, 'execution_queue_count' : int,
'download_providers' : List[DownloadProvider],
'benchmark_resolutions' : List[str],
'benchmark_cycles' : int,
'download_scope' : DownloadScope,
'video_memory_strategy' : VideoMemoryStrategy, 'video_memory_strategy' : VideoMemoryStrategy,
'system_memory_limit' : int, 'system_memory_limit' : int,
'log_level' : LogLevel, 'log_level' : LogLevel,

View File

@@ -3,6 +3,7 @@ from typing import Any, Generator, List, Optional
import gradio import gradio
from facefusion import benchmarker, state_manager, wording from facefusion import benchmarker, state_manager, wording
from facefusion.types import BenchmarkResolution
from facefusion.uis.core import get_ui_component from facefusion.uis.core import get_ui_component
BENCHMARK_BENCHMARKS_DATAFRAME : Optional[gradio.Dataframe] = None BENCHMARK_BENCHMARKS_DATAFRAME : Optional[gradio.Dataframe] = None
@@ -49,7 +50,7 @@ def listen() -> None:
BENCHMARK_START_BUTTON.click(start, inputs = [ benchmark_resolutions_checkbox_group, benchmark_cycles_slider ], outputs = BENCHMARK_BENCHMARKS_DATAFRAME) BENCHMARK_START_BUTTON.click(start, inputs = [ benchmark_resolutions_checkbox_group, benchmark_cycles_slider ], outputs = BENCHMARK_BENCHMARKS_DATAFRAME)
def start(benchmark_resolutions : List[str], benchmark_cycles : int) -> Generator[List[Any], None, None]: def start(benchmark_resolutions : List[BenchmarkResolution], benchmark_cycles : int) -> Generator[List[Any], None, None]:
state_manager.set_item('benchmark_resolutions', benchmark_resolutions) state_manager.set_item('benchmark_resolutions', benchmark_resolutions)
state_manager.set_item('benchmark_cycles', benchmark_cycles) state_manager.set_item('benchmark_cycles', benchmark_cycles)
state_manager.sync_item('execution_providers') state_manager.sync_item('execution_providers')