Manishh-07 commited on
Commit
0329732
Β·
verified Β·
1 Parent(s): e04dafe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -4,15 +4,24 @@ import os
4
 
5
  def run_workflow():
6
  try:
7
- print("Executing hr.py...") # Debugging log
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
- return result.stdout if result.returncode == 0 else f"Error:\n{result.stderr}"
 
 
 
 
 
 
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...") # Debugging log
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)