Bernini Context Windows
Long video without the VRAM cliff
- model
- model
Bernini is the ByteDance video-editing model that took over local V2V in 2026 - and it's expensive. The source video you're editing is part of the model input, which is roughly double Wan 2.2's compute for the same output. The moment you push past a few seconds, the attention cost stops being a comfort problem and becomes a VRAM wall. Bernini Context Windows is this pack's answer: it lets you run Bernini with windowed attention, so the model only ever attends inside a sliding context instead of over the whole sequence at once.
Mechanically it's the same trick as LongVideo / FreeNoise-style context windowing that Wan workflows have used for a while, but wired for Bernini's reference-aware setup. You get the sliding window, the overlap between windows, and - this is the part the author cares about - the choice of where RoPE positions come from.
What the inputs do
- model - your Bernini
MODEL, in and out. - context_length - window length in real frames, default
81. Must be4*n + 1. - context_overlap - frames shared between adjacent windows, default
28. More overlap = smoother seams, more compute. - position_mode -
absolute(default) keeps global latent-frame RoPE positions;relativematches the official ComfyUI window-local positions. This is the reference-aware part: absolute positions keep the model's sense of "where in the video am I" intact across windows, which matters when a reference video and target are both in context. - context_schedule -
standard_static,standard_uniform(default),looped_uniform, orbatched. This decides how windows are laid out across denoising steps - whether the schedule changes per step or stays fixed. Uniform schedules also exposecontext_stride. - closed_loop - whether to wrap the context window into a loop (only for looped schedules).
- fuse_method - how window outputs blend back together:
pyramid(default),relative,flat, oroverlap-linear. Pyramid is the one the author ships as default for a reason; flat is the naive one. - freenoise - default on. FreeNoise noise shuffling that improves blending between windows. Leave it on.
Output: model, into your sampler.
How to install
Same pack, same ritual - it's part of ComfyUI Turing Utils ("comfyui-svdint4" in Manager):
cd ComfyUI/custom_nodes
git clone https://github.com/wjie98/comfyui-svdint4
cd comfyui-svdint4
python -m pip install -v --no-build-isolation -e ./kernel
The kernel build is the manual step, and it's where the attention pieces live; restart after.
The honest take
If your Bernini clips fit in VRAM without windowing, don't add this node - windowing costs a little quality at the seams no matter how good the fusion is, and "if it fits, just run it dense" is a real stance. This is the node you reach for when the source video is long enough that the model won't run at all, or when you're on a 20-series card that makes the "double Wan's compute" reputation literal. Start with the defaults - 81-frame windows, 28-frame overlap, absolute positions, pyramid fusion - and treat context_length and overlap as the two dials you'll actually adjust. Everything else is for people who've measured the seams and decided they care.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| context_length | INT | 811–16385 | The length of the context window in real frames. Must be 4*n + 1. |
| context_overlap | INT | 280–16384 | The overlap of the context window in real frames. |
| position_mode | COMBO | absolute | Absolute keeps global latent-frame RoPE positions; relative matches official ComfyUI window-local positions. |
| context_schedule | COMBO | standard_uniform | Step-dependent scheduling algorithm for context windows. |
| context_stride | INT | 11–32 | The stride of the context window; only applicable to uniform schedules. |
| closed_loop | BOOLEAN | false | Whether to close the context window loop; only applicable to looped schedules. |
| fuse_method | COMBO | pyramid | The method to use to fuse the context windows. |
| freenoise | BOOLEAN | true | Whether to apply FreeNoise noise shuffling, improves window blending. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |