diff --git a/app.py b/app.py index 5ac1bd9..ac674d5 100644 --- a/app.py +++ b/app.py @@ -137,16 +137,12 @@ with st.sidebar: with st.expander("Create New JSON"): new_filename = st.text_input("Filename", placeholder="my_prompt_vace") - is_batch = st.checkbox("Is Batch File?") if st.button("Create"): if not new_filename.endswith(".json"): new_filename += ".json" path = st.session_state.current_dir / new_filename - if is_batch: - first_item = DEFAULTS.copy() - first_item[KEY_SEQUENCE_NUMBER] = 1 - data = {KEY_BATCH_DATA: [first_item]} - else: - data = DEFAULTS.copy() + first_item = DEFAULTS.copy() + first_item[KEY_SEQUENCE_NUMBER] = 1 + data = {KEY_BATCH_DATA: [first_item]} save_json(path, data) st.rerun() diff --git a/utils.py b/utils.py index 092f248..9ed349d 100644 --- a/utils.py +++ b/utils.py @@ -132,8 +132,11 @@ def get_file_mtime(path: str | Path) -> float: return 0 def generate_templates(current_dir: Path) -> None: - """Creates dummy template files if folder is empty.""" - save_json(current_dir / "template_i2v.json", DEFAULTS) + """Creates batch template files if folder is empty.""" + first = DEFAULTS.copy() + first[KEY_SEQUENCE_NUMBER] = 1 + save_json(current_dir / "batch_prompt_i2v.json", {KEY_BATCH_DATA: [first]}) - batch_data = {KEY_BATCH_DATA: [DEFAULTS.copy(), DEFAULTS.copy()]} - save_json(current_dir / "template_batch.json", batch_data) + first2 = DEFAULTS.copy() + first2[KEY_SEQUENCE_NUMBER] = 1 + save_json(current_dir / "batch_prompt_vace_extend.json", {KEY_BATCH_DATA: [first2]})