Extensions/ComfyUI-MiniMaxH3-AttentionMask
ComfyUI Extension

ComfyUI-MiniMaxH3-AttentionMask

ComfyUI custom node for applying Spatial and Temporal Attention Masking to MiniMax-H3 models.

By khwhite0413·Created 20 days ago·Updated 20 days ago· 2
khwhite0413/ComfyUI-MiniMaxH3-AttentionMask
Nodes1
On cloudLocal install
CategoryMiniMax-H3/Attention
Stars2
Updated20 days ago
Readme

ComfyUI-MiniMaxH3-AttentionMask

A ComfyUI custom node for applying Spatial and Temporal Attention Masking to MiniMax-H3 Diffusion Transformer (DiT) models.

Features

  • Region-Specific Control: Apply SAM2 / RMBG / Custom masks directly to MiniMax-H3's Self-Attention (attn1) layers.
  • Background Suppression / Foreground Preservation: Isolate background textures or maintain character motion while seamlessly replacing backgrounds.
  • Attention Strength Slider: Fine-tune influence from 0.0 to 1.0 (Recommended: 0.75 - 0.85 for smooth camera motion & background replacement).
  • Full Model Compatibility: Works with FP16, FP8, INT8 (int8_convrot), NVFP4, AWQ quantized MiniMax-H3 models and native Video/Audio VAEs.

Installation

Navigate to your ComfyUI custom_nodes directory and clone this repository:

cd ComfyUI/custom_nodes
git clone https://github.com/YourUsername/ComfyUI-MiniMaxH3-AttentionMask.git

Restart ComfyUI after cloning.


How to Use in ComfyUI

  1. Add Node: Right-click canvas -> MiniMax-H3/Attention -> MiniMax-H3 Attention Mask Patcher.
  2. Connect Inputs:
    • model: Connect from your MiniMax-H3 Model Loader (MODEL output).
    • mask: Connect a SAM2 / RMBG / Load Mask output (MASK). (Foreground Person = 1.0, Background = 0.0).
    • strength: Set between 0.75 and 0.85 for optimal camera motion & replacement.
    • mode: Choose suppress_background or preserve_foreground.
  3. Connect Output:
    • Connect the patched MODEL output into your KSampler / SamplerCustomAdvanced node.

License

MIT License. Free for open community use.