mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-25 16:59:18 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user