From 665f8f1feb0beb1cc3e64e548fc24c49f31ef491 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Fri, 29 May 2026 00:46:32 +0300 Subject: [PATCH] Fix self_consistency: don't inject into anchor tokens, cap max at 0.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Middle-frame tokens are the anchor source — blending them with their own mean was pointless self-contamination and the main cause of collapse at higher strengths. Now only the surrounding frames (before mid_start and after mid_end) receive the injection; the anchor zone is left untouched each step. Max strength capped at 0.5 in the UI; tooltip warns against going high. Co-Authored-By: Claude Sonnet 4.6 --- samplers.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samplers.py b/samplers.py index 9f7dc036..3ab81e0e 100644 --- a/samplers.py +++ b/samplers.py @@ -800,7 +800,7 @@ class FunPackLTXAVSceneChainSampler: }), "self_consistency_strength": ("FLOAT", { "default": 0.05, "min": 0.01, "max": 0.5, "step": 0.01, - "tooltip": "Injection strength for self-consistency. Small values (0.02–0.1) add a soft constraint; larger values lock anatomy more aggressively.", + "tooltip": "Injection strength for self-consistency. Small values (0.02–0.1) add a soft constraint. Above 0.5 output degrades significantly — stay low.", }), "transition_duration": ("INT", { "default": 16, "min": 0, "max": 128, "step": 2, @@ -1322,10 +1322,14 @@ class FunPackLTXAVSceneChainSampler: x, is_dict = output, False if x is None or x.dim() < 2 or x.shape[1] < mid_end: return - # Mean of current step's middle-frame tokens → spread to all positions. - # Anchor updates every step so high-sigma noise never persists. + # Mean of current step's middle-frame tokens → spread to surrounding frames. + # Middle-frame tokens are left untouched (they are the anchor, not targets). mid_mean = x[:, mid_start:mid_end, :].mean(dim=1, keepdim=True) - out = (1.0 - strength) * x + strength * mid_mean.expand_as(x) + out = x.clone() + if mid_start > 0: + out[:, :mid_start, :] = (1.0 - strength) * x[:, :mid_start, :] + strength * mid_mean + if mid_end < x.shape[1]: + out[:, mid_end:, :] = (1.0 - strength) * x[:, mid_end:, :] + strength * mid_mean if is_dict: return {**output, "img": out} elif isinstance(output, tuple):