Any exception is translated in http response (#2186)

* fix: get error in http request
This commit is contained in:
psydok
2024-10-28 05:27:38 +05:00
committed by GitHub
parent 41a21f66fd
commit 878c056576
2 changed files with 18 additions and 2 deletions

View File

@@ -205,7 +205,7 @@ class Api:
self.router = APIRouter()
self.app = app
self.queue_lock = queue_lock
#api_middleware(self.app) # XXX this will have to be fixed
#api_middleware(self.app) # FIXME: (legacy) this will have to be fixed
self.add_api_route("/sdapi/v1/txt2img", self.text2imgapi, methods=["POST"], response_model=models.TextToImageResponse)
self.add_api_route("/sdapi/v1/img2img", self.img2imgapi, methods=["POST"], response_model=models.ImageToImageResponse)
self.add_api_route("/sdapi/v1/extra-single-image", self.extras_single_image_api, methods=["POST"], response_model=models.ExtrasSingleImageResponse)