Nodes/comfyui-svdint4/Bernini Context Windows
ComfyUI Node

Bernini Context Windows

Long video without the VRAM cliff

By wjie98·Created 2 months ago·Updated about 10 hours ago· 2
Bernini Context Windows
  • model
  • model
context_length81
context_overlap28
position_modeabsolute
context_schedulestandard_uniform
context_stride1
closed_loopfalse
fuse_methodpyramid
freenoisetrue

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 be 4*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; relative matches 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, or batched. This decides how windows are laid out across denoising steps - whether the schedule changes per step or stays fixed. Uniform schedules also expose context_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, or overlap-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.

CategoryTuring Utils/patches

Inputs (9)

NameTypeDefaultDescription
modelMODEL
context_lengthINT811–16385The length of the context window in real frames. Must be 4*n + 1.
context_overlapINT280–16384The overlap of the context window in real frames.
position_modeCOMBOabsoluteAbsolute keeps global latent-frame RoPE positions; relative matches official ComfyUI window-local positions.
context_scheduleCOMBOstandard_uniformStep-dependent scheduling algorithm for context windows.
context_strideINT11–32The stride of the context window; only applicable to uniform schedules.
closed_loopBOOLEANfalseWhether to close the context window loop; only applicable to looped schedules.
fuse_methodCOMBOpyramidThe method to use to fuse the context windows.
freenoiseBOOLEANtrueWhether to apply FreeNoise noise shuffling, improves window blending.

Outputs (1)

NameTypeDescription
modelMODEL