Update app.py
Browse files
app.py
CHANGED
@@ -4,15 +4,24 @@ import os
|
|
4 |
|
5 |
def run_workflow():
|
6 |
try:
|
7 |
-
print("
|
8 |
script_path = "ComfyUI/hr.py"
|
9 |
if not os.path.exists(script_path):
|
|
|
10 |
return "Error: hr.py not found!"
|
11 |
|
|
|
12 |
result = subprocess.run(["python", script_path], capture_output=True, text=True)
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
except Exception as e:
|
|
|
16 |
return f"Exception: {str(e)}"
|
17 |
|
18 |
ui = gr.Interface(
|
@@ -23,6 +32,6 @@ ui = gr.Interface(
|
|
23 |
description="Click the button to execute hr.py and generate an image."
|
24 |
)
|
25 |
|
26 |
-
print("Launching Gradio UI...")
|
27 |
if __name__ == "__main__":
|
28 |
ui.launch(share=True)
|
|
|
4 |
|
5 |
def run_workflow():
|
6 |
try:
|
7 |
+
print("π Checking if hr.py exists...")
|
8 |
script_path = "ComfyUI/hr.py"
|
9 |
if not os.path.exists(script_path):
|
10 |
+
print("β Error: hr.py not found!")
|
11 |
return "Error: hr.py not found!"
|
12 |
|
13 |
+
print("β
Running hr.py...")
|
14 |
result = subprocess.run(["python", script_path], capture_output=True, text=True)
|
15 |
+
|
16 |
+
if result.returncode == 0:
|
17 |
+
print("β
Execution Successful!")
|
18 |
+
return result.stdout
|
19 |
+
else:
|
20 |
+
print(f"β Execution Failed:\n{result.stderr}")
|
21 |
+
return f"Error:\n{result.stderr}"
|
22 |
|
23 |
except Exception as e:
|
24 |
+
print(f"β Exception: {str(e)}")
|
25 |
return f"Exception: {str(e)}"
|
26 |
|
27 |
ui = gr.Interface(
|
|
|
32 |
description="Click the button to execute hr.py and generate an image."
|
33 |
)
|
34 |
|
35 |
+
print("π Launching Gradio UI...")
|
36 |
if __name__ == "__main__":
|
37 |
ui.launch(share=True)
|