Nodes/AnimateDiff Evolved/Context Optionsโ—†Looped Uniform ๐ŸŽญ๐Ÿ…๐Ÿ…“
ComfyUI Node Runs on cloud

Context Optionsโ—†Looped Uniform ๐ŸŽญ๐Ÿ…๐Ÿ…“

The node for actual seamless loops

By KosinkadinkยทCreated 3 years agoยทUpdated 8 days agoยท 3,519
Context Optionsโ—†Looped Uniform ๐ŸŽญ๐Ÿ…๐Ÿ…“
  • prev_context
  • view_opts
  • CONTEXT_OPTS
โ—„context_length16โ–บ
โ—„context_stride1โ–บ
โ—„context_overlap4โ–บ
โ—„closed_loopfalseโ–บ
โ—„fuse_methodโ–พโ–บ
โ—„use_on_equal_lengthfalseโ–บ
โ—„start_percent0.000โ–บ
โ—„guarantee_steps1โ–บ

This is ADE_StandardUniformContextOptions with one extra switch that matters a lot: closed_loop. Everything else about it - the sliding 16-frame windows, the overlap-blending that lets you generate arbitrary-length clips on fixed VRAM - is identical to the Standard variant. What's different is that with closed_loop on, the sliding windows wrap around, so the sequence's end blends back into its beginning instead of just stopping. That's the actual mechanism behind one of AnimateDiff's most-cited surviving advantages: genuine cyclic loops, not a stitched-together transition.

That distinction is worth being explicit about, because it's one of the few things newer video models still haven't cleanly replicated. Wan-based tooling eventually shipped its own loop feature (the VACE Video Joiner's "Make Loop" toggle), but it works by generating a transition clip back to the first frame - visible morphing at the join is the accepted tradeoff there. This node's loop is native to how the motion module samples, closer to actually cyclic than stitched.

How it works

Same sliding-window mechanics as Standard Uniform: overlapping context_length-frame windows spaced by context_stride, blended across context_overlap frames. The closed_loop flag changes how windows are generated at the sequence boundary - instead of the first and last windows being independent, they're connected, so motion that starts your clip is the same motion that finishes it.

The inputs and outputs that matter

Required: context_length (default 16, match your motion module's native window), context_stride (default 1), context_overlap (default 4), and the one that makes this node worth picking over Standard: closed_loop (boolean, default false - you have to turn it on).

Optional, identical to the Standard variant: fuse_method for how overlapping frames blend, start_percent and guarantee_steps for scheduling, prev_context for chaining multiple Context Options for different phases of sampling, and view_opts for a nested inner sliding window. Output is CONTEXT_OPTS, plugged into a loader's or Use Evolved Sampling's context_options input.

How to install it

Standard for the pack - ComfyUI Manager, search AnimateDiff Evolved by Kosinkadink, or:

cd ComfyUI/custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved

No model download specific to this node - it configures sampling on top of whatever motion module you've already loaded elsewhere in the graph.

Common issues & troubleshooting

Turned on closed_loop and it still doesn't loop cleanly. Loops work best with prompts and motion that are inherently cyclic to begin with - a camera pan that ends exactly where it started, or ambient motion without a hard directional arc. If your prompt describes something that clearly goes from A to B, no context setting will make the end match the beginning gracefully.

Same overlap-seam morphing as any sliding-window setup. Raise context_overlap for a smoother blend at window boundaries, or trim denoise slightly on the affected pass - same fix as the non-looped Standard variant.

Not sure whether to use this or Standard. If you don't need the clip to loop back on itself, use ADE_StandardUniformContextOptions - it's the same node minus one flag, and simpler to reason about. Reach for this one specifically when the deliverable is a looping GIF or video.

CategoryAnimate Diff ๐ŸŽญ๐Ÿ…๐Ÿ…“/context opts

Inputs (10)

NameTypeDefaultDescription
context_lengthINT161โ€“128โ€”
context_strideINT11โ€“32โ€”
context_overlapINT40โ€“128โ€”
closed_loopBOOLEANfalseโ€”
fuse_methodoptCOMBO9 options: pyramid, flat, overlap-linear, ๐Ÿ”ฌdelayed reverse sawtooth, ๐Ÿ”ฌpyramid-sigma, ๐Ÿ”ฌpyramid-sigma inverse, +3
use_on_equal_lengthoptBOOLEANfalseโ€”
start_percentoptFLOAT0.0000โ€“1โ€”
guarantee_stepsoptINT10โ€“9007199254740991โ€”
prev_contextoptCONTEXT_OPTIONSโ€”
view_optsoptVIEW_OPTSโ€”

Outputs (1)

NameTypeDescription
CONTEXT_OPTSCONTEXT_OPTIONSโ€”