From 8f3936700d5beac0cd2610abc7e1425e1c4da0d5 Mon Sep 17 00:00:00 2001 From: aimfordeb <133010426+aimfordeb@users.noreply.github.com> Date: Mon, 26 Jan 2026 01:22:53 +0200 Subject: [PATCH] Updated sequence generation logic --- funpack.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/funpack.py b/funpack.py index a24e9afe..06e2a1bc 100644 --- a/funpack.py +++ b/funpack.py @@ -697,7 +697,10 @@ class FunPackStoryWriter: # ── Now generate sequences — only add new instruction + append output ───── for seq_idx in range(prompt_count): # Add **only** the fresh sequence instruction each time - messages.append({"role": "user", "seq_prompt": f"""{sequence_system_prompt}\nCurrent sequence number: {seq_idx + 1}\nTotal sequences requested: {prompt_count}\nOriginal user prompt: {user_prompt}\nPrevious sequences (for continuity):\n{chr(10).join(outputs[:seq_idx]) if seq_idx > 0 else "This is the first sequence."}\n\Gnenerate the next sequence now."""}) + messages = [ + {"role": "system", "content": sequence_system_prompt}, + {"role": "user", "seq_prompt": f"""Current sequence number: {seq_idx + 1}\nTotal sequences requested: {prompt_count}\nOriginal user prompt: {user_prompt}\nPrevious sequences (for continuity):\n{chr(10).join(outputs[:seq_idx]) if seq_idx > 0 else "This is the first sequence."}\n\Gnenerate the next sequence now."""} + ] llm_tokens = llm_tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_tensors="pt", tokenize=True @@ -1448,5 +1451,6 @@ NODE_DISPLAY_NAME_MAPPINGS = { +