MCPcopy Create free account
hub / github.com/Lightricks/ComfyUI-LTXVideo / _to_binary_mask

Function _to_binary_mask

text_embeddings_connectors.py:33–37  ·  view source on GitHub ↗

Convert additive mask to binary [B, seq, 1] and zero out padding.

(encoded, encoded_mask)

Source from the content-addressed store, hash-verified

31
32
33def _to_binary_mask(encoded, encoded_mask):
34 """Convert additive mask to binary [B, seq, 1] and zero out padding."""
35 binary_mask = (encoded_mask < 0.000001).to(torch.int64)
36 binary_mask = binary_mask.reshape(encoded.shape[0], encoded.shape[1], 1)
37 return encoded * binary_mask, binary_mask
38
39
40def _rescale_norm(x: torch.Tensor, target_dim: int, source_dim: int) -> torch.Tensor:

Callers 2

create_embeddingsMethod · 0.85
create_embeddingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected