Model Attention Backend (All)
The attention-backend switcher that shows up twice in your menu
- model
- model
If you've opened the node menu and seen both "Model Attention Backend (All)" and "Lackluster Model Attention Backend (All)" sitting there and wondered which one you're supposed to use, here's the answer: it doesn't matter. In the source, this class is literally one line - ModelAttentionBackendAll = LacklusterModelAttentionBackend. It's a compatibility alias so both names resolve to the identical node. Pick whichever you find first, and never think about it again.
So what does it actually do? It's a MODEL-patch node that swaps which attention backend a specific model uses, chosen per workflow instead of globally. The "(All)" is the selling point: the dropdown is generated dynamically from ComfyUI's attention registry, so it isn't hardcoded to a fixed list. Whatever backends are registered in your build show up automatically - the stock ones plus anything a third-party plugin registers. You don't wait for the author to add support for the new hot kernel.
Why per-model? Because "one attention backend for everything" is a bad default the moment one of your models hates it. The classic case is Sage Attention: it's the go-to speed upgrade for video, but it produces corrupted, matrix-code-looking output on specific checkpoints like Z-Image Base, while other models in the same library benefit from it. The well-trodden community workaround is to disable Sage globally and enable it per workflow. This node generalises that pattern to every backend in your registry.
How it works
It reads REGISTERED_ATTENTION_FUNCTIONS from ComfyUI's attention module when the UI builds, orders the known names (pytorch, sage, sub_quad, split, plus extras like flash or xformers), and appends anything else it finds. On execution it clones your model and applies set_model_optimized_attention(), the official ModelPatcher API from ComfyUI PR #15479 - which matters because container-aware backends carry their own setup with them through that override. It also re-checks your choice against the live registry at queue time, so you get a clear "here's what's actually registered" error instead of a silent failure if a backend fell over.
The inputs and output
Two inputs, one output. model takes any MODEL - checkpoint loader output, unet loader, whatever. attention is the dynamic dropdown: pytorch is the safe default, sage is the fast-but-fiddly speed option (Triton install on Windows is a rite of passage), sub_quad is the VRAM-saver that splits the sequence into sub-quadrants and is worth it for long video sequences, and split is the older implementation. The model output goes straight into your sampler.
Installing it
This ships inside ComfyUI Lackluster Nodes, which is a general-purpose grab bag (camera controls, TTS, trap-music prompt generators - yes, really). You get all of them:
cd ComfyUI/custom_nodes
git clone https://github.com/LacklusterOpsec/ComfyUI-Lackluster-Nodes.git
cd ComfyUI-Lackluster-Nodes
pip install -r requirements.txt
Or via ComfyUI Manager: search "ComfyUI Lackluster Nodes", install, restart. The pack's own requirements are trivial - requests and numpy - because this node is a thin wrapper over ComfyUI's API. The backends themselves are separate installs, and the dropdown only reflects what's registered in the running process.
Gotchas
The dropdown freezes at ComfyUI startup, so installing a new backend plugin means a restart before it shows up. This node selects a backend; it won't install or fix one - if Sage or xformers isn't installed, it simply won't be in the list. And if a workflow suddenly produces garbage after you switched backends, flip back to pytorch first; that isolates the kernel from the sampler in about ten seconds. For a node with two names, the one thing worth remembering is to give it a modern ComfyUI - the set_model_optimized_attention API it leans on is from PR #15479, so a stale build throws before it does anything.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| attention | COMBO | 4 options: pytorch, sage, sub_quad, split |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |