diff options
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 7ed22c1e..3f3f6b7c 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -99,6 +99,11 @@ def list_models(): title = modeltitle(filename, h)
checkpoints_list[title] = CheckpointInfo(filename, title, h, model_name)
+def get_closet_checkpoint_match(searchString):
+ applicable = sorted([info for info in checkpoints_list.values() if searchString in info.title], key = lambda x:len(x.title))
+ if len(applicable)>0:
+ return applicable[0]
+ return None
def model_hash(filename):
try:
|