Update sd_hijack_clip.py

This commit is contained in:
hako-mikan 2024-02-10 00:18:08 +09:00 committed by GitHub
parent 6b3f7039b6
commit c3c88ca8b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -279,7 +279,7 @@ class FrozenCLIPEmbedderWithCustomWordsBase(torch.nn.Module):
original_mean = z.mean()
z = z * batch_multipliers.reshape(batch_multipliers.shape + (1,)).expand(z.shape)
new_mean = z.mean()
if not getattr(opts, "disable_normalize_embeddings", False):
z = z * (original_mean / new_mean)