From bdcc05f388ad7ae6bd70e5809385ca7e112989bd Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Tue, 24 Feb 2026 19:24:06 +0100 Subject: [PATCH] Fix mode-unaware base_length recovery in VACE calculation The recovery formula now matches the storage formula per mode: End Extend subtracts only A, Pre Extend subtracts only B. Co-Authored-By: Claude Opus 4.6 --- tab_batch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tab_batch.py b/tab_batch.py index ce46091..ed5628e 100644 --- a/tab_batch.py +++ b/tab_batch.py @@ -461,8 +461,13 @@ def render_batch_processor(data, file_path, json_files, current_dir, selected_fi input_a = int(seq.get("input_a_frames", 16)) input_b = int(seq.get("input_b_frames", 16)) stored_total = int(seq.get("vace_length", 49)) - # Compute total based on mode formula - base_length = max(stored_total - input_a - input_b, 1) + # Reverse using same mode formula that was used to store + if mode_idx == 0: + base_length = max(stored_total - input_a, 1) + elif mode_idx == 1: + base_length = max(stored_total - input_b, 1) + else: + base_length = max(stored_total - input_a - input_b, 1) vl_col, vl_out = st.columns([3, 1]) new_base = vl_col.number_input("VACE Length", value=base_length, min_value=1, key=f"{prefix}_vl") if mode_idx == 0: # End Extend: base + A