⚡| Comfy-Kitchen Attention Enabler
A one-click attention backend switch that quietly no-ops on old ComfyUI
- model
- MODEL
If a node's job is to save you a right-click, this is it. Comfy-Kitchen Attention Enabler patches your diffusion model to use ComfyUI's newer, faster "comfy kitchen attention" backend - and if your ComfyUI version doesn't support it, it quietly does nothing instead of erroring out. That last part is the whole point: it's a compatibility wrapper, not just a speed toggle.
It ships in Martin Rizzo's Z-Image Power Nodes, and it exists because the pack's v2.1 line targets the newest ComfyUI features (Nodes 2.0, Int8-ConvRot, ComfyKitchen attention) while still promising to run on older versions. That's a hard promise to keep with model-patching nodes, because the ComfyUI API for swapping attention backends simply doesn't exist on every install. This node is how the author keeps one workflow working across both worlds.
How it works
It's a thin wrapper around ComfyUI's built-in ModelAttentionBackend node. When the comfy_kitchen_attention switch is on, it asks ComfyUI to patch the model with "comfy kitchen attention"; when off, it requests the plain "pytorch attention" backend. The whole execute is wrapped in a try/except - if anything throws (say, your ComfyUI predates the attention-backend API), it returns your model completely unchanged. No crash, no broken workflow, you just don't get the optimization.
Note what it's not: it doesn't install or require any "ComfyKitchen" custom nodes. The backend is native to recent ComfyUI, and this node is only the switch that flips it. It's also not Z-Image-specific - it takes any MODEL in and spits a patched MODEL out, so you could drop it in front of a Flux sampler if you wanted. It just happens to live in a Z-Image pack because that's where the author needed it.
The inputs that matter
model(MODEL) - your diffusion model, e.g. fromLoadZImageModelor a standard checkpoint loader.comfy_kitchen_attention(BOOL, default off) - on: try the fast backend; off: force standard PyTorch attention.
One output: the patched MODEL, wired straight into your sampler.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/martin-rizzo/ComfyUI-ZImagePowerNodes
Then restart ComfyUI. (Or use ComfyUI Manager and search "Z-Image Power Nodes" - same result.) No Python dependencies, and the README pins the sensible floor: Python 3.10, PyTorch 2.5, ComfyUI v0.11.0.
Should you use it?
If you're on a recent ComfyUI and running the author's recommended Int8-ConvRot checkpoints, flipping this on is the intended pairing and costs you nothing. If you're on an older install, leave it off - or on, it genuinely doesn't matter, because the fallback returns the model untouched. The only honest caveat: it's a one-node convenience. If you'd rather manage attention backends directly in a ComfyUI settings panel or launch flag, you can skip it entirely. Some people find these helper nodes redundant once they understand the underlying toggle; this one at least fails gracefully, which is more than most patches can say.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| comfy_kitchen_attention | BOOLEAN | false | If enabled, attempts to apply the Comfy-Kitchen attention optimization. The optimization will only take effect if your current ComfyUI version supports it. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | The patched model with comfy-kitchen attention enabled if possible |