From a57adde5aeb4239c8e38a5a8f87bc4e0943d15c3 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:06:30 +0900 Subject: [PATCH] sort TI hashes --- modules/sd_hijack_clip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sd_hijack_clip.py b/modules/sd_hijack_clip.py index 0cd23fc39..23ecb15f0 100644 --- a/modules/sd_hijack_clip.py +++ b/modules/sd_hijack_clip.py @@ -3,7 +3,7 @@ from collections import namedtuple import torch -from modules import prompt_parser, devices, sd_hijack, sd_emphasis +from modules import prompt_parser, devices, sd_hijack, sd_emphasis, util from modules.shared import opts from modules.util import GenerationParamsState @@ -37,7 +37,7 @@ class EmbeddingHashes(GenerationParamsState): unique_hashes = dict.fromkeys(self.hashes) if existing_ti_hashes := extra_generation_params.get('TI hashes'): unique_hashes.update(dict.fromkeys(existing_ti_hashes.split(', '))) - extra_generation_params['TI hashes'] = ', '.join(unique_hashes) + extra_generation_params['TI hashes'] = ', '.join(sorted(unique_hashes, key=util.natural_sort_key)) class EmphasisMode(GenerationParamsState):