From a5da8b26f4eb49b477500f08415fbac1e437ba97 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 4 Apr 2026 00:14:25 +0200 Subject: [PATCH] feat: add 'logic index' field mirroring end_frame Temporary field to ease node migration. Initializes to end_frame's value and stays in sync whenever end_frame changes. Co-Authored-By: Claude Sonnet 4.6 --- tab_batch_ng.py | 16 ++++++++++++++-- tab_timeline_ng.py | 1 + utils.py | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tab_batch_ng.py b/tab_batch_ng.py index 44fb090..a3c955c 100644 --- a/tab_batch_ng.py +++ b/tab_batch_ng.py @@ -314,7 +314,7 @@ def render_batch_processor(state: AppState): standard_keys = { 'name', 'mode', 'general_prompt', 'general_negative', 'current_prompt', 'negative', 'prompt', 'seed', 'cfg', 'camera', 'flf', KEY_SEQUENCE_NUMBER, - 'frame_to_skip', 'end_frame', 'transition', 'vace_length', + 'frame_to_skip', 'end_frame', 'logic index', 'transition', 'vace_length', 'input_a_frames', 'input_b_frames', 'reference switch', 'vace schedule', 'middle frame path', 'video file path', 'start frame path', 'end frame path', } @@ -625,7 +625,19 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state, dict_input(ui.input, 'Camera', seq, 'camera').props('outlined').classes('w-full') dict_input(ui.input, 'FLF', seq, 'flf').props('outlined').classes('w-full') - dict_number('End Frame', seq, 'end_frame').props('outlined').classes('w-full') + ef_input = dict_number('End Frame', seq, 'end_frame').props('outlined').classes('w-full') + # Initialize logic index to end_frame if not yet set + if 'logic index' not in seq: + seq['logic index'] = seq.get('end_frame', 0) + li_input = dict_number('Logic Index', seq, 'logic index').props('outlined').classes('w-full') + + def _mirror_to_logic_index(ef=ef_input, li=li_input, s=seq): + v = s.get('end_frame', 0) + s['logic index'] = v + li.set_value(v) + + ef_input.on('blur', lambda _, m=_mirror_to_logic_index: m()) + ef_input.on('update:model-value', lambda _, m=_mirror_to_logic_index: m()) dict_input(ui.input, 'Video File Path', seq, 'video file path').props( 'outlined input-style="direction: rtl"').classes('w-full') diff --git a/tab_timeline_ng.py b/tab_timeline_ng.py index 548376c..9c48d85 100644 --- a/tab_timeline_ng.py +++ b/tab_timeline_ng.py @@ -619,6 +619,7 @@ def _render_preview_fields(item_data: dict): 'sequence_number', 'general_prompt', 'general_negative', 'current_prompt', 'prompt', 'negative', 'camera', 'flf', 'seed', 'resolutions', 'frame_to_skip', 'vace schedule', 'video file path', 'middle frame path', 'end frame path', 'start frame path', + 'logic index', } # also skip lora keys custom_keys = [ diff --git a/utils.py b/utils.py index 555d680..dc92a7f 100644 --- a/utils.py +++ b/utils.py @@ -38,6 +38,7 @@ DEFAULTS = { # --- I2V / VACE Specifics --- "frame_to_skip": 81, "end_frame": 0, + "logic index": 0, "transition": "1-2", "vace_length": 49, "vace schedule": 1,