Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Avoid unnecessary write. (#16639)

comfyanonymousa7169322485d
diff --git a/comfy/text_encoders/llama.py b/comfy/text_encoders/llama.py
index b5c2b7c12..db36fc37e 100644
--- a/comfy/text_encoders/llama.py
+++ b/comfy/text_encoders/llama.py
@@ -43,7 +43,7 @@ class FixedKVBias(FixedKV):
tracker: dict = None
def prepare(self, num_tokens):
- if self.seqlen is not None:
+ if num_tokens == 1 and self.seqlen is not None:
self.seqlen.fill_(self.index + num_tokens)
if self.tracker["step"] == (self.index, num_tokens):
return