Spaces:
Paused
Paused
Rishi Desai
commited on
Commit
·
709fad3
1
Parent(s):
aad4f65
demo works live
Browse files- .gitignore +1 -0
- demo.py +11 -11
.gitignore
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
venv
|
2 |
.env
|
3 |
.idea/
|
|
|
4 |
__pycache__/
|
5 |
ComfyUI/
|
|
|
1 |
venv
|
2 |
.env
|
3 |
.idea/
|
4 |
+
.gradio/
|
5 |
__pycache__/
|
6 |
ComfyUI/
|
demo.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
import tempfile
|
4 |
-
|
5 |
from PIL import Image
|
6 |
|
7 |
def enhance_face_gradio(input_image, ref_image):
|
@@ -30,13 +30,13 @@ def enhance_face_gradio(input_image, ref_image):
|
|
30 |
|
31 |
try:
|
32 |
# Process the face
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
pass
|
41 |
except Exception as e:
|
42 |
# Handle the error, log it, and return an error message
|
@@ -93,11 +93,11 @@ def create_gradio_interface():
|
|
93 |
gr.Examples(examples=example_inps, inputs=[input_image, ref_image], outputs=output_image)
|
94 |
|
95 |
# Launch the Gradio app with queue
|
96 |
-
demo.queue(max_size=20)
|
97 |
demo.launch(
|
98 |
-
share=
|
99 |
server_name="0.0.0.0", # Make available on all network interfaces
|
100 |
-
server_port=7860,
|
101 |
)
|
102 |
|
103 |
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
import tempfile
|
4 |
+
from main import process_face
|
5 |
from PIL import Image
|
6 |
|
7 |
def enhance_face_gradio(input_image, ref_image):
|
|
|
30 |
|
31 |
try:
|
32 |
# Process the face
|
33 |
+
process_face(
|
34 |
+
input_path=input_path,
|
35 |
+
ref_path=ref_path,
|
36 |
+
crop=False,
|
37 |
+
upscale=False,
|
38 |
+
output_path=output_path
|
39 |
+
)
|
40 |
pass
|
41 |
except Exception as e:
|
42 |
# Handle the error, log it, and return an error message
|
|
|
93 |
gr.Examples(examples=example_inps, inputs=[input_image, ref_image], outputs=output_image)
|
94 |
|
95 |
# Launch the Gradio app with queue
|
96 |
+
demo.queue(max_size=20)
|
97 |
demo.launch(
|
98 |
+
share=True, # Set to True if you want a public link
|
99 |
server_name="0.0.0.0", # Make available on all network interfaces
|
100 |
+
server_port=7860,
|
101 |
)
|
102 |
|
103 |
|