fix all precision issues

We fixed number precision issues again. Now 2.1.849 will give 100% exactly same results as 2.1.824.
This commit is contained in:
lllyasviel
2023-12-16 19:54:05 -08:00
committed by GitHub
parent efb312d495
commit 67808d5ee5
3 changed files with 75 additions and 153 deletions
+2 -3
View File
@@ -271,12 +271,11 @@ def sdxl_encode_adm_patched(self, **kwargs):
height = float(height) * positive_adm_scale
def embedder(number_list):
h = [self.embedder(torch.tensor([x], dtype=torch.float32)) for x in number_list]
h = torch.cat(h)
h = self.embedder(torch.tensor(number_list, dtype=torch.float32))
h = torch.flatten(h).unsqueeze(dim=0).repeat(clip_pooled.shape[0], 1)
return h
width, height = round_to_64(width), round_to_64(height)
width, height = int(width), int(height)
target_width, target_height = round_to_64(target_width), round_to_64(target_height)
adm_emphasized = embedder([height, width, 0, 0, target_height, target_width])