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.

Add new attention and compiler stuff to AGENTS.md (#16762)

comfyanonymousf1072eb03506
diff --git a/AGENTS.md b/AGENTS.md
index 51dd6dd65..abee3157f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -186,6 +186,10 @@
handwritten implementations of the same operation. Remove duplicate local
kernels and adapt inputs to the shared operation's documented layout while
preserving the model's original math and output contract.
+- Model implementations must use `AttentionTensorContainer` and per-module
+ `self.comfy_attention = ComfyAttention()`, passed to attention as `preferred_attention`.
+- Integrate model block loops with the memory compiler and prefetch helpers in
+ `comfy.model_prefetch`, following existing model patterns.
- All models should use the optimized attention function selected by ComfyUI.
Treat optimized backend functions, dispatch helpers, and capability-selected
callables as opaque. Higher-level code must not inspect function identity,