From 2e1e141a39988d9c775b4887fed6770c90a180b1 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Fri, 26 Dec 2025 20:54:49 -0800 Subject: [PATCH] Add short version of checkpoint titles Fixes compatibility with some extensions, including updated adetailer. --- modules/sd_checkpoint.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/sd_checkpoint.py b/modules/sd_checkpoint.py index ff192b668..375c1c58f 100644 --- a/modules/sd_checkpoint.py +++ b/modules/sd_checkpoint.py @@ -116,11 +116,15 @@ def setup_model(): # sd_hijack_accelerate.hijack_torch_conv() -def checkpoint_titles(): +def checkpoint_titles(use_short=False): def convert(name): return int(name) if name.isdigit() else name.lower() + def alphanumeric_key(key): - return [convert(c) for c in re.split('([0-9]+)', key)] + return [convert(c) for c in re.split("([0-9]+)", key)] + + if use_short: + return sorted([x.title.rsplit("\\", 1)[-1].rsplit("/", 1)[-1] for x in checkpoints_list.values()], key=alphanumeric_key) return sorted([x.title for x in checkpoints_list.values()], key=alphanumeric_key)