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
42a70d74
Commit
42a70d74
authored
Jan 24, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repair sdapi/v1/upscalers returning bogus results
parent
8b903322
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
api.py
modules/api/api.py
+9
-7
models.py
modules/api/models.py
+1
-1
No files found.
modules/api/api.py
View file @
42a70d74
...
@@ -375,13 +375,15 @@ class Api:
...
@@ -375,13 +375,15 @@ class Api:
return
[{
"name"
:
sampler
[
0
],
"aliases"
:
sampler
[
2
],
"options"
:
sampler
[
3
]}
for
sampler
in
sd_samplers
.
all_samplers
]
return
[{
"name"
:
sampler
[
0
],
"aliases"
:
sampler
[
2
],
"options"
:
sampler
[
3
]}
for
sampler
in
sd_samplers
.
all_samplers
]
def
get_upscalers
(
self
):
def
get_upscalers
(
self
):
upscalers
=
[]
return
[
{
for
upscaler
in
shared
.
sd_upscalers
:
"name"
:
upscaler
.
name
,
u
=
upscaler
.
scaler
"model_name"
:
upscaler
.
scaler
.
model_name
,
upscalers
.
append
({
"name"
:
u
.
name
,
"model_name"
:
u
.
model_name
,
"model_path"
:
u
.
model_path
,
"model_url"
:
u
.
model_url
})
"model_path"
:
upscaler
.
data_path
,
"scale"
:
upscaler
.
scale
,
return
upscalers
}
for
upscaler
in
shared
.
sd_upscalers
]
def
get_sd_models
(
self
):
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
(
x
)}
for
x
in
checkpoints_list
.
values
()]
return
[{
"title"
:
x
.
title
,
"model_name"
:
x
.
model_name
,
"hash"
:
x
.
shorthash
,
"sha256"
:
x
.
sha256
,
"filename"
:
x
.
filename
,
"config"
:
find_checkpoint_config
(
x
)}
for
x
in
checkpoints_list
.
values
()]
...
...
modules/api/models.py
View file @
42a70d74
...
@@ -219,7 +219,7 @@ class UpscalerItem(BaseModel):
...
@@ -219,7 +219,7 @@ class UpscalerItem(BaseModel):
name
:
str
=
Field
(
title
=
"Name"
)
name
:
str
=
Field
(
title
=
"Name"
)
model_name
:
Optional
[
str
]
=
Field
(
title
=
"Model Name"
)
model_name
:
Optional
[
str
]
=
Field
(
title
=
"Model Name"
)
model_path
:
Optional
[
str
]
=
Field
(
title
=
"Path"
)
model_path
:
Optional
[
str
]
=
Field
(
title
=
"Path"
)
model_url
:
Optional
[
str
]
=
Field
(
title
=
"URL
"
)
scale
:
Optional
[
float
]
=
Field
(
title
=
"Scale
"
)
class
SDModelItem
(
BaseModel
):
class
SDModelItem
(
BaseModel
):
title
:
str
=
Field
(
title
=
"Title"
)
title
:
str
=
Field
(
title
=
"Title"
)
...
...
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