Complete Typing

This commit is contained in:
henryruhs 2024-10-02 10:19:16 +02:00
parent ad94d27fc1
commit 564e504d5e
3 changed files with 24 additions and 7 deletions

View File

@ -90,24 +90,41 @@ ProcessorStateKey = Literal\
'face_swapper_model',
'face_swapper_pixel_boost',
'frame_colorizer_model',
'frame_colorizer_blend',
'frame_colorizer_size',
'frame_colorizer_blend',
'frame_enhancer_model',
'frame_enhancer_blend',
'lip_syncer_model'
]
ProcessorState = TypedDict('ProcessorState',
{
'age_modifier_model': AgeModifierModel,
'age_modifier_direction': int,
'age_modifier_model' : AgeModifierModel,
'age_modifier_direction' : int,
'expression_restorer_model' : ExpressionRestorerModel,
'expression_restorer_factor' : int,
'face_debugger_items' : List[FaceDebuggerItem],
'face_editor_model' : FaceEditorModel,
'face_editor_eyebrow_direction' : float,
'face_editor_eye_gaze_horizontal' : float,
'face_editor_eye_gaze_vertical' : float,
'face_editor_eye_open_ratio' : float,
'face_editor_lip_open_ratio' : float,
'face_editor_mouth_grim' : float,
'face_editor_mouth_pout' : float,
'face_editor_mouth_purse' : float,
'face_editor_mouth_smile' : float,
'face_editor_mouth_position_horizontal' : float,
'face_editor_mouth_position_vertical' : float,
'face_editor_head_pitch' : float,
'face_editor_head_yaw' : float,
'face_editor_head_roll' : float,
'face_enhancer_model' : FaceEnhancerModel,
'face_enhancer_blend' : int,
'face_swapper_model' : FaceSwapperModel,
'face_swapper_pixel_boost' : str,
'frame_colorizer_model' : FrameColorizerModel,
'frame_colorizer_blend' : int,
'frame_colorizer_size' : str,
'frame_colorizer_blend' : int,
'frame_enhancer_model' : FrameEnhancerModel,
'frame_enhancer_blend' : int,
'lip_syncer_model' : LipSyncerModel

View File

@ -259,7 +259,7 @@ State = TypedDict('State',
'face_landmarker_score' : Score,
'face_selector_mode' : FaceSelectorMode,
'face_selector_order' : FaceSelectorOrder,
'face_selector_race': Race,
'face_selector_race' : Race,
'face_selector_gender' : Gender,
'face_selector_age_start' : int,
'face_selector_age_end' : int,
@ -291,7 +291,7 @@ State = TypedDict('State',
'execution_providers' : List[ExecutionProviderKey],
'execution_thread_count' : int,
'execution_queue_count' : int,
'video_memory_strategy': VideoMemoryStrategy,
'video_memory_strategy' : VideoMemoryStrategy,
'system_memory_limit' : int,
'skip_download' : bool,
'log_level' : LogLevel,

View File

@ -21,13 +21,13 @@ def render() -> None:
has_source_audio = has_audio(state_manager.get_item('source_paths'))
has_source_image = has_image(state_manager.get_item('source_paths'))
SOURCE_FILE = gradio.File(
label = wording.get('uis.source_file'),
file_count = 'multiple',
file_types =
[
'audio',
'image'
],
label = wording.get('uis.source_file'),
value = state_manager.get_item('source_paths') if has_source_audio or has_source_image else None
)
source_file_names = [ source_file_value.get('path') for source_file_value in SOURCE_FILE.value ] if SOURCE_FILE.value else None