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
ba54c747
Commit
ba54c747
authored
Jun 08, 2024
by
AUTOMATIC1111
Committed by
GitHub
Jun 08, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15656 from AUTOMATIC1111/api-old-sampler-names
Allow old sampler names in API
parents
cd9e9e40
c8336c45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
modules/api/api.py
modules/api/api.py
+10
-2
No files found.
modules/api/api.py
View file @
ba54c747
...
@@ -438,15 +438,19 @@ class Api:
...
@@ -438,15 +438,19 @@ class Api:
self
.
apply_infotext
(
txt2imgreq
,
"txt2img"
,
script_runner
=
script_runner
,
mentioned_script_args
=
infotext_script_args
)
self
.
apply_infotext
(
txt2imgreq
,
"txt2img"
,
script_runner
=
script_runner
,
mentioned_script_args
=
infotext_script_args
)
selectable_scripts
,
selectable_script_idx
=
self
.
get_selectable_script
(
txt2imgreq
.
script_name
,
script_runner
)
selectable_scripts
,
selectable_script_idx
=
self
.
get_selectable_script
(
txt2imgreq
.
script_name
,
script_runner
)
sampler
,
scheduler
=
sd_samplers
.
get_sampler_and_scheduler
(
txt2imgreq
.
sampler_name
or
txt2imgreq
.
sampler_index
,
txt2imgreq
.
scheduler
)
populate
=
txt2imgreq
.
copy
(
update
=
{
# Override __init__ params
populate
=
txt2imgreq
.
copy
(
update
=
{
# Override __init__ params
"sampler_name"
:
validate_sampler_name
(
txt2imgreq
.
sampler_name
or
txt2imgreq
.
sampler_index
),
"sampler_name"
:
validate_sampler_name
(
sampler
),
"do_not_save_samples"
:
not
txt2imgreq
.
save_images
,
"do_not_save_samples"
:
not
txt2imgreq
.
save_images
,
"do_not_save_grid"
:
not
txt2imgreq
.
save_images
,
"do_not_save_grid"
:
not
txt2imgreq
.
save_images
,
})
})
if
populate
.
sampler_name
:
if
populate
.
sampler_name
:
populate
.
sampler_index
=
None
# prevent a warning later on
populate
.
sampler_index
=
None
# prevent a warning later on
if
not
populate
.
scheduler
and
scheduler
!=
"Automatic"
:
populate
.
scheduler
=
scheduler
args
=
vars
(
populate
)
args
=
vars
(
populate
)
args
.
pop
(
'script_name'
,
None
)
args
.
pop
(
'script_name'
,
None
)
args
.
pop
(
'script_args'
,
None
)
# will refeed them to the pipeline directly after initializing them
args
.
pop
(
'script_args'
,
None
)
# will refeed them to the pipeline directly after initializing them
...
@@ -502,9 +506,10 @@ class Api:
...
@@ -502,9 +506,10 @@ class Api:
self
.
apply_infotext
(
img2imgreq
,
"img2img"
,
script_runner
=
script_runner
,
mentioned_script_args
=
infotext_script_args
)
self
.
apply_infotext
(
img2imgreq
,
"img2img"
,
script_runner
=
script_runner
,
mentioned_script_args
=
infotext_script_args
)
selectable_scripts
,
selectable_script_idx
=
self
.
get_selectable_script
(
img2imgreq
.
script_name
,
script_runner
)
selectable_scripts
,
selectable_script_idx
=
self
.
get_selectable_script
(
img2imgreq
.
script_name
,
script_runner
)
sampler
,
scheduler
=
sd_samplers
.
get_sampler_and_scheduler
(
img2imgreq
.
sampler_name
or
img2imgreq
.
sampler_index
,
img2imgreq
.
scheduler
)
populate
=
img2imgreq
.
copy
(
update
=
{
# Override __init__ params
populate
=
img2imgreq
.
copy
(
update
=
{
# Override __init__ params
"sampler_name"
:
validate_sampler_name
(
img2imgreq
.
sampler_name
or
img2imgreq
.
sampler_index
),
"sampler_name"
:
validate_sampler_name
(
sampler
),
"do_not_save_samples"
:
not
img2imgreq
.
save_images
,
"do_not_save_samples"
:
not
img2imgreq
.
save_images
,
"do_not_save_grid"
:
not
img2imgreq
.
save_images
,
"do_not_save_grid"
:
not
img2imgreq
.
save_images
,
"mask"
:
mask
,
"mask"
:
mask
,
...
@@ -512,6 +517,9 @@ class Api:
...
@@ -512,6 +517,9 @@ class Api:
if
populate
.
sampler_name
:
if
populate
.
sampler_name
:
populate
.
sampler_index
=
None
# prevent a warning later on
populate
.
sampler_index
=
None
# prevent a warning later on
if
not
populate
.
scheduler
and
scheduler
!=
"Automatic"
:
populate
.
scheduler
=
scheduler
args
=
vars
(
populate
)
args
=
vars
(
populate
)
args
.
pop
(
'include_init_images'
,
None
)
# this is meant to be done by "exclude": True in model, but it's for a reason that I cannot determine.
args
.
pop
(
'include_init_images'
,
None
)
# this is meant to be done by "exclude": True in model, but it's for a reason that I cannot determine.
args
.
pop
(
'script_name'
,
None
)
args
.
pop
(
'script_name'
,
None
)
...
...
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