TemporalSplitAttnMask (Midframe)
Splitting self- and cross-attention at one pivot point each
- temporal_mask
This is the "just split it down the middle" version of TemporalSplitAttnMask. Instead of four separate start/stop numbers, you give it one pivot frame for self-attention and one for cross-attention, and it splits your clip there - same idea of controlling motion consistency and prompt injection independently, with a simpler API for the common case where you genuinely want a two-way split rather than an arbitrary window somewhere in the middle. It's the node most people actually reach for first, precisely because most temporal-conditioning use cases really are "the prompt changes partway through," not an arbitrary mid-clip window.
How it works
Self-attention (frame-to-frame relationships, the thing keeping motion and structure consistent) and cross-attention (where your text conditioning reaches in) each get one midpoint. Everything before that frame is one side, everything after is the other, and invert flips which side counts as "on" for that attention type. Because the two pivots are independent, you can still stagger where motion consistency changes versus where the prompt changes - you're just choosing a split point instead of a window.
The inputs and outputs that matter
self_attn_midframe(default 33) - where the self-attention split happens.cross_attn_midframe(default 33) - where the cross-attention split happens. Set it differently fromself_attn_midframeif you want the prompt to change at a different point than motion consistency does.self_attn_invert/cross_attn_invert(booleans, default false) - flip which side of each split is active.frames(default 65) - your clip's total frame count.- Output:
temporal_mask(MASK).
Defaults again land on Wan's 4k+1 frame pattern (33, 65) - expected, given this whole system is built around Wan's causal VAE compression.
How to install it
Via ComfyUI Manager: search RES4LYF, install, restart.
Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF
cd RES4LYF
pip install -r requirements.txt
Portable installs: use the embedded Python's pip.exe. As with the rest of this mask family, the "intro to clownsampling" example workflow in the repo is the fastest way to see how these plug into an actual temporal conditioning setup rather than guessing from the node alone.
Common issues & troubleshooting
Wan only. Same as every node in this family - this is specifically for Wan's frame-by-frame temporal conditioning, not a general video tool.
frames mismatched with your real clip length. If it doesn't match what you're actually generating, both midpoints land somewhere other than where you intended. Set this to your true output frame count first.
Needing an off-center or arbitrary window instead of a clean split. This node only gives you one pivot per attention type. If you need an arbitrary start/stop range rather than a two-way split - say, a prompt that only applies to the middle third of a clip - go back to the full TemporalSplitAttnMask node instead.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| self_attn_midframe | INT | 331–18446744073709550000 | — |
| cross_attn_midframe | INT | 331–18446744073709550000 | — |
| self_attn_invert | BOOLEAN | false | — |
| cross_attn_invert | BOOLEAN | false | — |
| frames | INT | 651–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| temporal_mask | MASK | — |