fffiloni commited on
Commit
9334ae9
1 Parent(s): 539bd8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -19,7 +19,15 @@ def get_sdxl(prompt_in):
19
  def infer(portrait_in, prompt_in):
20
  # Generate Image from SDXL
21
  gr.Info("Generating SDXL image first ...")
22
- sdxl_result = get_sdxl(prompt_in)
 
 
 
 
 
 
 
 
23
 
24
  unique_id = str(uuid.uuid4())
25
 
 
19
  def infer(portrait_in, prompt_in):
20
  # Generate Image from SDXL
21
  gr.Info("Generating SDXL image first ...")
22
+
23
+ try:
24
+ sdxl_result = get_sdxl(prompt_in)
25
+ except ValueError as e:
26
+ # Handles the ValueError
27
+ error_message = str(e)
28
+ print(f"An error occurred: {error_message}")
29
+ raise gr.Error(f"{error_message}")
30
+
31
 
32
  unique_id = str(uuid.uuid4())
33