From 5770fd08f686fe989a592aa810bca68b0a9c9777 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Thu, 25 Jan 2024 09:00:48 -0800 Subject: [PATCH] Update forge_clip.py --- modules_forge/forge_clip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules_forge/forge_clip.py b/modules_forge/forge_clip.py index 9437d6b9..16810b38 100644 --- a/modules_forge/forge_clip.py +++ b/modules_forge/forge_clip.py @@ -26,7 +26,8 @@ class CLIP_SD_XL_L(FrozenCLIPEmbedderWithCustomWords): super().__init__(wrapped, hijack) def encode_with_transformers(self, tokens): - outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=self.wrapped.layer == "hidden") + outputs = self.wrapped.transformer(input_ids=tokens, attention_mask=None, + output_hidden_states=self.wrapped.layer == "hidden") if self.wrapped.layer == "last": z = outputs.last_hidden_state @@ -45,7 +46,8 @@ class CLIP_SD_XL_G(FrozenCLIPEmbedderWithCustomWords): self.wrapped.layer_idx = -2 def encode_with_transformers(self, tokens): - outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=self.wrapped.layer == "hidden") + outputs = self.wrapped.transformer(input_ids=tokens, attention_mask=None, + output_hidden_states=self.wrapped.layer == "hidden") if self.wrapped.layer == "last": z = outputs.last_hidden_state