Nodes/ComfyUI-MiniMaxH3-SafeSageAttention/MiniMax H3 Safe SageAttention Patch
ComfyUI Node

MiniMax H3 Safe SageAttention Patch

Your 1080p MiniMax H3 video is silently rotting at the tail — this node is the fix

By liaowu-boos·Created a day ago·Updated a day ago· 0
MiniMax H3 Safe SageAttention Patch
  • model
  • model

If you're upscaling MiniMax H3 to 1080p on an RTX 4090 and your last ~44 frames come out gray or noisy - while ComfyUI happily reports success - this is the node you were missing. It's not a new attention backend or a speed hack. It's a safety wrapper around one specific SageAttention bug that silently corrupts long-sequence H3 outputs at 1080p, and it exists because the "silently" part is the whole problem.

H3 is MiniMax's open-weight 33B video model, and the way the community actually runs it in ComfyUI is through Kijai's KJNodes pack and its memory-efficient SageAttention path - that's where the speed lives. This node from liaowu-boos is a companion to that KJNodes path, not a replacement. Think of it as a patch that slips into the MODEL chain and guards a single kernel call. It's GPL-3.0, adapted from KJNodes' own scheduling, with the upstream fix tracked in KJNodes PR #748.

What actually goes wrong

When H3's fused QKV projection runs at 1080p, the V tensor it hands to SageAttention 2.2.0 isn't a compact contiguous block - it's a strided view of a much bigger buffer. In the author's measurement that view is (1, 230957, 56, 128) with a max relative offset of 4,966,484,991. SageAttention's FP8 CUDA transpose/quantize kernel computes addresses with 32-bit offsets, and UINT32_MAX is only 4,294,967,295. So the address wraps, the kernel reads the wrong V rows, and you get corrupted output with zero error messages. The author's own before/after runs (KJ local fix present vs. absent) matched at SSIM 1.0, confirming the node changes nothing it shouldn't.

The node checks shape and stride before entering that kernel:

  • Address-safe geometry → the original zero-copy fast path, untouched. No overhead.
  • Overflow risk → V gets materialized into canonical contiguous storage, but only after Q/K quantization and release, so the extra cost is contained.
  • Even padded output can't fit uint32 → a loud, explicit error. No silent garbage.

That last line is the design philosophy worth respecting: it refuses to run the unsafe path rather than quietly ship a broken video.

Wiring it in

The node is about as minimal as they get - one input, one output:

  • model (MODEL) - your H3 model, straight from the UNETLoader
  • model (MODEL) - the patched clone, into your sampler

You're swapping it for KJNodes' original H3 patch in the MODEL chain: UNETLoader → PathchSageAttentionKJ → MiniMax H3 Safe SageAttention Patch → EasyCache. Two rules from the README: keep the PathchSageAttentionKJ node in front, and don't put both H3 patch nodes (the KJ one and this one) in the same MODEL chain - they do the same job in different ways and you only want one active. The pack ships a minimal importable example at examples/minimax_h3_1080_safe_workflow.json if you want the exact wiring.

Install

No pip dependencies, no model downloads. It won't install or touch PyTorch, SageAttention, Triton, or KJNodes - it calls into your KJNodes at runtime:

cd ComfyUI/custom_nodes
git clone https://github.com/liaowu-boos/ComfyUI-MiniMaxH3-SafeSageAttention.git

Then a full restart of ComfyUI - refreshing the browser isn't enough, because the node resolves KJNodes' private symbols at load time. It's on the Comfy Registry too, so ComfyUI Manager can grab it if you prefer; manual install needs no Registry key.

The fine print (read this before you blame it)

  • SM89 only. RTX 4090-class GPUs. On anything else the node errors out telling you to use the original KJ node - that check is intentional.
  • KJNodes is a hard requirement, including its MiniMaxH3MemoryEfficientSageAttentionPatch node, the long-sequence Q/K kernel, and a working SageAttention + Triton. The node verifies all of this at runtime and fails loudly (never silently downgrades) if a symbol is missing. The author validated against KJNodes commit 3f200542 - after every KJNodes update, run a quick 720p and 1080p regression.
  • It costs VRAM only when it has to. The unsafe 1080p V view adds ~3.08 GiB of temporary FP16 storage, copied after Q/K release. Safe workflows pay nothing.
  • Don't use it for 720p. The bug bites long sequences at 1080p; if your workflow is already stable, leave the KJ original in place.

One last thing that isn't this node's fault but you'll want to know anyway: the H3 weights themselves are licensed out of the US, EU, UK and South Korea. If that's where you live, sort that out before you bother with any of this. If you're clear to run it, this is a rare "tiny pack, exact job" node - install it, swap it in, and stop scrubbing the tail of every render frame by frame.

CategoryMiniMaxH3/SageAttention

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
modelMODEL