Skip to content

Commit

Permalink
fix mask shape
Browse files Browse the repository at this point in the history
  • Loading branch information
lldacing committed Jan 22, 2025
1 parent 9d507db commit 89e4ac5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PulidFluxHook.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def pulid_patch(img, pulid_model=None, ca_idx=None, weight=1.0, embedding=None,
patch_size = transformer_options[PatchKeys.running_net_model].patch_size
mask = comfy.ldm.common_dit.pad_to_patch_size(mask, (patch_size, patch_size))
mask = rearrange(mask, "b c (h ph) (w pw) -> b (h w) (c ph pw)", ph=patch_size, pw=patch_size)
# (b, seq_len, _) =>(b, seq_len, seq_len)
mask = mask[..., 0].unsqueeze(-1).repeat(1, 1, mask.shape[1]).to(dtype=pulid_img.dtype)
# (b, seq_len, _) =>(b, seq_len, pulid.dim)
mask = mask[..., 0].unsqueeze(-1).repeat(1, 1, pulid_img.shape[-1]).to(dtype=pulid_img.dtype)
del patch_size, latent_image_shape

pulid_img = pulid_img * mask
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui_pulid_flux_ll"
description = "The implementation for PuLID-Flux, support use with TeaCache and WaveSpeed, no model pollution."
version = "1.0.8"
version = "1.0.9"
license = {file = "LICENSE"}
dependencies = ['facexlib', 'insightface', 'onnxruntime', 'onnxruntime-gpu; sys_platform != "darwin" and platform_machine == "x86_64"', 'ftfy', 'timm']

Expand Down

0 comments on commit 89e4ac5

Please sign in to comment.