Merge branch 'main_upstream'

This commit is contained in:
Manuel Schmid
2023-12-16 16:17:37 +01:00
10 changed files with 134 additions and 244 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ def encode_vae_inpaint(vae, pixels, mask):
latent_mask = mask[:, None, :, :]
latent_mask = torch.nn.functional.interpolate(latent_mask, size=(H * 8, W * 8), mode="bilinear").round()
latent_mask = torch.nn.functional.max_pool2d(latent_mask, (8, 8)).round()
latent_mask = torch.nn.functional.max_pool2d(latent_mask, (8, 8)).round().to(latent)
return latent, latent_mask
+4 -3
View File
@@ -269,9 +269,10 @@ def sdxl_encode_adm_patched(self, **kwargs):
height = float(height) * positive_adm_scale
def embedder(number_list):
h = [self.embedder(torch.Tensor([number])) for number in number_list]
y = torch.flatten(torch.cat(h)).unsqueeze(dim=0).repeat(clip_pooled.shape[0], 1)
return y
h = torch.tensor(number_list, dtype=torch.float32)
h = self.embedder(h)
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)
target_width, target_height = round_to_64(target_width), round_to_64(target_height)