Skip to content

Commit c66201c

Browse files
perf(app): skip TI logic when no TIs to apply
1 parent 35c7c59 commit c66201c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

invokeai/backend/model_patcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def apply_ti(
4646
text_encoder: Union[CLIPTextModel, CLIPTextModelWithProjection],
4747
ti_list: List[Tuple[str, TextualInversionModelRaw]],
4848
) -> Iterator[Tuple[CLIPTokenizer, TextualInversionManager]]:
49+
if len(ti_list) == 0:
50+
yield tokenizer, TextualInversionManager(tokenizer)
51+
return
52+
4953
init_tokens_count = None
5054
new_tokens_added = None
5155

0 commit comments

Comments
 (0)