TemporalMaskGenerator
The simplest way to split a Wan clip into two prompts
- temporal_mask
Of RES4LYF's temporal mask family, this is the plain one. You're not windowing self-attention and cross-attention separately, you're not picking arbitrary start/stop ranges - you're just saying "everything before this frame is zone A, everything after is zone B." If all you want is a two-prompt Wan clip, TemporalMaskGenerator is the fastest way there.
How it works
It's a single switch point across your clip's timeline. Give it your clip's total frame count and a frame to split at, and it returns a mask that's on for one side of that split and off for the other - flip which side with invert_mask. That mask then feeds into whatever temporal conditioning setup you're using to say "this half of the clip listens to this prompt."
It's worth being clear about what this node doesn't do, because the name invites confusion: it doesn't touch conditioning, it doesn't know what your prompts say, and it doesn't decide what a frame looks like. It only produces the boolean split. The actual "this zone gets this text" wiring happens downstream, in whatever temporal conditioning combine node you're using alongside it - this is purely the timeline-splitting half of the job.
The inputs and outputs that matter
switch_frame(default 33) - the frame where the split happens.frames(default 65) - your clip's total frame count, so the node knows where the far edge is.invert_mask(boolean, default false) - flips which side of the split is "on."- Output:
temporal_mask(MASK).
Both defaults land on Wan's 4k+1 frame-count pattern (33, 65) - a reminder that these numbers aren't arbitrary round figures, they're tied to how Wan's VAE compresses time.
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: point at the embedded Python's pip.exe instead. Grab the pack's "intro to clownsampling" example workflow from its example_workflows/ folder if you're setting up temporal conditioning for the first time - the wiring around these mask nodes isn't self-explanatory from the node alone.
Common issues & troubleshooting
Wan only. Frame-by-frame temporal conditioning in this pack is specifically a Wan feature - don't expect it to do anything useful on an image model or a different video architecture.
frames doesn't match your actual clip. If the total you set here is off from what your sampler is actually generating, the split lands somewhere other than where you think it does. Match it to your real frame count first.
Needing more than one split point. This node only gives you a single switch frame. For more zones, you'll be stacking multiple mask nodes against your conditioning-combine node rather than expecting one TemporalMaskGenerator to do it - and if you need self-attention and cross-attention windowed differently rather than together, that's TemporalSplitAttnMask's job, not this one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| switch_frame | INT | 331–18446744073709550000 | — |
| frames | INT | 651–18446744073709550000 | — |
| invert_mask | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| temporal_mask | MASK | — |