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
503bd3fc
Commit
503bd3fc
authored
Aug 30, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep order in list of checkpoints when loading model that doesn't have a checksum
parent
9e7de49f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
modules/sd_models.py
modules/sd_models.py
+21
-1
No files found.
modules/sd_models.py
View file @
503bd3fc
...
@@ -27,6 +27,24 @@ checkpoint_alisases = checkpoint_aliases # for compatibility with old name
...
@@ -27,6 +27,24 @@ checkpoint_alisases = checkpoint_aliases # for compatibility with old name
checkpoints_loaded
=
collections
.
OrderedDict
()
checkpoints_loaded
=
collections
.
OrderedDict
()
def
replace_key
(
d
,
key
,
new_key
,
value
):
keys
=
list
(
d
.
keys
())
d
[
new_key
]
=
value
if
key
not
in
keys
:
return
d
index
=
keys
.
index
(
key
)
keys
[
index
]
=
new_key
new_d
=
{
k
:
d
[
k
]
for
k
in
keys
}
d
.
clear
()
d
.
update
(
new_d
)
return
d
class
CheckpointInfo
:
class
CheckpointInfo
:
def
__init__
(
self
,
filename
):
def
__init__
(
self
,
filename
):
self
.
filename
=
filename
self
.
filename
=
filename
...
@@ -91,9 +109,11 @@ class CheckpointInfo:
...
@@ -91,9 +109,11 @@ class CheckpointInfo:
if
self
.
shorthash
not
in
self
.
ids
:
if
self
.
shorthash
not
in
self
.
ids
:
self
.
ids
+=
[
self
.
shorthash
,
self
.
sha256
,
f
'{self.name} [{self.shorthash}]'
,
f
'{self.name_for_extra} [{self.shorthash}]'
]
self
.
ids
+=
[
self
.
shorthash
,
self
.
sha256
,
f
'{self.name} [{self.shorthash}]'
,
f
'{self.name_for_extra} [{self.shorthash}]'
]
checkpoints_list
.
pop
(
self
.
title
,
None
)
old_title
=
self
.
title
self
.
title
=
f
'{self.name} [{self.shorthash}]'
self
.
title
=
f
'{self.name} [{self.shorthash}]'
self
.
short_title
=
f
'{self.name_for_extra} [{self.shorthash}]'
self
.
short_title
=
f
'{self.name_for_extra} [{self.shorthash}]'
replace_key
(
checkpoints_list
,
old_title
,
self
.
title
,
self
)
self
.
register
()
self
.
register
()
return
self
.
shorthash
return
self
.
shorthash
...
...
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