Skip to content

Commit a097d8d

Browse files
committed
revise for get_sd_models/get_lora_models/get_db_models
1 parent a6a51da commit a097d8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/sd_models.py

+6
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ def get_closet_checkpoint_match(searchString):
140140
return applicable[0]
141141
return None
142142

143+
def get_closet_checkpoint_match_from_model_name(searchString):
144+
applicable = sorted([info for info in checkpoints_list.values() if searchString in info.model_name], key = lambda x:len(x.model_name))
145+
if len(applicable) > 0:
146+
return applicable[0]
147+
return None
148+
143149
def get_sd_model_checkpoint_from_title(sd_model_checkpoint_title):
144150
pos = sd_model_checkpoint_title.rfind('[')
145151
return sd_model_checkpoint_title[0 : pos - 1]

0 commit comments

Comments
 (0)