Put API under /sdapi/ so that routing is simpler in the future. This means that one could allow access to /sdapi/ but not the webui.

This commit is contained in:
Ryan Voots 2022-10-17 12:50:45 -04:00 committed by AUTOMATIC1111
parent c3851a853d
commit 247aeb3aaa

View File

@ -18,7 +18,7 @@ class TextToImageResponse(BaseModel):
class Api:
def __init__(self, app):
self.router = APIRouter()
app.add_api_route("/v1/txt2img", self.text2imgapi, methods=["POST"])
app.add_api_route("/sdapi/v1/txt2img", self.text2imgapi, methods=["POST"])
def text2imgapi(self, txt2imgreq: StableDiffusionProcessingAPI ):
populate = txt2imgreq.copy(update={ # Override __init__ params