Description
An interactive visualization node for ComfyUI context windows. It displays window placement, overlap, fuse weights, and per-frame blending in real time as parameters are adjusted. When a model is connected, the node optionally applies the configured context window settings to the model during sampling, functioning similarly to the core Context Windows (Manual) node.
Inputs
All inputs control the visualization and, when a model is connected, the applied context window behavior.
-
model (
MODEL, optional)
An optional model to apply the context windows to during sampling. When disconnected, only the visualization is shown. -
frame_units (
COMBO, default:pixel)
Units for frame counts.pixel: Converts pixel frame indices to latent indices via((n - 1) // temporal_downscale) + 1.latent: Frame counts are treated as latent frame indices directly.
-
dim (
INT, default:2, range: 0–5)
Latent temporal dimension index.2is typical for WAN-like architectures;0for AnimateDiff-style. Only relevant when a model is connected (“model path”). -
temporal_downscale (
INT, default:4, range: 1–16)
VAE temporal compression factor used whenframe_units = pixel. Common values: WAN/Hunyuan/CogVideoX = 4, Mochi = 6, LTXV = 8. -
num_frames (
INT, default:161, range: 1–100000)
Total number of frames to visualize when no model is connected (visualization-only path). When a model is connected, this is ignored and the real latent length of the model is used. -
context_length (
INT, default:81, range: 1–100000)
Window length in frame units. -
context_overlap (
INT, default:30, range: 0–100000)
Number of overlapping frames between adjacent windows. -
context_schedule (
COMBO, no default)
Determines window placement strategy.standard_static_balanced: Static windows spread evenly across the frame range, guaranteeing uniform seams for any frame count.batched_shifted: Zero-overlap windows whose seam positions roll each sampling step (~1.0× compute; intended to pair with FreeNoise).
Uniform schedules (future additions) also shift per step.
-
context_stride (
INT, default:1, range: 1–32)
Maximum stride power for uniform schedules. Controls dilated windows (e.g. 1, 2, 4…). Only effective when a uniform schedule is selected. -
closed_loop (
BOOLEAN, default:False)
When enabled, wrap looped-schedule windows around from the end back to frame 0. -
fuse_method (
COMBO, default:pyramid)
Blending method for overlapping regions. Options represent different weighting strategies (e.g., pyramid, uniform, etc.). -
causal_window_fix (
BOOLEAN, default:False)
Prepend an anchor frame to non‑zero windows (except the first), which is stripped after the model call. Useful for causal temporal attention. -
freenoise (
BOOLEAN, default:True)
Enable FreeNoise noise shuffling for smoother blending across windows. Only relevant when a model is connected (“model path”). -
cond_retain_index_list (
STRING, default:"")
Comma‑separated list of window‑relative frame indices whose conditioning is reused across windows. For example,"0"reuses the first frame’s conditioning per window. Has no effect on the visualization; only applies when a model is connected.
Outputs
MODEL
If a model was supplied as input, the output is the same model with the configured context windows applied. If no model was supplied, the output isNone(the node acts purely as a visualization).
Usage Notes
- The visualization updates live as any parameter changes, providing immediate feedback on window placement, overlap, and blending.
- When using the node only for visualization (no model connected), the
num_framesinput sets the total frame count. Parameters marked “model path only” (dim,freenoise,cond_retain_index_list) are ignored. - Parameters effective only on the model path are clearly noted in their tooltips. The
frame_unitsconversion only matters when deriving latent indices from pixel counts; if you work directly in latent space, setframe_unitstolatent. - For schedules like
batched_shifted, pairing withfreenoiseis recommended for smooth transitions. - The
causal_window_fixoption is intended for models with causal attention (e.g., some video diffusion models) where each window needs a preceding anchor frame.
Comments
Sign in with GitHub to join the discussion.