MCPcopy
hub / github.com/Lightricks/ComfyUI-LTXVideo / append_guide_attention_entry

Function append_guide_attention_entry

iclora_attention.py:22–53  ·  view source on GitHub ↗

Append a new guide attention entry to conditioning metadata. Called by guide-adding nodes after appending tokens. Args: conditioning: ComfyUI conditioning list. pre_filter_count: Token count for this guide (before grid_mask filtering). latent_shape: [F, H, W] of the

(
    conditioning,
    pre_filter_count,
    latent_shape,
    attention_strength=1.0,
    attention_mask=None,
)

Source from the content-addressed store, hash-verified

20
21
22def append_guide_attention_entry(
23 conditioning,
24 pre_filter_count,
25 latent_shape,
26 attention_strength=1.0,
27 attention_mask=None,
28):
29 """Append a new guide attention entry to conditioning metadata.
30
31 Called by guide-adding nodes after appending tokens.
32
33 Args:
34 conditioning: ComfyUI conditioning list.
35 pre_filter_count: Token count for this guide (before grid_mask filtering).
36 latent_shape: [F, H, W] of the pre-dilation guide latent.
37 attention_strength: Scalar in [0, 1]. 1.0 = full attention (default).
38 attention_mask: Optional pixel-space mask tensor, shape (1, 1, F, H, W).
39
40 Returns:
41 Updated conditioning.
42 """
43 existing_entries = _get_guide_attention_entries(conditioning)
44 entries = [*existing_entries]
45 entries.append(
46 {
47 "pre_filter_count": pre_filter_count,
48 "strength": attention_strength,
49 "pixel_mask": attention_mask,
50 "latent_shape": latent_shape,
51 }
52 )
53 return _set_guide_attention_entries(conditioning, entries)
54
55
56def normalize_mask(mask):

Callers 4

executeMethod · 0.85
executeMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85

Calls 2

Tested by

no test coverage detected