Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,30 +1,12 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
#
|
| 5 |
-
#
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# Define Gradio interface components
|
| 15 |
-
source_image = gr.inputs.Image(label="Source Image")
|
| 16 |
-
target_image = gr.inputs.Image(label="Target Image")
|
| 17 |
-
output_image = gr.outputs.Image(label="Fused Image")
|
| 18 |
-
|
| 19 |
-
# Setup the Gradio app interface
|
| 20 |
-
app = gr.Interface(
|
| 21 |
-
fn=face_fusion,
|
| 22 |
-
inputs=[source_image, target_image],
|
| 23 |
-
outputs=output_image,
|
| 24 |
-
title="Face Fusion NSFW",
|
| 25 |
-
description="A web application for fusing faces from source to target images."
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
-
# Run the app
|
| 29 |
-
if __name__ == "__main__":
|
| 30 |
-
app.launch()
|
|
|
|
| 1 |
+
from facefusion import core as ff_core
|
| 2 |
+
|
| 3 |
+
# Assuming the Gradio UI setup is encapsulated within the facefusion.uis.core module
|
| 4 |
+
# and it provides a method to launch the Gradio interface directly,
|
| 5 |
+
# you can call it here to start the app. If the `facefusion.uis.core` module doesn't
|
| 6 |
+
# provide such a method directly, you may need to adapt the Gradio UI initialization
|
| 7 |
+
# code from the original application to create a Gradio Interface here instead.
|
| 8 |
+
|
| 9 |
+
# For demonstration, this is a pseudo-code to invoke the UI launch method.
|
| 10 |
+
# You'll likely need to adapt this based on the actual code structure of the facefusion.uis.core module.
|
| 11 |
+
if __name__ == '__main__':
|
| 12 |
+
ff_core.launch_ui() # This is a placeholder function. You need to replace it with the actual function call based on the facefusion code structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|