ComfyUI Spark-H3
Spark-H3 extends comfy-kitchen's efficient block-sparse attention (BSA) implementation for ComfyUI's native MiniMax-H3 video generation. It adds two functions—Spark-Reblock and Spark-Reweight—to form Spark-Attn: Reblock groups similar tokens, while Reweight corrects tail-token contributions. v0.1.3 Linux attention speedups versus Dense SDPA (LightX2V 768p 8-step, 1344x768, 345 frames, 24 FPS; topk_ratio 20%, warmup_steps 2): RTX 3090 - Fidelity 2.42x / Speed 4.62x; RTX 4090 - 2.37x / 4.35x; RTX PRO 6000 Blackwell - 2.05x / 3.15x.
Nodes (9)
Loading a Cached MiniMax-H3 Latent
MiniMax H3 BSA All-Exact (Scheduled Dense Control)
MiniMax-H3 DMAD Sampler
MiniMax H3 Sol Attention (Official Compatibility)
Spark Attention (SM120)
Spark Attention (SM86)
Spark Attention (SM89) on 4090s and 4080s
MiniMax-H3 AV Latent Saver
Save Video Lossless (Ultrafast)
[!NOTE] Spark-H3 technical report (November 18, 2026)
We released the Spark-H3 technical report. Read it on arXiv.
[!IMPORTANT] ComfyUI v0.2.0 release: Spark-H3 now uses the isolated
spark-h3-kitchendistribution andspark_h3_kitchenimport namespace. It no longer replaces or pins ComfyUI's officialcomfy-kitchenpackage. The release supports ComfyUI 0.38.x–0.40.x and 0.42.x–0.44.x. For production use, we recommend the defaultspark-h3-kitchen0.2.37, which delivered better speed and stability in release testing. Read the v0.2.0 release notes
VPack v0.1.0: A separate ComfyUI plugin that compresses reference videos in Ref2VA workflows. VPack GitHub repository
<a id="demo"></a>
🎬 Demo
Native MiniMax-H3 · VDN Selected Prompt 06 · 1344×768 · 14.4 seconds. The three panels compare Dense, Spark-H3 Fidelity (2.19×), and Spark-H3 Speed (3.12×). The animated preview and linked clip cover the final 5.4 seconds, starting at 9 seconds.
<p align="center"><a href="https://huggingface.co/Aazeus/Spark-H3/resolve/main/comfyui/demos/H3_native_vdn_selected_0006_dense_fidelity_speed_native_resolution.mp4">Watch the full 14.4-second comparison</a></p>- Veda / Sol / Spark: subjective visual quality and speed comparison (Bilibili)
- Spark-H3 + VPack on Ref2VA (Bilibili)
✨ Spark-Attn
Spark-Attn is a block sparse attention method for MiniMax-H3 video generation. It combines two operations:
- 🧩 Reblocking groups similar tokens into blocks so sparse attention can select more relevant interactions.
- ⚖️ Reweighting assigns different weights to tokens within each tail block when building key/value summaries, with a correction for attention mass.
Spark-H3 provides the Spark attention kernels and MiniMax-H3 inference integration.
<a id="quick-start"></a>
🚀 Quick Start
Set up your H3 pipeline using the upstream MiniMax-H3 instructions, then install Spark in the same environment with a compatible PyTorch/CUDA stack:
python -m pip install -e '.[cuda]'
Wrap an already loaded pipeline with the Spark installer:
from h3_sparse_attention import install_h3_spark_attn
# MiniMaxH3Scheduler includes the terminal sigma=0 in num_inference_steps,
# but that terminal point does not run the transformer.
num_denoise_steps = 19
num_inference_steps = num_denoise_steps + 1
with install_h3_spark_attn(
pipe.transformer,
num_denoise_steps=num_denoise_steps,
warmup_mode="warmup_steps",
warmup_steps=4,
dense_layers=0,
topk_ratio=0.1,
):
result = pipe(**inputs, num_inference_steps=num_inference_steps)
<a id="comfyui-installation"></a>
🧩 ComfyUI Installation
Spark-H3 v0.2.0 provides standalone nodes for ComfyUI 0.38.x–0.40.x and
0.42.x–0.44.x. Its isolated spark-h3-kitchen backend is installed alongside
ComfyUI's official comfy-kitchen package instead of replacing it. Linux and
Windows x86_64 packages are produced for SM86, SM89, and SM120.
Choose the CUDA 13.0 package matching your operating system and GPU
architecture. ComfyUI and model weights are not included.
For installation and example workflows, see the ComfyUI guide or 中文安装指南.
For reference-video compression in Ref2VA workflows, install the separate VPack v0.1.0 plugin.
Step-count convention
MiniMaxH3Scheduler includes the final σ=0 endpoint in
num_inference_steps, so the default num_inference_steps=50 runs 49 denoising steps. See the
Hugging Face scheduler documentation.
<a id="todo"></a> <a id="project-status"></a>
🧭 Project Status & Roadmap
The Diffusers and ComfyUI integrations are separate implementation tracks. Their status is listed independently below so that backend work is not confused with ComfyUI packaging or compatibility work.
Diffusers / Python
| Status | Item | Resources | |---|---|---| | ✅ Available | Spark attention integration for MiniMax-H3, with fused kernels for SM80, SM86, SM89, and SM120 | Usage and kernel documentation · Performance matrix | | ✅ Available | Ref2VA pipeline support and released inference examples | Spark-Ref2VA Preview | | 🗓️ Planned | Fused Spark kernels for SM90 and SM100 | Pending hardware resources | | ✅ Released | Spark-H3 technical report | arXiv:2611.24256 |
ComfyUI
| Version | Date | Status | Main improvements / expected updates | Release / tracking |
|---|---|---|---|---|
| v0.1.1 | 2026-10-09 | ✅ Released | First stable Linux packages for SM89 and SM120; fixed the v0.1.0 CUDA Graph allocation-lifetime issue; bundled five representative workflows | Release notes |
| v0.1.2 | 2026-10-11 | ✅ Released | Added validated Windows SM89 and SM120 packages; corrected packaged workflows and optimized the LBH two-pass example | Release notes |
| v0.1.3 | 2026-10-13 | ✅ Released | Added validated SM86 packages; integrated with KJNodes low-VRAM patches; added fidelity, speed, custom, and dense presets plus selectable dense backends | Release notes |
| v0.1.4 | 2026-10-15 | ✅ Released | Added ComfyUI 0.40.x support, Ref2VA-aware sparse_scope, configurable producer_chunk, and in-node Ref2VA guidance | Release notes |
| v0.1.5 | 2026-10-19 | ✅ Released | Added ComfyUI 0.42.x support through comfy-kitchen 0.2.39; released Linux and Windows SM86/SM89/SM120 packages, each also bundling wheels for ComfyUI 0.38.x–0.40.x | Release notes |
| v0.2.0 | 2026-11-06 | ✅ Released | Decouples Spark-H3 from ComfyUI's official comfy-kitchen dependency by using an isolated backend; supports ComfyUI 0.38.x–0.40.x and 0.42.x–0.44.x; recommends the default 0.2.37 backend for better tested speed and stability | Release notes |
The v0.2.0 release supports ComfyUI 0.38.x–0.40.x and 0.42.x–0.44.x with Linux and Windows x86_64 packages for SM86, SM89, and SM120. See the ComfyUI guide for workflows and the installation guide for package details. Reference-video compression is provided separately by VPack.
🤝 Acknowledgments
Thanks to MiniMax-H3 and Sol-Attn / Sol-Engine for the model and attention infrastructure. See the third-party notices for kernel attributions and included licenses.
<a id="special-thanks"></a>
❤️ Special Thanks
- Thanks to Smthem (GitHub · Bilibili) for support and help during the development of Spark-H3's ComfyUI plugin.
- Thanks to AI绘画KK (GitHub · Bilibili) for valuable guidance and support in exploring and applying MiniMax-H3 workflows, and for helping communicate the community's need for Windows installation packages.
- Thanks to AIwood爱屋研究室 (GitHub · Bilibili) for identifying a bug when Spark-H3 was used in a two-pass sampling workflow and suggesting a switch to Kitchen as the dense backend, which further improved the plugin's speedup ratio.
⭐ Star History
<p align="center"> <a href="https://www.star-history.com/?repos=zechengtang%2FSpark-H3&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=zechengtang/Spark-H3&type=date&theme=dark&legend=top-left"> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=zechengtang/Spark-H3&type=date&legend=top-left"> <img alt="Spark-H3 GitHub star history chart" src="https://api.star-history.com/chart?repos=zechengtang/Spark-H3&type=date&legend=top-left" width="720"> </picture> </a> </p>📄 License
Spark-Attn’s original code and documentation are licensed under the Apache License 2.0. Third-party components retain their original licenses and notices; see third-party notices. MiniMax-H3 model weights remain subject to their upstream license.
