Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
adab48cb
Unverified
Commit
adab48cb
authored
Dec 24, 2022
by
AUTOMATIC1111
Committed by
GitHub
Dec 24, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5637 from aednzxy/patch-1
API endpoint to refresh checkpoints
parents
8c9e6d3c
960293d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
api.py
modules/api/api.py
+4
-0
No files found.
modules/api/api.py
View file @
adab48cb
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment