Context OptionsโBatched [Non-AD] ๐ญ๐ ๐
Sliding-window sampling without a motion module
- prev_context
- CONTEXT_OPTS
The [Non-AD] in this node's name is the important part: this is a Context Options node built to work without a motion module loaded at all. AnimateDiff-Evolved's sliding-context-window trick - process a batch of frames at a time with some overlap, so you can generate sequences longer than any single pass could handle - turned out useful on its own, separate from AnimateDiff itself. The README calls this out directly: "Usage of Context Options and Sample Settings outside of AnimateDiff via Gen2 Use Evolved Sampling node." This node is one of the Context Options variants that plugs into that path.
What "batched" means here
Kosinkadink's context-window system has more than one scheduling strategy - how windows overlap, whether they wrap around for a closed loop, whether the schedule changes partway through sampling. "Batched" is the simpler end of that spectrum: straightforward sequential chunks rather than the more elaborate uniform/looped windowing schemes used elsewhere in the pack. If you just want to process a long batch in manageable chunks without AnimateDiff's motion module in the picture, this is the more direct tool than the full context-options nodes built for AnimateDiff proper.
Inputs and output
context_length(int, default 16, range 1โ128, required) - how many items each window covers.start_percent(optional float, default 0) - where in the sampling process this configuration becomes active, letting you schedule different context settings at different points via chaining.guarantee_steps(optional int, default 1) - the minimum number of steps this configuration is guaranteed to run before a later scheduled change (viaprev_contextchaining) can take over.prev_context(optional,CONTEXT_OPTIONS) - chain another Context Options node in to build a schedule of changing settings across the sampling process, the same mechanism the README describes for "Scheduling Context Options to change across different points in the sampling process."- Output:
CONTEXT_OPTS(CONTEXT_OPTIONS) - wire this into your Gen2 "Use Evolved Sampling" node (or the equivalent AnimateDiff sampling chain if you are using a motion model).
Installing the pack
ComfyUI Manager: search AnimateDiff Evolved, confirm the author is Kosinkadink, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
restart. Because this node is specifically for the non-AnimateDiff path, you don't need a motion module downloaded at all to use it - just the base pack.
Common issues
Picking a context_length that's too short. Community comparisons of this exact overlap/length trade-off (from AnimateDiff proper, but the mechanics carry over) found short windows come out crisp but pick up visible artifacts at each transition, while longer windows with more overlap are noticeably slower without a proportional quality gain - one comparison landed on roughly a 32-length window with a 12-frame overlap as the sweet spot for their case, explicitly calling shorter windows "the most crisp, but there are too many artifacts for most use cases." Treat any single number as a starting point to test, not a rule - 128 being the ceiling here doesn't mean it's a good default.
Visible seams where windows meet. This is the single most commonly reported artifact with sliding-window sampling generally - a jump or morph exactly where one context window's output hands off to the next. If you're seeing it, the fix is usually more overlap between windows (shorter context_length relative to a fixed overlap, or restructuring the schedule via chained prev_context nodes) rather than assuming it's unrelated to context settings.
Confusing this with the AnimateDiff-specific Context Options. If you actually have a motion model loaded and want context windowing for AnimateDiff itself, there's a dedicated (non-[Non-AD]) Context Options node for that in this pack - this one is purpose-built for the case where there's no motion module at all.
No effect at all. Confirm CONTEXT_OPTS is actually wired into the Gen2 "Use Evolved Sampling" node - like every settings node in this pack, it does nothing sitting unconnected in the graph.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| context_length | INT | 161โ128 | โ |
| start_percentopt | FLOAT | 0.0000โ1 | โ |
| guarantee_stepsopt | INT | 10โ9007199254740991 | โ |
| prev_contextopt | CONTEXT_OPTIONS | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONTEXT_OPTS | CONTEXT_OPTIONS | โ |