KJNodes/wangenerated

WanVideo Mem Eff Sage Attention Patch(WanVideoMemoryEfficientSageAttentionPatch)

EXPERIMENTAL! Activates custom sageattention on the WanVideo self-attention to reduce peak VRAM usage, overrides the attention mode. Requires latest sageattention version.

Wan Video Memory Efficient Sage Attention Patch

model
model
KJNodes

Description

An experimental node that patches the WanVideo self-attention mechanism to use a custom sageattention implementation, reducing peak VRAM usage during inference. This node overrides the attention mode of the model.

Requires the latest version of sageattention – ensure it is installed, compatible, and up to date before using this node.


Inputs

NameTypeDescription
modelMODELThe WanVideo model to which the memory‑efficient sageattention patch is applied.

Outputs

TypeDescription
MODELThe same model instance with its self‑attention mechanism patched to use sageattention.

Usage Notes

  • This node is experimental – behaviour may change in future releases.
  • It only affects the self‑attention layers of WanVideo; cross‑attention or other components remain unchanged.
  • Patching is applied as a model wrapper; the output MODEL can be used directly in subsequent sampling nodes.
  • If sageattention is not installed or is outdated, an error will be raised at runtime.
  • Running this patch may alter output quality or behaviour – test carefully with your specific workflow.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
WanVideo Mem Eff Sage Attention Patch (WanVideoMemoryEfficientSageAttentionPatch) - ComfyUI-KJNodes | ComfyUI Wiki