perf(app): skip TI logic when no TIs to apply

This commit is contained in:
psychedelicious
2025-06-07 18:23:05 +10:00
parent 35c7c59455
commit c66201c7e1

View File

@ -46,6 +46,10 @@ class ModelPatcher:
text_encoder: Union[CLIPTextModel, CLIPTextModelWithProjection],
ti_list: List[Tuple[str, TextualInversionModelRaw]],
) -> Iterator[Tuple[CLIPTokenizer, TextualInversionManager]]:
if len(ti_list) == 0:
yield tokenizer, TextualInversionManager(tokenizer)
return
init_tokens_count = None
new_tokens_added = None