From 3e152e865c8c7eb716786934fd6c4e75d568e052 Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Wed, 20 May 2026 16:29:16 +0300 Subject: [PATCH] Fix critical bug: was reading conds[0] (negative) instead of max across all groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit conds = [uncond_list, cond_list] - conds[0] is the negative conditioning which always has exactly 1 entry. Reading len(conds[0]) always gave num_windows=1, so the schedule produced a single window covering all frames, and split_conds_to_windows picked the middle scene's conditioning for the entire video (center_ratio≈0.5 → region 1 of 3). Fix: max(len(c) for c in conds) correctly reads the positive conditioning (3 entries for 3 scenes) and creates 3 isolated windows. Also added 'the final scene' and 'the last scene' to transition phrases. Co-Authored-By: Claude Sonnet 4.6 --- conditioning.py | 2 +- context_transition.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conditioning.py b/conditioning.py index 19a286ad..92597f66 100644 --- a/conditioning.py +++ b/conditioning.py @@ -417,7 +417,7 @@ _PROMPT_TRANSITION_PHRASES = sorted([ # Ordinal scene markers - let users explicitly label scenes "the tenth scene", "the ninth scene", "the eighth scene", "the seventh scene", "the sixth scene", "the fifth scene", "the fourth scene", "the third scene", - "the second scene", "the first scene", + "the second scene", "the first scene", "the final scene", "the last scene", "scene ten", "scene nine", "scene eight", "scene seven", "scene six", "scene five", "scene four", "scene three", "scene two", "scene one", # Multi-word scene-cut language diff --git a/context_transition.py b/context_transition.py index 6bd73825..65dbb20c 100644 --- a/context_transition.py +++ b/context_transition.py @@ -104,9 +104,11 @@ class FunPackTransitionContextHandler(comfy.context_windows.IndexListContextHand ) self.dim = detected - # Detect how many conditioning entries Refiner/Studio produced + # Detect how many conditioning entries Refiner/Studio produced. + # conds = [uncond_list, cond_list, ...] - we read the MAX across all groups + # because conds[0] is the negative conditioning which always has 1 entry. try: - num_windows = max(1, len(conds[0])) if conds and conds[0] else 1 + num_windows = max((len(c) for c in conds if c), default=1) except Exception: num_windows = 1 self.auto_num_windows = num_windows