From ace616d287f05f3f258ae0eef0c2b5d2b8d323e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:16:52 +0000 Subject: [PATCH] Fix inverted lerp weights in slerp near-parallel shortcut The nearly-parallel fast path interpolated in the wrong direction: at val=0 it returned hi instead of lo, opposite to both the general slerp formula below and the sibling near-orthogonal shortcut. Affects subseed/variation strength when base and subseed noise are nearly parallel. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- modules/processing_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/processing_helpers.py b/modules/processing_helpers.py index 530e8e06b..57311cbca 100644 --- a/modules/processing_helpers.py +++ b/modules/processing_helpers.py @@ -183,7 +183,7 @@ def slerp(val, lo, hi): # from https://discuss.pytorch.org/t/help-regarding-sler dot = (lo_norm * hi_norm).sum(1) dot_mean = dot.mean() if dot_mean > 0.9999: # simplifies slerp to lerp if vectors are nearly parallel - return lo * val + hi * (1 - val) + return lo * (1 - val) + hi * val if dot_mean < 0.0001: # also simplifies slerp to lerp to avoid division-by-zero later on return lo * (1.0 - val) + hi * val omega = torch.acos(dot)