Nodes/AnimateDiff Evolved/ContextRef Tuneβ—†Attn πŸŽ­πŸ…πŸ…“
ComfyUI Node Runs on cloud

ContextRef Tuneβ—†Attn πŸŽ­πŸ…πŸ…“

Dial in the attention-injection strength

By KosinkadinkΒ·Created 3 years agoΒ·Updated 8 days agoΒ· 3,519
ContextRef Tuneβ—†Attn πŸŽ­πŸ…πŸ…“
    • CONTEXTREF_TUNE
    β—„attn_style_fidelity1.00β–Ί
    β—„attn_ref_weight1.00β–Ί
    β—„attn_strength1.00β–Ί

    ContextRef keeps a long render consistent by injecting the reference window's attention features into every later window. This node is where you tune how hard that injection actually pulls - three dials, all defaulting to full strength.

    What it does

    All three inputs are optional floats, 0–1, defaulting to 1:

    • attn_style_fidelity - how strongly later windows are pulled toward the reference's style and identity versus letting the model's own generation for that window come through unmodified.
    • attn_ref_weight - how much weight the reference window's attention features get relative to each later window's own features when they're blended together.
    • attn_strength - an overall multiplier on the whole attention-injection effect, sitting above the other two.

    Output is CONTEXTREF_TUNE, which wires into ContextRef's contextref_tune input, or a Keyframe node's tune_replace. Leave this node out entirely and ContextRef still works - it just runs on its own baked-in defaults instead of this explicit configuration.

    Reading the defaults

    All three at 1.0 is maximum lock: every later window leans as hard as the mechanism allows on the reference's attention features. That's a reasonable starting point for a render where consistency matters more than natural per-window variation - but it's also the setting most likely to make motion feel frozen, or let details from the reference frame bleed into frames where they shouldn't. If a render using ContextRef looks too locked - later frames feel static, or a pose or expression from the reference shows up somewhere it shouldn't - this node, not strength_multival on the parent ContextRef node, is the first place to back off.

    How this differs from Tune Β· Attn+Adain

    This node only touches attention - the mechanism that lets later windows borrow identity and structural cues from the reference. It doesn't do anything to color or lighting statistics directly. If two windows keep matching in composition but drifting in color grading, that's the sign you want the sibling Tune Β· Attn+Adain node instead, which adds a second layer of statistical color matching on top of the same three attention dials found here.

    Installing it

    ComfyUI Manager: search AnimateDiff Evolved, author Kosinkadink, install, restart. Manually: git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved into custom_nodes, restart.

    The honest state of tuning advice here

    There's no meaningful body of community testing to draw exact numbers from - ContextRef barely shows up in public workflow discussion at all. Treat the three dials as a starting-point-and-adjust problem: render a short test clip at the 1.0 defaults, and if it's over-locked, drop attn_style_fidelity first (it's the most direct "how much like the reference" knob), then attn_ref_weight, before touching the overall attn_strength multiplier.

    CategoryAnimate Diff πŸŽ­πŸ…πŸ…“/context opts/context extras/contextref

    Inputs (3)

    NameTypeDefaultDescription
    attn_style_fidelityoptFLOAT1.000–1β€”
    attn_ref_weightoptFLOAT1.000–1β€”
    attn_strengthoptFLOAT1.000–1β€”

    Outputs (1)

    NameTypeDescription
    CONTEXTREF_TUNECONTEXTREF_TUNEβ€”