From 91ecc750bebcd25c5ad970a7bddc8f7603a136d7 Mon Sep 17 00:00:00 2001 From: Silver <65376327+silveroxides@users.noreply.github.com> Date: Tue, 11 Jun 2024 00:40:26 +0200 Subject: [PATCH] Update sd_hijack_clip.py --- modules/sd_hijack_clip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/sd_hijack_clip.py b/modules/sd_hijack_clip.py index 3db047dfd..355df3d30 100644 --- a/modules/sd_hijack_clip.py +++ b/modules/sd_hijack_clip.py @@ -353,10 +353,10 @@ class FrozenCLIPEmbedderForSDXLWithCustomWords(FrozenCLIPEmbedderWithCustomWords def encode_with_transformers(self, tokens): outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=self.wrapped.layer == "hidden") - if self.wrapped.layer == "last": - z = outputs.last_hidden_state - elif opts.sdxl_clip_l_skip is True: + if opts.sdxl_clip_l_skip is True: z = outputs.hidden_states[-opts.CLIP_stop_at_last_layers] + elif self.wrapped.layer == "last": + z = outputs.last_hidden_state else: z = outputs.hidden_states[self.wrapped.layer_idx]