diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-12-24 09:19:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-24 09:19:43 +0000 |
commit | adab48cb1b679bafb6a411f7316b600cab6f619b (patch) | |
tree | 4477ad933a6cb7d1f36335d651da099ef3d5ca74 /modules/api | |
parent | 8c9e6d3c7d3e4f592d9154ec45533ef47d71ef88 (diff) | |
parent | 960293d6b24f380f5744c94c9a46acaae6cc8c04 (diff) | |
download | stable-diffusion-webui-gfx803-adab48cb1b679bafb6a411f7316b600cab6f619b.tar.gz stable-diffusion-webui-gfx803-adab48cb1b679bafb6a411f7316b600cab6f619b.tar.bz2 stable-diffusion-webui-gfx803-adab48cb1b679bafb6a411f7316b600cab6f619b.zip |
Merge pull request #5637 from aednzxy/patch-1
API endpoint to refresh checkpoints
Diffstat (limited to 'modules/api')
-rw-r--r-- | modules/api/api.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index 33845045..3257445d 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -96,6 +96,7 @@ class Api: self.add_api_route("/sdapi/v1/prompt-styles", self.get_prompt_styles, methods=["GET"], response_model=List[PromptStyleItem]) self.add_api_route("/sdapi/v1/artist-categories", self.get_artists_categories, methods=["GET"], response_model=List[str]) self.add_api_route("/sdapi/v1/artists", self.get_artists, methods=["GET"], response_model=List[ArtistItem]) + self.add_api_route("/sdapi/v1/refresh-checkpoints", self.refresh_checkpoints, methods=["POST"]) def add_api_route(self, path: str, endpoint, **kwargs): if shared.cmd_opts.api_auth: @@ -321,6 +322,9 @@ class Api: def get_artists(self): return [{"name":x[0], "score":x[1], "category":x[2]} for x in shared.artist_db.artists] + + def refresh_checkpoints(self): + shared.refresh_checkpoints() def launch(self, server_name, port): self.app.include_router(self.router) |