From fe708fe4017a7576f9a17abce01a856bf4eee194 Mon Sep 17 00:00:00 2001 From: aimfordeb <133010426+aimfordeb@users.noreply.github.com> Date: Sun, 25 Jan 2026 22:01:49 +0200 Subject: [PATCH] Fix for better continuity --- funpack.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/funpack.py b/funpack.py index c03736aa..fc5494ec 100644 --- a/funpack.py +++ b/funpack.py @@ -698,7 +698,19 @@ class FunPackStoryWriter: for seq_idx in range(prompt_count): # Add **only** the fresh sequence instruction each time messages.append({"role": "system", "content": f"""This sequence's ID is {seq_idx + 1} out of total {prompt_count} sequences requested."""}) - messages.append({"role": "user", "content": sequence_system_prompt}) + messages.append({"role": "user", "content": seq_prompt = f""" + {sequence_system_prompt} + + Current sequence number: {seq_idx + 1} + Total sequences requested: {prompt_count} + + Original user prompt: {user_prompt} + + Previous sequences (for continuity): + {chr(10).join(outputs[:seq_idx]) if seq_idx > 0 else "This is the first sequence."} + + Generate the next sequence now. + """}) llm_tokens = llm_tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_tensors="pt", tokenize=True @@ -1447,5 +1459,6 @@ NODE_DISPLAY_NAME_MAPPINGS = { +