From f98225cdb6e1a436fbdba5298655ba5b12cc3ff1 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 22 Sep 2022 18:04:11 +0530 Subject: [PATCH] Better errors when the server fails --- ui/sd_internal/runtime.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/sd_internal/runtime.py b/ui/sd_internal/runtime.py index ed6e7c80..7d875559 100644 --- a/ui/sd_internal/runtime.py +++ b/ui/sd_internal/runtime.py @@ -189,8 +189,14 @@ def mk_img(req: Request): try: yield from do_mk_img(req) except Exception as e: + print(traceback.format_exc()) + gc() - raise e + + yield json.dumps({ + "status": 'failed', + "detail": str(e) + }) def do_mk_img(req: Request): global model, modelCS, modelFS, device