Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -76,6 +76,17 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
76 |
start()
|
77 |
return normalized_output_path
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
app = gr.Interface(
|
80 |
fn=swap_face,
|
81 |
title="Welcome to Roop!",
|
@@ -84,6 +95,7 @@ app = gr.Interface(
|
|
84 |
gr.Image(label="Target Image:"),
|
85 |
gr.Checkbox(label="Face Enhancer?", info="Enhance the face?")
|
86 |
],
|
87 |
-
outputs="image"
|
|
|
88 |
)
|
89 |
app.launch()
|
|
|
76 |
start()
|
77 |
return normalized_output_path
|
78 |
|
79 |
+
js_func = """
|
80 |
+
function refresh() {
|
81 |
+
const url = new URL(window.location);
|
82 |
+
|
83 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
84 |
+
url.searchParams.set('__theme', 'dark');
|
85 |
+
window.location.href = url.href;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
"""
|
89 |
+
|
90 |
app = gr.Interface(
|
91 |
fn=swap_face,
|
92 |
title="Welcome to Roop!",
|
|
|
95 |
gr.Image(label="Target Image:"),
|
96 |
gr.Checkbox(label="Face Enhancer?", info="Enhance the face?")
|
97 |
],
|
98 |
+
outputs="image",
|
99 |
+
js=js_func
|
100 |
)
|
101 |
app.launch()
|