Vae/te preferences via cards (#1912)

Allows setting of preferred VAE and Text encoder(s) for checkpoints when selected via Checkpoint cards. No selection saved means no change to current toprow setting. 'Built in' option, if the only choice, means clear the toprow selection (therefore use vae/te built-in to checkpoint).
Also allows setting model type for checkpoints (SD1/SD2/SDXL/Flux/Unknown) (user set only, no attempt at autodetection), enabling filtering of the cards based on UI preset.
This commit is contained in:
DenOfEquity
2024-09-25 20:45:11 +01:00
committed by GitHub
parent c2d290e6c9
commit 7876862c43
5 changed files with 66 additions and 18 deletions

View File

@@ -185,6 +185,15 @@ def list_models():
re_strip_checksum = re.compile(r"\s*\[[^]]+]\s*$")
def match_checkpoint_to_name(name):
name = name.split(' [')[0]
for ckptname in checkpoints_list.values():
title = ckptname.title.split(' [')[0]
if (name in title) or (title in name):
return ckptname.short_title if shared.opts.sd_checkpoint_dropdown_use_short else ckptname.name.split(' [')[0]
return name
def get_closet_checkpoint_match(search_string):
if not search_string: