Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
adab48cb
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
modules/api/api.py
modules/api/api.py
+4
-0
No files found.
modules/api/api.py
View file @
adab48cb
...
@@ -96,6 +96,7 @@ class Api:
...
@@ -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/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/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/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
):
def
add_api_route
(
self
,
path
:
str
,
endpoint
,
**
kwargs
):
if
shared
.
cmd_opts
.
api_auth
:
if
shared
.
cmd_opts
.
api_auth
:
...
@@ -321,6 +322,9 @@ class Api:
...
@@ -321,6 +322,9 @@ class Api:
def
get_artists
(
self
):
def
get_artists
(
self
):
return
[{
"name"
:
x
[
0
],
"score"
:
x
[
1
],
"category"
:
x
[
2
]}
for
x
in
shared
.
artist_db
.
artists
]
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
):
def
launch
(
self
,
server_name
,
port
):
self
.
app
.
include_router
(
self
.
router
)
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