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
49533eed
Commit
49533eed
authored
Oct 20, 2022
by
random_thoughtss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XY grid correctly re-assignes model when config changes
parent
708c3a7b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
sd_models.py
modules/sd_models.py
+3
-3
xy_grid.py
scripts/xy_grid.py
+1
-0
No files found.
modules/sd_models.py
View file @
49533eed
...
@@ -204,9 +204,9 @@ def load_model_weights(model, checkpoint_info):
...
@@ -204,9 +204,9 @@ def load_model_weights(model, checkpoint_info):
model
.
sd_checkpoint_info
=
checkpoint_info
model
.
sd_checkpoint_info
=
checkpoint_info
def
load_model
():
def
load_model
(
checkpoint_info
=
None
):
from
modules
import
lowvram
,
sd_hijack
from
modules
import
lowvram
,
sd_hijack
checkpoint_info
=
select_checkpoint
()
checkpoint_info
=
checkpoint_info
or
select_checkpoint
()
if
checkpoint_info
.
config
!=
shared
.
cmd_opts
.
config
:
if
checkpoint_info
.
config
!=
shared
.
cmd_opts
.
config
:
print
(
f
"Loading config from: {checkpoint_info.config}"
)
print
(
f
"Loading config from: {checkpoint_info.config}"
)
...
@@ -249,7 +249,7 @@ def reload_model_weights(sd_model, info=None):
...
@@ -249,7 +249,7 @@ def reload_model_weights(sd_model, info=None):
if
sd_model
.
sd_checkpoint_info
.
config
!=
checkpoint_info
.
config
or
should_hijack_inpainting
(
checkpoint_info
)
!=
should_hijack_inpainting
(
sd_model
.
sd_checkpoint_info
):
if
sd_model
.
sd_checkpoint_info
.
config
!=
checkpoint_info
.
config
or
should_hijack_inpainting
(
checkpoint_info
)
!=
should_hijack_inpainting
(
sd_model
.
sd_checkpoint_info
):
checkpoints_loaded
.
clear
()
checkpoints_loaded
.
clear
()
shared
.
sd_model
=
load_model
()
shared
.
sd_model
=
load_model
(
checkpoint_info
)
return
shared
.
sd_model
return
shared
.
sd_model
if
shared
.
cmd_opts
.
lowvram
or
shared
.
cmd_opts
.
medvram
:
if
shared
.
cmd_opts
.
lowvram
or
shared
.
cmd_opts
.
medvram
:
...
...
scripts/xy_grid.py
View file @
49533eed
...
@@ -89,6 +89,7 @@ def apply_checkpoint(p, x, xs):
...
@@ -89,6 +89,7 @@ def apply_checkpoint(p, x, xs):
if
info
is
None
:
if
info
is
None
:
raise
RuntimeError
(
f
"Unknown checkpoint: {x}"
)
raise
RuntimeError
(
f
"Unknown checkpoint: {x}"
)
modules
.
sd_models
.
reload_model_weights
(
shared
.
sd_model
,
info
)
modules
.
sd_models
.
reload_model_weights
(
shared
.
sd_model
,
info
)
p
.
sd_model
=
shared
.
sd_model
def
confirm_checkpoints
(
p
,
xs
):
def
confirm_checkpoints
(
p
,
xs
):
...
...
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