Fix critical bug: was reading conds[0] (negative) instead of max across all groups

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 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-05-20 16:29:16 +03:00
co-authored by Claude Sonnet 4.6
parent a8cda301c9
commit 3e152e865c
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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
+4 -2
View File
@@ -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