The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Lower kv cache memory usage. (#12909)
comfyanonymous47e1e316c580
diff --git a/comfy_extras/nodes_flux.py b/comfy_extras/nodes_flux.pyindex c366d0d5b..3a23c7d04 100644--- a/comfy_extras/nodes_flux.py+++ b/comfy_extras/nodes_flux.py@@ -248,7 +248,7 @@ class KV_Attn_Input:self.set_cache = Falsereturn {"q": q, "k": torch.cat((k, kk), dim=2), "v": torch.cat((v, vv), dim=2)}- self.cache[cache_key] = (k[:, :, -ref_toks:], v[:, :, -ref_toks:])+ self.cache[cache_key] = (k[:, :, -ref_toks:].clone(), v[:, :, -ref_toks:].clone())self.set_cache = Truereturn {"q": q, "k": k, "v": v}