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
4faaf3e7
Commit
4faaf3e7
authored
Jun 04, 2023
by
ramyma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add endpoint to get latent_upscale_modes for hires fix
parent
fbf88343
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
modules/api/api.py
modules/api/api.py
+9
-0
modules/api/models.py
modules/api/models.py
+3
-0
No files found.
modules/api/api.py
View file @
4faaf3e7
...
...
@@ -189,6 +189,7 @@ class Api:
self
.
add_api_route
(
"/sdapi/v1/cmd-flags"
,
self
.
get_cmd_flags
,
methods
=
[
"GET"
],
response_model
=
models
.
FlagsModel
)
self
.
add_api_route
(
"/sdapi/v1/samplers"
,
self
.
get_samplers
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
SamplerItem
])
self
.
add_api_route
(
"/sdapi/v1/upscalers"
,
self
.
get_upscalers
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
UpscalerItem
])
self
.
add_api_route
(
"/sdapi/v1/latent-upscale-modes"
,
self
.
get_latent_upscale_modes
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
LatentUpscalerModeItem
])
self
.
add_api_route
(
"/sdapi/v1/sd-models"
,
self
.
get_sd_models
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
SDModelItem
])
self
.
add_api_route
(
"/sdapi/v1/sd-vae"
,
self
.
get_sd_vaes
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
SDVaeItem
])
self
.
add_api_route
(
"/sdapi/v1/hypernetworks"
,
self
.
get_hypernetworks
,
methods
=
[
"GET"
],
response_model
=
List
[
models
.
HypernetworkItem
])
...
...
@@ -540,6 +541,14 @@ class Api:
for
upscaler
in
shared
.
sd_upscalers
]
def
get_latent_upscale_modes
(
self
):
return
[
{
"name"
:
upscale_mode
,
}
for
upscale_mode
in
[
*
(
shared
.
latent_upscale_modes
or
{})]
]
def
get_sd_models
(
self
):
return
[{
"title"
:
x
.
title
,
"model_name"
:
x
.
model_name
,
"hash"
:
x
.
shorthash
,
"sha256"
:
x
.
sha256
,
"filename"
:
x
.
filename
,
"config"
:
find_checkpoint_config_near_filename
(
x
)}
for
x
in
checkpoints_list
.
values
()]
...
...
modules/api/models.py
View file @
4faaf3e7
...
...
@@ -241,6 +241,9 @@ class UpscalerItem(BaseModel):
model_url
:
Optional
[
str
]
=
Field
(
title
=
"URL"
)
scale
:
Optional
[
float
]
=
Field
(
title
=
"Scale"
)
class
LatentUpscalerModeItem
(
BaseModel
):
name
:
str
=
Field
(
title
=
"Name"
)
class
SDModelItem
(
BaseModel
):
title
:
str
=
Field
(
title
=
"Title"
)
model_name
:
str
=
Field
(
title
=
"Model Name"
)
...
...
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