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
fa931733
Commit
fa931733
authored
Dec 25, 2022
by
Philpax
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(api): assign sd_model after settings change
parent
c6f347b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
api.py
modules/api/api.py
+0
-2
processing.py
modules/processing.py
+4
-2
No files found.
modules/api/api.py
View file @
fa931733
...
@@ -121,7 +121,6 @@ class Api:
...
@@ -121,7 +121,6 @@ class Api:
def
text2imgapi
(
self
,
txt2imgreq
:
StableDiffusionTxt2ImgProcessingAPI
):
def
text2imgapi
(
self
,
txt2imgreq
:
StableDiffusionTxt2ImgProcessingAPI
):
populate
=
txt2imgreq
.
copy
(
update
=
{
# Override __init__ params
populate
=
txt2imgreq
.
copy
(
update
=
{
# Override __init__ params
"sd_model"
:
shared
.
sd_model
,
"sampler_name"
:
validate_sampler_name
(
txt2imgreq
.
sampler_name
or
txt2imgreq
.
sampler_index
),
"sampler_name"
:
validate_sampler_name
(
txt2imgreq
.
sampler_name
or
txt2imgreq
.
sampler_index
),
"do_not_save_samples"
:
True
,
"do_not_save_samples"
:
True
,
"do_not_save_grid"
:
True
"do_not_save_grid"
:
True
...
@@ -153,7 +152,6 @@ class Api:
...
@@ -153,7 +152,6 @@ class Api:
mask
=
decode_base64_to_image
(
mask
)
mask
=
decode_base64_to_image
(
mask
)
populate
=
img2imgreq
.
copy
(
update
=
{
# Override __init__ params
populate
=
img2imgreq
.
copy
(
update
=
{
# Override __init__ params
"sd_model"
:
shared
.
sd_model
,
"sampler_name"
:
validate_sampler_name
(
img2imgreq
.
sampler_name
or
img2imgreq
.
sampler_index
),
"sampler_name"
:
validate_sampler_name
(
img2imgreq
.
sampler_name
or
img2imgreq
.
sampler_index
),
"do_not_save_samples"
:
True
,
"do_not_save_samples"
:
True
,
"do_not_save_grid"
:
True
,
"do_not_save_grid"
:
True
,
...
...
modules/processing.py
View file @
fa931733
...
@@ -466,6 +466,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -466,6 +466,8 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if
k
==
'sd_model_checkpoint'
:
sd_models
.
reload_model_weights
()
# make onchange call for changing SD model
if
k
==
'sd_model_checkpoint'
:
sd_models
.
reload_model_weights
()
# make onchange call for changing SD model
if
k
==
'sd_vae'
:
sd_vae
.
reload_vae_weights
()
# make onchange call for changing VAE
if
k
==
'sd_vae'
:
sd_vae
.
reload_vae_weights
()
# make onchange call for changing VAE
# Assign sd_model here to ensure that it reflects the model after any changes
p
.
sd_model
=
shared
.
sd_model
res
=
process_images_inner
(
p
)
res
=
process_images_inner
(
p
)
finally
:
finally
:
...
...
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