Bernini-R Context Window
The temporal window node that makes it possible
- context_options
Bernini-R inherits Wan's 81-frame native attention window, and if you've ever tried to push past it on a single GPU you know the wall: VRAM scales with the whole video being in memory at once. BerniniR_ContextWindow is the pack's answer - it tells the sampler to split the video into overlapping temporal windows, denoise each one, and fuse the results. Same machinery as WanVideoWrapper's context options, and it's the difference between "can't fit 161 frames" and "161 frames at a cost you can actually pay."
How it works
The sampler holds only a sliding window of frames in attention at a time. This node configures how those windows are scheduled, how much they overlap, and how the overlapping regions are blended back together. Four knobs decide the behavior, and they interact - so it's worth understanding them as a set rather than individually:
- context_schedule -
static_standard(simple sliding window, fastest),uniform_standard(multi-stride, best quality),uniform_looped(cyclic, for seamless looping videos). - context_frames - pixel frames per window. The README notes 81 ≈ 20 latent frames. Smaller = less VRAM but more windows and more blending work. This is your primary VRAM lever.
- context_stride - stride levels on a log2 scale,
uniform_*only. Higher = more window positions = smoother but slower. - context_overlap - overlap between windows in pixel frames. 12-16 is typical; higher smooths transitions. When you see seams, this is the first thing to raise.
Plus two more in the optional row:
- freenoise - shuffles noise across windows to reduce seam artifacts. Keep it on.
- fuse_method - how overlapping regions blend:
smooth(smoothstep crossfade, softest seams),linear(crossfade at edges),pyramid(triangle weights peaking at center). The README suggestspyramidas the seam-fighting upgrade. - rope_ntk_scale - NTK RoPE frequency scaling for sequences longer than training. 1.0 = off; 2.0 lets the model handle ~2× training length before positional collapse sets in. If your long videos come out structurally wrong, this is the knob that fixes positional confusion.
Output and wiring
One output: context_options (BERNINI_CTX). It plugs into the context_options input of BerniniR_KSampler or BerniniR_DualExpertSampler. Leave it disconnected and sampling is single-pass - which is correct behavior for clips that fit.
The realistic play
There's no free lunch: windowed sampling trades VRAM for seams and extra compute. The community-tested pattern for long Bernini/Wan clips is to lower context_frames aggressively (41 or even 25), keep context_overlap at 16 or so, and pair the whole thing with BerniniR_BlockSwapArgs if you're under 16GB - the context windows handle temporal memory, block swap handles the weights. If seams show up, overlap first, then pyramid fuse, then uniform_standard. One warning: Bernini has no first-frame/last-frame chaining and doesn't work with SVI-style extension, so windowed generation is the way to get long takes here - and identity drift across chunks is a real, model-level limitation no amount of overlap fully fixes.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| context_schedule | COMBO | static_standard | Window scheduling: 'static_standard' = simple sliding (fastest), 'uniform_standard' = multi-stride (best quality), 'uniform_looped' = cyclic for seamless looping |
| context_frames | INT | 812–1000 | Pixel frames per window. 81 ≈ 20 latent frames. Smaller = less VRAM, more windows |
| context_stride | INT | 41–100 | Stride levels in log2 scale. Higher = more window positions (uniform_* only) |
| context_overlap | INT | 160–100 | Overlap between windows in pixel frames. Smooths transitions. 12-16 typical |
| freenoise | BOOLEAN | true | Shuffle noise across windows to reduce seam artifacts |
| fuse_methodopt | COMBO | smooth | Blending: 'smooth' (default) = smoothstep crossfade (softest seams), 'linear' = crossfade at edges, 'pyramid' = triangle weights peaking at center |
| rope_ntk_scaleopt | FLOAT | 1.001–8 | NTK RoPE frequency scaling for sequences longer than training. 1.0 = off. 2.0 = moderate (2x training length), 3.0+ = aggressive. Scales rope_embedder.theta to prevent positional collapse. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| context_options | BERNINI_CTX | — |