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 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 19:24:06 +01:00
parent 31da900502
commit bdcc05f388

View File

@@ -461,7 +461,12 @@ def render_batch_processor(data, file_path, json_files, current_dir, selected_fi
input_a = int(seq.get("input_a_frames", 16)) input_a = int(seq.get("input_a_frames", 16))
input_b = int(seq.get("input_b_frames", 16)) input_b = int(seq.get("input_b_frames", 16))
stored_total = int(seq.get("vace_length", 49)) stored_total = int(seq.get("vace_length", 49))
# Compute total based on mode formula # 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) base_length = max(stored_total - input_a - input_b, 1)
vl_col, vl_out = st.columns([3, 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") new_base = vl_col.number_input("VACE Length", value=base_length, min_value=1, key=f"{prefix}_vl")