mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
+1
-1
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user