lint updates and diffusers installer

This commit is contained in:
Vladimir Mandic
2024-09-06 14:10:53 -04:00
parent 8a5722fc88
commit f2c5cbbb36
26 changed files with 75 additions and 83 deletions
+3 -3
View File
@@ -679,12 +679,12 @@ def get_weighted_text_embeddings_sdxl_refiner(
for j in range(len(weight_tensor_2)):
if weight_tensor_2[j] != 1.0:
ow = weight_tensor_2[j] - 1
# ow = weight_tensor_2[j] - 1
# optional process
# To map number of (0,1) to (-1,1)
tanh_weight = (math.exp(ow) / (math.exp(ow) + 1) - 0.5) * 2
weight = 1 + tanh_weight
# tanh_weight = (math.exp(ow) / (math.exp(ow) + 1) - 0.5) * 2
# weight = 1 + tanh_weight
# add weight method 1:
# token_embedding[j] = token_embedding[j] * weight