Remove single-word transition markers from builtin list

Single words like "next", "suddenly", "later", "finally" etc. fire on
normal prompt text and cause spurious scene splits. Removed the entire
single-word temporal markers block. Shortest triggers are now two words
minimum. Also removes "and suddenly" and "and next" which were similarly
too vague.

Stray article-comma cleanup ("the, next" -> "the next") also applied when
building transition segments to handle commas left by the split.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
digital-garbage
2026-05-22 18:45:29 +03:00
co-authored by Claude Sonnet 4.6
parent 9b8948dc77
commit 39dba21f9f
+2 -9
View File
@@ -460,15 +460,8 @@ _PROMPT_TRANSITION_PHRASES = sorted([
"in the meantime", "in the meanwhile",
"at the same time", "at the same moment",
"by this point", "at this point", "at that point",
"and then", "but then", "and suddenly", "and next",
"and then", "but then",
"and finally", "and eventually",
# Single-word temporal markers
"next", "subsequently", "thereafter",
"suddenly", "abruptly", "instantly",
"meanwhile", "elsewhere", "simultaneously",
"later", "afterwards", "afterward",
"eventually", "finally", "ultimately",
"soon", "shortly",
], key=len, reverse=True)
_GENERIC_SCENE_LABEL_PATTERN = r"\bscene\s+(?:[-+]?\d+|minus\s+[a-z][\w-]*|[a-z][\w-]*)\b"
@@ -6140,7 +6133,7 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner):
following = following.strip().lstrip(",;.:").strip()
if current:
segments.append(current)
current = (trans_word + " " + following).strip().strip(",;.:").strip()
current = re.sub(r"\b(a|an|the),\s*", r"\1 ", (trans_word + " " + following).strip().strip(",;.:").strip(), flags=re.IGNORECASE).strip()
i += 2
if current:
segments.append(current)