diff --git a/roop/uis/__components__/face_selector.py b/roop/uis/__components__/face_selector.py index 82d26db78..155c1333a 100644 --- a/roop/uis/__components__/face_selector.py +++ b/roop/uis/__components__/face_selector.py @@ -96,6 +96,9 @@ def listen() -> None: FACE_ANALYSER_DIRECTION_DROPDOWN.select(lambda value: update_dropdown('face_analyser_direction', value), inputs=FACE_ANALYSER_DIRECTION_DROPDOWN, outputs=FACE_ANALYSER_DIRECTION_DROPDOWN) FACE_ANALYSER_AGE_DROPDOWN.select(lambda value: update_dropdown('face_analyser_age', value), inputs=FACE_ANALYSER_AGE_DROPDOWN, outputs=FACE_ANALYSER_AGE_DROPDOWN) FACE_ANALYSER_GENDER_DROPDOWN.select(lambda value: update_dropdown('face_analyser_gender', value), inputs=FACE_ANALYSER_GENDER_DROPDOWN, outputs=FACE_ANALYSER_GENDER_DROPDOWN) + FACE_ANALYSER_DIRECTION_DROPDOWN.select(update_face_reference_position, outputs=REFERENCE_FACE_POSITION_GALLERY) + FACE_ANALYSER_AGE_DROPDOWN.select(update_face_reference_position, outputs=REFERENCE_FACE_POSITION_GALLERY) + FACE_ANALYSER_GENDER_DROPDOWN.select(update_face_reference_position, outputs=REFERENCE_FACE_POSITION_GALLERY) def update_face_recognition(face_recognition: FaceRecognition) -> Tuple[Update, Update]: diff --git a/roop/uis/__components__/preview.py b/roop/uis/__components__/preview.py index 1d63ec434..051558b3c 100644 --- a/roop/uis/__components__/preview.py +++ b/roop/uis/__components__/preview.py @@ -51,23 +51,27 @@ def render() -> None: def listen() -> None: PREVIEW_FRAME_SLIDER.change(update, inputs=PREVIEW_FRAME_SLIDER, outputs=[PREVIEW_IMAGE, PREVIEW_FRAME_SLIDER]) - component_names: List[ComponentName] = [ + update_component_names: List[ComponentName] = [ 'source_file', 'target_file', 'face_recognition_dropdown', 'reference_face_distance_slider', - 'face_analyser_direction_dropdown', - 'face_analyser_age_dropdown', - 'face_analyser_gender_dropdown', 'frame_processors_checkbox_group' ] - for component_name in component_names: + for component_name in update_component_names: component = ui.get_component(component_name) if component: component.change(update, inputs=PREVIEW_FRAME_SLIDER, outputs=[PREVIEW_IMAGE, PREVIEW_FRAME_SLIDER]) - reference_face_position_gallery = ui.get_component('reference_face_position_gallery') - if reference_face_position_gallery: - reference_face_position_gallery.select(update, inputs=PREVIEW_FRAME_SLIDER, outputs=[PREVIEW_IMAGE, PREVIEW_FRAME_SLIDER]) + select_component_names: List[ComponentName] = [ + 'reference_face_position_gallery', + 'face_analyser_direction_dropdown', + 'face_analyser_age_dropdown', + 'face_analyser_gender_dropdown' + ] + for component_name in select_component_names: + component = ui.get_component(component_name) + if component: + component.select(update, inputs=PREVIEW_FRAME_SLIDER, outputs=[PREVIEW_IMAGE, PREVIEW_FRAME_SLIDER]) def update(frame_number: int = 0) -> Tuple[Update, Update]: