HELPMEEADICE/TE-Speed-MiniMaxH3-OSS

MiniMax-H3超级缓存加速插件

What it solves

This project reduces the inference time of the MiniMax H3 model within ComfyUI, achieving speed increases of up to 45% without significantly sacrificing image or video quality.

How it works

The plugin intercepts the block loop of the 50-layer DiT (Diffusion Transformer) using a custom hook. It distinguishes between two types of steps:

  • Full Steps: The model processes all blocks and saves a "residual" (the difference between the full output and a partial "warm-up" output).
  • Cache Steps: When the difference in sigma between steps is small and the process is within a specific window, the model only recalculates the warm-up blocks and adds the previously saved residual to compensate for drift.

To prevent error accumulation, the system enforces a maximum number of consecutive cached steps (mcs) and ensures the first step of every sampling round is always a full step.

Who it’s for

Users of ComfyUI who are running MiniMax H3 models and want to generate content faster while maintaining control over the trade-off between speed and quality.

Highlights

  • Significant Speedup: Offers up to 45% acceleration in typical workflows (e.g., 30 steps, 8s video).
  • Flexible Control: Users can adjust the cache window (start/end percentages), the sigma difference threshold, and the cache depth to balance stability and speed.
  • Memory Management: Supports moving cached residuals to the CPU to save VRAM.
  • Easy Integration: Includes a patching script to modify the ComfyUI model files with minimal changes.

Related

  • Project
  • Project
  • Project
  • Project