andro1241 commited on
Commit
86fda5f
·
verified ·
1 Parent(s): ebd5db2

Upload 4 files

Browse files
uis/layouts/benchmark.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+
3
+ from facefusion import benchmarker, state_manager
4
+ from facefusion.uis.components import about, age_modifier_options, background_remover_options, benchmark, benchmark_options, deep_swapper_options, download, execution, execution_thread_count, expression_restorer_options, face_debugger_options, face_editor_options, face_enhancer_options, face_swapper_options, frame_colorizer_options, frame_enhancer_options, lip_syncer_options, memory, processors
5
+
6
+
7
+ def pre_check() -> bool:
8
+ return benchmarker.pre_check()
9
+
10
+
11
+ def render() -> gradio.Blocks:
12
+ with gradio.Blocks() as layout:
13
+ with gradio.Row():
14
+ with gradio.Column(scale = 4):
15
+ with gradio.Blocks():
16
+ about.render()
17
+ with gradio.Blocks():
18
+ benchmark_options.render()
19
+ with gradio.Blocks():
20
+ processors.render()
21
+ with gradio.Blocks():
22
+ age_modifier_options.render()
23
+ with gradio.Blocks():
24
+ background_remover_options.render()
25
+ with gradio.Blocks():
26
+ deep_swapper_options.render()
27
+ with gradio.Blocks():
28
+ expression_restorer_options.render()
29
+ with gradio.Blocks():
30
+ face_debugger_options.render()
31
+ with gradio.Blocks():
32
+ face_editor_options.render()
33
+ with gradio.Blocks():
34
+ face_enhancer_options.render()
35
+ with gradio.Blocks():
36
+ face_swapper_options.render()
37
+ with gradio.Blocks():
38
+ frame_colorizer_options.render()
39
+ with gradio.Blocks():
40
+ frame_enhancer_options.render()
41
+ with gradio.Blocks():
42
+ lip_syncer_options.render()
43
+ with gradio.Blocks():
44
+ execution.render()
45
+ execution_thread_count.render()
46
+ with gradio.Blocks():
47
+ download.render()
48
+ with gradio.Blocks():
49
+ state_manager.set_item('video_memory_strategy', 'tolerant')
50
+ memory.render()
51
+ with gradio.Column(scale = 11):
52
+ with gradio.Blocks():
53
+ benchmark.render()
54
+ return layout
55
+
56
+
57
+ def listen() -> None:
58
+ processors.listen()
59
+ age_modifier_options.listen()
60
+ background_remover_options.listen()
61
+ deep_swapper_options.listen()
62
+ expression_restorer_options.listen()
63
+ download.listen()
64
+ face_debugger_options.listen()
65
+ face_editor_options.listen()
66
+ face_enhancer_options.listen()
67
+ face_swapper_options.listen()
68
+ frame_colorizer_options.listen()
69
+ frame_enhancer_options.listen()
70
+ lip_syncer_options.listen()
71
+ execution.listen()
72
+ execution_thread_count.listen()
73
+ memory.listen()
74
+ benchmark.listen()
75
+ benchmark_options.listen()
76
+
77
+
78
+ def run(ui : gradio.Blocks) -> None:
79
+ ui.launch(favicon_path = 'facefusion.ico', inbrowser = state_manager.get_item('open_browser'))
uis/layouts/default.py ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+
3
+ from facefusion import state_manager
4
+ from facefusion.uis.components import about, age_modifier_options, background_remover_options, deep_swapper_options, download, execution, 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, face_tracker, frame_colorizer_options, frame_enhancer_options, instant_runner, job_manager, job_runner, lip_syncer_options, memory, output, output_options, preview, preview_options, processors, source, target, temp_frame, terminal, trim_frame, ui_workflow, voice_extractor, workflow
5
+
6
+
7
+ def pre_check() -> bool:
8
+ return True
9
+
10
+
11
+ def render() -> gradio.Blocks:
12
+ with gradio.Blocks() as layout:
13
+ with gradio.Row():
14
+ with gradio.Column(scale = 4):
15
+ with gradio.Blocks():
16
+ about.render()
17
+ with gradio.Blocks():
18
+ processors.render()
19
+ with gradio.Blocks():
20
+ age_modifier_options.render()
21
+ with gradio.Blocks():
22
+ background_remover_options.render()
23
+ with gradio.Blocks():
24
+ deep_swapper_options.render()
25
+ with gradio.Blocks():
26
+ expression_restorer_options.render()
27
+ with gradio.Blocks():
28
+ face_debugger_options.render()
29
+ with gradio.Blocks():
30
+ face_editor_options.render()
31
+ with gradio.Blocks():
32
+ face_enhancer_options.render()
33
+ with gradio.Blocks():
34
+ face_swapper_options.render()
35
+ with gradio.Blocks():
36
+ frame_colorizer_options.render()
37
+ with gradio.Blocks():
38
+ frame_enhancer_options.render()
39
+ with gradio.Blocks():
40
+ lip_syncer_options.render()
41
+ with gradio.Blocks():
42
+ voice_extractor.render()
43
+ with gradio.Blocks():
44
+ workflow.render()
45
+ with gradio.Blocks():
46
+ execution.render()
47
+ execution_thread_count.render()
48
+ with gradio.Blocks():
49
+ download.render()
50
+ with gradio.Blocks():
51
+ memory.render()
52
+ with gradio.Blocks():
53
+ temp_frame.render()
54
+ with gradio.Blocks():
55
+ output_options.render()
56
+ with gradio.Column(scale = 4):
57
+ with gradio.Blocks():
58
+ source.render()
59
+ with gradio.Blocks():
60
+ target.render()
61
+ with gradio.Blocks():
62
+ output.render()
63
+ with gradio.Blocks():
64
+ terminal.render()
65
+ with gradio.Blocks():
66
+ ui_workflow.render()
67
+ instant_runner.render()
68
+ job_runner.render()
69
+ job_manager.render()
70
+ with gradio.Column(scale = 7):
71
+ with gradio.Blocks():
72
+ preview.render()
73
+ preview_options.render()
74
+ with gradio.Blocks():
75
+ trim_frame.render()
76
+ with gradio.Blocks():
77
+ face_selector.render()
78
+ with gradio.Blocks():
79
+ face_tracker.render()
80
+ with gradio.Blocks():
81
+ face_masker.render()
82
+ with gradio.Blocks():
83
+ face_detector.render()
84
+ with gradio.Blocks():
85
+ face_landmarker.render()
86
+ return layout
87
+
88
+
89
+ def listen() -> None:
90
+ processors.listen()
91
+ age_modifier_options.listen()
92
+ background_remover_options.listen()
93
+ deep_swapper_options.listen()
94
+ expression_restorer_options.listen()
95
+ face_debugger_options.listen()
96
+ face_editor_options.listen()
97
+ face_enhancer_options.listen()
98
+ face_swapper_options.listen()
99
+ frame_colorizer_options.listen()
100
+ frame_enhancer_options.listen()
101
+ lip_syncer_options.listen()
102
+ execution.listen()
103
+ execution_thread_count.listen()
104
+ download.listen()
105
+ memory.listen()
106
+ temp_frame.listen()
107
+ output_options.listen()
108
+ source.listen()
109
+ target.listen()
110
+ output.listen()
111
+ instant_runner.listen()
112
+ job_runner.listen()
113
+ job_manager.listen()
114
+ terminal.listen()
115
+ preview.listen()
116
+ preview_options.listen()
117
+ trim_frame.listen()
118
+ face_selector.listen()
119
+ face_tracker.listen()
120
+ face_masker.listen()
121
+ face_detector.listen()
122
+ face_landmarker.listen()
123
+ voice_extractor.listen()
124
+ workflow.listen()
125
+
126
+
127
+ def run(ui : gradio.Blocks) -> None:
128
+ ui.launch(favicon_path = 'facefusion.ico', inbrowser = state_manager.get_item('open_browser'))
uis/layouts/jobs.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+
3
+ from facefusion import state_manager
4
+ from facefusion.uis.components import about, job_list, job_list_options
5
+
6
+
7
+ def pre_check() -> bool:
8
+ return True
9
+
10
+
11
+ def render() -> gradio.Blocks:
12
+ with gradio.Blocks() as layout:
13
+ with gradio.Row():
14
+ with gradio.Column(scale = 4):
15
+ with gradio.Blocks():
16
+ about.render()
17
+ with gradio.Blocks():
18
+ job_list_options.render()
19
+ with gradio.Column(scale = 11):
20
+ with gradio.Blocks():
21
+ job_list.render()
22
+ return layout
23
+
24
+
25
+ def listen() -> None:
26
+ job_list_options.listen()
27
+ job_list.listen()
28
+
29
+
30
+ def run(ui : gradio.Blocks) -> None:
31
+ ui.launch(favicon_path = 'facefusion.ico', inbrowser = state_manager.get_item('open_browser'))
uis/layouts/webcam.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+
3
+ from facefusion import state_manager
4
+ from facefusion.uis.components import about, age_modifier_options, background_remover_options, deep_swapper_options, download, execution, execution_thread_count, expression_restorer_options, face_debugger_options, face_editor_options, face_enhancer_options, face_swapper_options, frame_colorizer_options, frame_enhancer_options, lip_syncer_options, processors, webcam, webcam_options
5
+
6
+
7
+ def pre_check() -> bool:
8
+ return True
9
+
10
+
11
+ def render() -> gradio.Blocks:
12
+ with gradio.Blocks() as layout:
13
+ with gradio.Row():
14
+ with gradio.Column(scale = 4):
15
+ with gradio.Blocks():
16
+ about.render()
17
+ with gradio.Blocks():
18
+ webcam_options.render()
19
+ with gradio.Blocks():
20
+ processors.render()
21
+ with gradio.Blocks():
22
+ age_modifier_options.render()
23
+ with gradio.Blocks():
24
+ background_remover_options.render()
25
+ with gradio.Blocks():
26
+ deep_swapper_options.render()
27
+ with gradio.Blocks():
28
+ expression_restorer_options.render()
29
+ with gradio.Blocks():
30
+ face_debugger_options.render()
31
+ with gradio.Blocks():
32
+ face_editor_options.render()
33
+ with gradio.Blocks():
34
+ face_enhancer_options.render()
35
+ with gradio.Blocks():
36
+ face_swapper_options.render()
37
+ with gradio.Blocks():
38
+ frame_colorizer_options.render()
39
+ with gradio.Blocks():
40
+ frame_enhancer_options.render()
41
+ with gradio.Blocks():
42
+ lip_syncer_options.render()
43
+ with gradio.Blocks():
44
+ execution.render()
45
+ execution_thread_count.render()
46
+ with gradio.Blocks():
47
+ download.render()
48
+ with gradio.Column(scale = 11):
49
+ with gradio.Blocks():
50
+ webcam.render()
51
+ return layout
52
+
53
+
54
+ def listen() -> None:
55
+ processors.listen()
56
+ age_modifier_options.listen()
57
+ background_remover_options.listen()
58
+ deep_swapper_options.listen()
59
+ expression_restorer_options.listen()
60
+ download.listen()
61
+ face_debugger_options.listen()
62
+ face_editor_options.listen()
63
+ face_enhancer_options.listen()
64
+ face_swapper_options.listen()
65
+ frame_colorizer_options.listen()
66
+ frame_enhancer_options.listen()
67
+ lip_syncer_options.listen()
68
+ execution.listen()
69
+ execution_thread_count.listen()
70
+ webcam.listen()
71
+
72
+
73
+ def run(ui : gradio.Blocks) -> None:
74
+ ui.launch(favicon_path = 'facefusion.ico', inbrowser = state_manager.get_item('open_browser'))