Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|