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
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
modules/sd_models.py
modules/sd_models.py
+3
-3
scripts/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):
model
.
sd_checkpoint_info
=
checkpoint_info
def
load_model
():
def
load_model
(
checkpoint_info
=
None
):
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
:
print
(
f
"Loading config from: {checkpoint_info.config}"
)
...
...
@@ -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
):
checkpoints_loaded
.
clear
()
shared
.
sd_model
=
load_model
()
shared
.
sd_model
=
load_model
(
checkpoint_info
)
return
shared
.
sd_model
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):
if
info
is
None
:
raise
RuntimeError
(
f
"Unknown checkpoint: {x}"
)
modules
.
sd_models
.
reload_model_weights
(
shared
.
sd_model
,
info
)
p
.
sd_model
=
shared
.
sd_model
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