Skip to content

feat: Add optional attention_mask input to LTXVAddGuide (CORE-220)#13965

Merged
alexisrolland merged 5 commits into
Comfy-Org:masterfrom
drozbay:20260518a_add_attention_mask_ltxvaddguide
May 18, 2026
Merged

feat: Add optional attention_mask input to LTXVAddGuide (CORE-220)#13965
alexisrolland merged 5 commits into
Comfy-Org:masterfrom
drozbay:20260518a_add_attention_mask_ltxvaddguide

Conversation

@drozbay
Copy link
Copy Markdown
Contributor

@drozbay drozbay commented May 18, 2026

LTXVAddGuide gets an optional attention_mask input, matching the attention_mask input on Lightricks's LTXAddVideoICLoRAGuideAdvanced custom node from ComfyUI-LTXVideo. It is a pixel-space mask that controls per-region conditioning influence, multiplied by the node's existing strength. With nothing connected, behavior is unchanged.

image

The LTXV model code already reads each guide's pixel_mask and applies it when weighting that guide's self-attention.

Workflow for testing:

This example shows using a temporally fading attention mask to allow smoother transitions for first and last frame inputs when combined with IC-lora control.
(Uses ComfyUI-KJNodes for Fade Mask)

droz_LTX23_attention_mask_example_v1.json

image

Expected output:

ComfyUI_00126_.mp4

Input assets for test workflow:

input_assets.zip

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9e214876-121c-4388-8913-c642b3d629f6

📥 Commits

Reviewing files that changed from the base of the PR and between 71bae5e and c2dadd6.

📒 Files selected for processing (1)
  • comfy_extras/nodes_lt.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • comfy_extras/nodes_lt.py

📝 Walkthrough

Walkthrough

This PR adds an optional attention_mask input to LTXVAddGuide and threads it through LTXVAddGuide.execute into _append_guide_attention_entry. When provided, attention_mask is unsqueezed to a (1,1,F,H,W)-compatible pixel_mask per guide entry; otherwise pixel_mask is None. A comment clarifies guide entries are shallow-copied and pixel_mask is not mutated.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding an optional attention_mask input to the LTXVAddGuide node, with a relevant ticket reference.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the attention_mask input, its integration with existing functionality, and providing testing examples and assets.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexisrolland alexisrolland merged commit 292814c into Comfy-Org:master May 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants