"Veda is a learned sparse-attention method for video diffusion models. Attention dominates the cost of a long clip, and a small distilled predictor can say in advance which tiles of the attention map carry the result. Veda computes roughly the top 10% of them and skips the rest." One node, MODEL in / MODEL out. 支持 ComfyUI 原生 MiniMax-H3 的 T2VA / FL2VA / R2VA。
要求 ComfyUI >= 0.38.0。ComfyUI Manager 搜 "Veda";或 comfy node install veda-sparse-attention 或 clone 到 ComfyUI/custom_nodes/ 后重启。
Workflow -> Browse Templates -> Veda-on-ComfyUI -> "Veda MiniMax H3 T2VA" / "Veda MiniMax H3 R2VA"。 把 【Veda Sparse Attention (MiniMax H3)】放在 MODEL 线上:模型与所有 LoRA loader 之后、guider/sampler 之前。 Ctrl+B 旁路即可用同 seed 渲染全注意力做对照。
"Do not combine it with ComfyUI's own "Model Sparse Attention" node on H3: that one replaces the attention blocks outright, so Veda would never be called. The node says so when it sees both."
"Other attention nodes can stay. Veda runs on top of "Patch Sage Attention KJ" (the calls it does not take go to sage), and KJNodes' "MiniMax H3 Low VRAM Attention" keeps working. A node that swaps out the whole H3 attention, such as "MiniMax H3 Mem Eff Sage Attention Patch", must come before Veda: Veda then runs the sparse layers and leaves that node the full-attention ones, and says so on its node. Placed after Veda it would hide every call from Veda; the node warns about that too."
节点自己不下载任何东西。打分器(275 MB)进入 models/veda,两种方式:
Veda done · Triton INT8 (SM120) Video: 1344x768 · 5.2 s Attention computed: 10.9% of full attention (89.1% skipped) Veda off 开头给出未运行的原因;nearest trained size: ... 表示视频超出训练集。verbose 增加分阶段计时/调用数/predictor 细节。
| 输入 | 默认 | 说明 |
|---|---|---|
| generated_sparsity | 90% | 生成视频注意力的稀疏度;90% 即每 query tile 跳过 90% 的 key tile(训练值)。填整数如 24 表示精确保留 24 个 128-token key tile。 |
| reference_sparsity | 90% | 参考(首尾帧/guide 帧/参考图与参考视频)同理;0% 给它们全注意力。 |
| full_attention_layers | 空 | 保留全注意力的 0 基 DiT block,如 0, 1, 47-49。 |
| full_attention_steps | 空 | 保留全注意力的 0 基采样步,如 0。 |
| verbose | off | 报告各阶段注意力耗时、调用次数、predictor 细节。 |
released predictor 训练于 1344x768 / 768x1344 / 768x768 / 1024x768,5 / 10 / 14 秒,配 8-step Turbo LoRA。 其他尺寸回退到最接近的 tile plan。其他尺寸、其他步数、R2VA/FL2VA 参考都能用,但在训练数据之外,请与全注意力对比。
| Attention | Per step | 8 steps | Attention per step |
|---|---|---|---|
| ComfyUI default | 40.7 s | 342 s | 31.1 s |
| ComfyUI --use-sage-attention | 24.8 s | 231 s | 15.2 s |
| Veda sparse INT8 | 14.0 s | 130 s | 4.41 s |
单层注意力 104k tokens / 90% 稀疏 = 528 ms(全注意力 11.8 s)。 "Veda's INT8 arithmetic is the same code ComfyUI runs behind --use-sage-attention, so the quality is what that path gives, with sparsity on top."
| Hardware | Status |
|---|---|
| RTX 30 / A100 / RTX 40 / L40 (sm80-89) | code path ready, not yet verified on this hardware |
| H100 / H200 (sm90) | code path ready, not yet verified |
| B200 / B300 (sm100 / sm103) | code path ready, not yet verified |
| RTX 50, RTX PRO 6000 Blackwell (sm120) | verified: RTX 5070, Windows 11 |
| DGX Spark / GB10 (sm121) | code path ready, not yet verified |
| Apple silicon (M series) | verified: M3 Pro, macOS 15 |
Code: MIT。INT8 kernel 的算术源自 SageAttention v1 (BSD-3-Clause)。打分器继承 MiniMax H3 Community License。