feat: remove cfg, flf, end_frame fields
These fields are no longer needed. Removed from DEFAULTS, UI widgets, standard_keys set, and timeline preview. Added _migrate_remove_keys() migration so existing JSON files are cleaned up transparently on load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-8
@@ -314,8 +314,8 @@ def render_batch_processor(state: AppState):
|
|||||||
'lora 3 high', 'lora 3 high strength', 'lora 3 low', 'lora 3 low strength']
|
'lora 3 high', 'lora 3 high strength', 'lora 3 low', 'lora 3 low strength']
|
||||||
standard_keys = {
|
standard_keys = {
|
||||||
'name', 'mode', 'general_prompt', 'general_negative', 'current_prompt', 'negative', 'prompt',
|
'name', 'mode', 'general_prompt', 'general_negative', 'current_prompt', 'negative', 'prompt',
|
||||||
'seed', 'cfg', 'camera', 'flf', KEY_SEQUENCE_NUMBER,
|
'seed', 'camera', KEY_SEQUENCE_NUMBER,
|
||||||
'frame_to_skip', 'end_frame', 'logic index', 'transition', 'vace_length',
|
'frame_to_skip', 'logic index', 'transition', 'vace_length',
|
||||||
'input_a_frames', 'input_b_frames', 'reference switch', 'vace schedule',
|
'input_a_frames', 'input_b_frames', 'reference switch', 'vace schedule',
|
||||||
'start frame path', 'start frame strength',
|
'start frame path', 'start frame strength',
|
||||||
'middle frame path', 'middle frame strength',
|
'middle frame path', 'middle frame strength',
|
||||||
@@ -610,13 +610,7 @@ def _render_sequence_card(i, seq, batch_list, data, file_path, state,
|
|||||||
|
|
||||||
ui.button(icon='casino', on_click=randomize_seed).props('flat')
|
ui.button(icon='casino', on_click=randomize_seed).props('flat')
|
||||||
|
|
||||||
# CFG
|
|
||||||
dict_number('CFG', seq, 'cfg', default=DEFAULTS['cfg'],
|
|
||||||
step=0.5, format='%.1f').props('outlined').classes('w-full')
|
|
||||||
|
|
||||||
dict_input(ui.input, 'Camera', seq, 'camera').props('outlined').classes('w-full')
|
dict_input(ui.input, 'Camera', seq, 'camera').props('outlined').classes('w-full')
|
||||||
dict_input(ui.input, 'FLF', seq, 'flf').props('outlined').classes('w-full')
|
|
||||||
ef_input = dict_number('End Frame', seq, 'end_frame').props('outlined').classes('w-full')
|
|
||||||
seq.setdefault('logic index', 0)
|
seq.setdefault('logic index', 0)
|
||||||
li_input = dict_number('Logic Index', seq, 'logic index').props('outlined readonly').classes('w-full')
|
li_input = dict_number('Logic Index', seq, 'logic index').props('outlined readonly').classes('w-full')
|
||||||
with li_input:
|
with li_input:
|
||||||
|
|||||||
+1
-2
@@ -577,7 +577,6 @@ def _render_preview_fields(item_data: dict):
|
|||||||
|
|
||||||
with ui.row().classes('w-full q-gutter-md'):
|
with ui.row().classes('w-full q-gutter-md'):
|
||||||
ui.input('Camera', value=str(item_data.get('camera', 'static'))).props('readonly outlined')
|
ui.input('Camera', value=str(item_data.get('camera', 'static'))).props('readonly outlined')
|
||||||
ui.input('FLF', value=str(item_data.get('flf', '0.0'))).props('readonly outlined')
|
|
||||||
ui.input('Seed', value=str(item_data.get('seed', '-1'))).props('readonly outlined')
|
ui.input('Seed', value=str(item_data.get('seed', '-1'))).props('readonly outlined')
|
||||||
|
|
||||||
with ui.expansion('LoRA Configuration'):
|
with ui.expansion('LoRA Configuration'):
|
||||||
@@ -617,7 +616,7 @@ def _render_preview_fields(item_data: dict):
|
|||||||
|
|
||||||
known_keys = {
|
known_keys = {
|
||||||
'sequence_number', 'general_prompt', 'general_negative', 'current_prompt', 'prompt',
|
'sequence_number', 'general_prompt', 'general_negative', 'current_prompt', 'prompt',
|
||||||
'negative', 'camera', 'flf', 'seed', 'resolutions',
|
'negative', 'camera', 'seed', 'resolutions',
|
||||||
'frame_to_skip', 'vace schedule', 'video file path', 'middle frame path', 'end frame path', 'start frame path',
|
'frame_to_skip', 'vace schedule', 'video file path', 'middle frame path', 'end frame path', 'start frame path',
|
||||||
'logic index',
|
'logic index',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,16 +28,13 @@ DEFAULTS = {
|
|||||||
"current_prompt": "",
|
"current_prompt": "",
|
||||||
"negative": "",
|
"negative": "",
|
||||||
"seed": -1,
|
"seed": -1,
|
||||||
"cfg": 1.5,
|
|
||||||
|
|
||||||
# --- Settings ---
|
# --- Settings ---
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
"camera": "static",
|
"camera": "static",
|
||||||
"flf": 0.0,
|
|
||||||
|
|
||||||
# --- I2V / VACE Specifics ---
|
# --- I2V / VACE Specifics ---
|
||||||
"frame_to_skip": 81,
|
"frame_to_skip": 81,
|
||||||
"end_frame": 0,
|
|
||||||
"logic index": 0,
|
"logic index": 0,
|
||||||
"transition": "1-2",
|
"transition": "1-2",
|
||||||
"vace_length": 49,
|
"vace_length": 49,
|
||||||
@@ -154,6 +151,17 @@ def save_snippets(snippets):
|
|||||||
json.dump(snippets, f, indent=4)
|
json.dump(snippets, f, indent=4)
|
||||||
os.replace(tmp, SNIPPETS_FILE)
|
os.replace(tmp, SNIPPETS_FILE)
|
||||||
|
|
||||||
|
_REMOVED_KEYS = {"cfg", "flf", "end_frame"}
|
||||||
|
|
||||||
|
def _migrate_remove_keys(data: dict) -> None:
|
||||||
|
"""Drop keys that have been removed from the schema."""
|
||||||
|
for item in data.get(KEY_BATCH_DATA, []):
|
||||||
|
if not isinstance(item, dict):
|
||||||
|
continue
|
||||||
|
for k in _REMOVED_KEYS:
|
||||||
|
item.pop(k, None)
|
||||||
|
|
||||||
|
|
||||||
def _migrate_key_renames(data: dict) -> None:
|
def _migrate_key_renames(data: dict) -> None:
|
||||||
"""Rename legacy keys to their current names."""
|
"""Rename legacy keys to their current names."""
|
||||||
for item in data.get(KEY_BATCH_DATA, []):
|
for item in data.get(KEY_BATCH_DATA, []):
|
||||||
@@ -225,6 +233,7 @@ def load_json(path: str | Path) -> tuple[dict[str, Any], float]:
|
|||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
|
_migrate_remove_keys(data)
|
||||||
_migrate_key_renames(data)
|
_migrate_key_renames(data)
|
||||||
_migrate_lora_keys(data)
|
_migrate_lora_keys(data)
|
||||||
t2 = time.time()
|
t2 = time.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user