UNetTemporalAttentionMultiply
The four-knob attention mixer for video models
- model
- MODEL
Video models have a problem the image models never faced: they attend over time as well as space. A pixel should care what its neighbors look like in the same frame, and also what the matching pixel looked like in the frame before. UNetTemporalAttentionMultiply is the node that lets you turn those two attentions up and down independently, with four multipliers split across self/cross and structural/temporal.
It's the most specialized of the four attention-multiply nodes ComfyUI added in April 2024, and fittingly it's the one with the most search impressions - a whole two of them. Still essentially unused, still marked experimental, but for video work it's the one with a real job to do: temporal attention is where flicker, warping, and "the whole frame vibrates" artifacts come from, and it's also where motion lives. Damp the temporal side and you get calmer, more static output; boost it and motion gets more assertive. The spatial side controls within-frame structure, same as the static-image multiply nodes.
How it works
The node clones your model and registers runtime patches on the attention output projections - the keys ending attn1.to_out.0 (self-attention) and attn2.to_out.0 (cross-attention), weights and biases. Then it makes one decision per key: does the name contain .time_stack.? If yes, that weight belongs to a temporal attention block and gets the _temporal multiplier; if not, it's a spatial block and gets the _structural one.
That .time_stack. check is the whole game. It's the naming used by video architectures built on the openai-style UNet with temporal transformer blocks - the LTX-Video lineage and friends, whose state dicts embed a time_stack of transformer blocks next to the spatial ones. Wan and FLUX use different layouts entirely, so don't expect this to touch them.
So the four inputs, all floats 0–10 default 1.0:
- self_structural - self-attention in the spatial blocks (within-frame structure)
- self_temporal - self-attention in the temporal blocks (across-frame coherence)
- cross_structural - cross-attention in the spatial blocks (prompt influence per frame)
- cross_temporal - cross-attention in the temporal blocks (prompt influence across time)
Wire it exactly like the other model-patch nodes: Load Checkpoint → UNetTemporalAttentionMultiply → KSampler, output is a patched MODEL. Note it only scales the to_out projections - the q/k/v scaling the static UNet nodes offer doesn't exist here, which keeps it to one effect per knob.
The traps
Two, both real. First, whether cross_temporal does anything depends on the model: some video architectures build their temporal blocks with cross-attention disabled entirely, in which case there are simply no matching keys and that knob is a silent no-op. Second, the usual exact-suffix gotcha - wrong architecture, zero patches, no error, identical output. Video models are slow and VRAM-hungry; if you're iterating on multipliers, start with a short clip and a few steps, keep every value within a few percent of 1.0, and render the baseline first. It ships with ComfyUI core, nothing to install, and like its siblings it's a probe more than a production tool - but for "why does my video shimmer" it's the most direct answer in the experimental drawer.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| self_structural | FLOAT | 1.000–10 | — |
| self_temporal | FLOAT | 1.000–10 | — |
| cross_structural | FLOAT | 1.000–10 | — |
| cross_temporal | FLOAT | 1.000–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |