From f97f8a06163cc66d64f76256819fac220d473711 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 3 Apr 2026 01:11:07 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20resolutions=20=E2=80=94=206=20fixed=20s?= =?UTF-8?q?lots,=20always=20visible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- tab_batch_ng.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tab_batch_ng.py b/tab_batch_ng.py index 9ff24e2..b9386a1 100644 --- a/tab_batch_ng.py +++ b/tab_batch_ng.py @@ -553,10 +553,13 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state, dict_textarea('Specific Negative', seq, 'negative').classes( 'w-full q-mt-sm').props('outlined rows=2') - # --- Resolutions --- + # --- Resolutions (6 fixed slots) --- ui.label('Resolutions').classes('text-caption text-weight-bold q-mt-md') - series: list = seq.setdefault('resolutions', []) - for idx, entry in enumerate(series): + resolutions = seq.setdefault('resolutions', []) + while len(resolutions) < 6: + resolutions.append([512, 512]) + for idx in range(6): + entry = resolutions[idx] with ui.row().classes('items-center w-full q-mt-xs'): ui.label(str(idx)).classes('text-caption').style('min-width:20px') w_inp = ui.number(value=int(entry[0]), min=1, step=1, label='W').classes( @@ -574,18 +577,6 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state, w_inp.on('blur', lambda _, s=_sync_wh: s()) h_inp.on('blur', lambda _, s=_sync_wh: s()) - def del_row(i=idx): - if i < len(seq.get('resolutions', [])): - seq['resolutions'].pop(i) - commit() - ui.button(icon='remove', on_click=del_row).props('flat dense round size=xs') - - def add_resolution(): - seq.setdefault('resolutions', []).append([512, 512]) - commit() - ui.button(f'+ Add Resolution {len(series)}', icon='add', on_click=add_resolution).props( - 'flat dense size=sm').classes('q-mt-xs') - with splitter.after: # Mode dict_number('Mode', seq, 'mode').props('outlined').classes('w-full')