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
bd4587d2
Commit
bd4587d2
authored
Jan 10, 2023
by
AUTOMATIC1111
Committed by
GitHub
Jan 10, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6578 from vladmandic/fix-model-load
allow model load if previous model failed
parents
12dc8e09
552d7b90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
modules/sd_models.py
modules/sd_models.py
+10
-5
No files found.
modules/sd_models.py
View file @
bd4587d2
...
@@ -49,6 +49,9 @@ def checkpoint_tiles():
...
@@ -49,6 +49,9 @@ def checkpoint_tiles():
def
find_checkpoint_config
(
info
):
def
find_checkpoint_config
(
info
):
if
info
is
None
:
return
shared
.
cmd_opts
.
config
config
=
os
.
path
.
splitext
(
info
.
filename
)[
0
]
+
".yaml"
config
=
os
.
path
.
splitext
(
info
.
filename
)[
0
]
+
".yaml"
if
os
.
path
.
exists
(
config
):
if
os
.
path
.
exists
(
config
):
return
config
return
config
...
@@ -345,14 +348,16 @@ def reload_model_weights(sd_model=None, info=None):
...
@@ -345,14 +348,16 @@ def reload_model_weights(sd_model=None, info=None):
if
not
sd_model
:
if
not
sd_model
:
sd_model
=
shared
.
sd_model
sd_model
=
shared
.
sd_model
if
sd_model
is
None
:
# previous model load failed
current_checkpoint_info
=
None
else
:
current_checkpoint_info
=
sd_model
.
sd_checkpoint_info
if
sd_model
.
sd_model_checkpoint
==
checkpoint_info
.
filename
:
return
current_checkpoint_info
=
sd_model
.
sd_checkpoint_info
checkpoint_config
=
find_checkpoint_config
(
current_checkpoint_info
)
checkpoint_config
=
find_checkpoint_config
(
current_checkpoint_info
)
if
sd_model
.
sd_model_checkpoint
==
checkpoint_info
.
filename
:
if
current_checkpoint_info
is
None
or
checkpoint_config
!=
find_checkpoint_config
(
checkpoint_info
)
or
should_hijack_inpainting
(
checkpoint_info
)
!=
should_hijack_inpainting
(
sd_model
.
sd_checkpoint_info
):
return
if
checkpoint_config
!=
find_checkpoint_config
(
checkpoint_info
)
or
should_hijack_inpainting
(
checkpoint_info
)
!=
should_hijack_inpainting
(
sd_model
.
sd_checkpoint_info
):
del
sd_model
del
sd_model
checkpoints_loaded
.
clear
()
checkpoints_loaded
.
clear
()
load_model
(
checkpoint_info
)
load_model
(
checkpoint_info
)
...
...
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