Add some spacing
This commit is contained in:
@@ -50,10 +50,12 @@ def update(files : List[File]) -> Tuple[gradio.Audio, gradio.Image]:
|
||||
file_names = [ file.name for file in files ] if files else None
|
||||
has_source_audio = has_audio(file_names)
|
||||
has_source_image = has_image(file_names)
|
||||
|
||||
if has_source_audio or has_source_image:
|
||||
source_audio_path = get_first(filter_audio_paths(file_names))
|
||||
source_image_path = get_first(filter_image_paths(file_names))
|
||||
state_manager.set_item('source_paths', file_names)
|
||||
return gradio.Audio(value = source_audio_path, visible = has_source_audio), gradio.Image(value = source_image_path, visible = has_source_image)
|
||||
|
||||
state_manager.clear_item('source_paths')
|
||||
return gradio.Audio(value = None, visible = False), gradio.Image(value = None, visible = False)
|
||||
|
||||
@@ -62,14 +62,17 @@ def listen() -> None:
|
||||
def update(file : File) -> Tuple[gradio.Image, gradio.Video]:
|
||||
clear_reference_faces()
|
||||
clear_static_faces()
|
||||
|
||||
if file and is_image(file.name):
|
||||
state_manager.set_item('target_path', file.name)
|
||||
return gradio.Image(value = file.name, visible = True), gradio.Video(value = None, visible = False)
|
||||
|
||||
if file and is_video(file.name):
|
||||
state_manager.set_item('target_path', file.name)
|
||||
if get_file_size(file.name) > FILE_SIZE_LIMIT:
|
||||
preview_vision_frame = normalize_frame_color(read_video_frame(file.name))
|
||||
return gradio.Image(value = preview_vision_frame, visible = True), gradio.Video(value = None, visible = False)
|
||||
return gradio.Image(value = None, visible = False), gradio.Video(value = file.name, visible = True)
|
||||
|
||||
state_manager.clear_item('target_path')
|
||||
return gradio.Image(value = None, visible = False), gradio.Video(value = None, visible = False)
|
||||
|
||||
Reference in New Issue
Block a user