Nodes/XB_ToolBox/XB-BOX - SageAttention Accelerator
ComfyUI Node

XB-BOX - SageAttention Accelerator

Free attention speedup, with a preset dropdown for your exact GPU

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - SageAttention Accelerator
  • model
  • MODEL
preset关闭

SageAttention is one of those rare optimizations that's just... free. It's a drop-in replacement for the attention math inside a diffusion model's transformer blocks - the exact operation that dominates sampling time - and on modern GPUs it's typically faster than PyTorch's native attention with no visible quality change. Kijai's own early benchmarks showed ~1.5x on Hunyuan Video, and the community has been running it as a standard speedup layer since. XB_SageAttentionAccelerator is the XB_ToolBox wrapper for it: you feed it a MODEL, pick a preset, and get the same model back with attention patched.

The node is faithful to KJNodes' design - the pack says so in the source, and it delegates the "自动" (auto) mode to exactly the KJNodes logic. What XB adds is a GPU label in the logs and a preset ladder aimed at different hardware, which is genuinely useful if you've ever stared at a SageAttention install failure and wondered whether it was your GPU or your settings.

The preset dropdown is the whole UI

One input (model), one output (model), and a preset enum with 11 options. The ones that matter:

  • 关闭 (off) - pure passthrough, no patch. The node is inert; keep this when you haven't installed sageattention yet.
  • 自动 (auto) - KJNodes' auto logic with sageattn defaults. This is what 90% of people should use on Nvidia.
  • Nvidia-Sage - the Sage 2.x defaults tuned for CUDA.
  • AMD-RDNA4-Sage 2.2 - the pack's reason for existing: a preset for RDNA4 cards, where Sage 2.2.x is fully compatible. This is the one AMD users on current ROCm actually want.
  • 内置模式 A–D - fixed low-level sage_config profiles (M/N/GROUP/WAVE/WARP/NSTAGES). These are for tuning, not for day one.
  • 自定模式 A–C - custom config slots for external tuning tools.

A critical detail the pack documents honestly: on RDNA3, Sage 1.0.6 can't accept sage_config, so selecting any built-in/custom mode silently falls back to SDPA. RDNA4 and Nvidia are fine. And if the patch throws any exception, the node logs a warning and passes your model through untouched - your workflow keeps running, you just lose the speedup.

Install: this one actually needs a pip package

Unlike the pack's wrapper nodes, this one has a real dependency. The README's "no extra deps" claim doesn't apply here:

pip install sageattention

On Linux that's usually genuinely that easy (Sage 2.x ships wheels). On Windows you may need a precompiled wheel or a build; and on AMD/ROCm, people do hit install errors - the "SageAttention ROCm branch won't build" thread is a real rite of passage. If installation fails, the node's graceful passthrough means your workflows still run, you just get no speedup.

Where does it sit in a workflow? Straight after your model loader, before the sampler - patch the model once, sample faster. Install the pack via ComfyUI Manager (XB_ToolBox) or git clone https://github.com/wjluoxiao/XB_ToolBox.git into custom_nodes, restart, and the node lives under "XB_ToolBox/VRAM_Hacks".

CategoryXB_ToolBox/VRAM_Hacks

Inputs (2)

NameTypeDefaultDescription
modelMODEL
presetCOMBO关闭11 options: 关闭, 自动, Nvidia-Sage, AMD-RDNA4-Sage 2.2, 内置模式 A (128x128x32), 内置模式 B (128x64x96), +5

Outputs (1)

NameTypeDescription
MODELMODEL