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
642b7e33
Commit
642b7e33
authored
Sep 28, 2022
by
DepFA
Committed by
AUTOMATIC1111
Sep 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add get_closet_checkpoint_match
parent
190fda38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
sd_models.py
modules/sd_models.py
+15
-0
No files found.
modules/sd_models.py
View file @
642b7e33
...
@@ -61,6 +61,21 @@ def list_models():
...
@@ -61,6 +61,21 @@ def list_models():
title
,
model_name
=
modeltitle
(
filename
,
h
)
title
,
model_name
=
modeltitle
(
filename
,
h
)
checkpoints_list
[
title
]
=
CheckpointInfo
(
filename
,
title
,
h
,
model_name
)
checkpoints_list
[
title
]
=
CheckpointInfo
(
filename
,
title
,
h
,
model_name
)
def
get_closet_checkpoint_match
(
searchString
):
checkpointValues
=
checkpoints_list
.
values
()
applicable
=
[
info
for
info
in
checkpointValues
if
searchString
.
upper
()
==
''
.
join
(
info
.
title
.
rpartition
(
'.ckpt'
)[
0
])
.
upper
()]
if
len
(
applicable
)
==
0
:
applicable
=
[
info
for
info
in
checkpointValues
if
searchString
.
upper
()
==
''
.
join
(
info
.
title
.
rpartition
(
'.ckpt'
)[:
2
])
.
upper
()]
if
len
(
applicable
)
==
0
:
applicable
=
[
info
for
info
in
checkpointValues
if
searchString
in
info
.
title
]
if
len
(
applicable
)
>
0
:
return
applicable
[
0
]
return
None
def
model_hash
(
filename
):
def
model_hash
(
filename
):
try
:
try
:
...
...
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