fix: replace assert with if/raise for pre_filter_count validation

assert is stripped under python -O; use explicit if/raise ValueError
so the invariant check is always active.
This commit is contained in:
tavi 2026-02-22 00:13:57 +00:00 committed by tavihalperin
parent 38e76f7b09
commit cc9986d268

View File

@ -916,10 +916,11 @@ class LTXVModel(LTXBaseModel):
guide_entries = kwargs.get("guide_attention_entries", None)
if guide_entries:
total_pfc = sum(e["pre_filter_count"] for e in guide_entries)
assert total_pfc == len(kf_grid_mask), (
f"guide pre_filter_counts ({total_pfc}) != "
f"keyframe grid mask length ({len(kf_grid_mask)})"
)
if total_pfc != len(kf_grid_mask):
raise ValueError(
f"guide pre_filter_counts ({total_pfc}) != "
f"keyframe grid mask length ({len(kf_grid_mask)})"
)
resolved_entries = []
offset = 0
for entry in guide_entries: