minimax_h3_cache.md

MiniMax H3 Cache

MiniMax H3 Cache is an approximate, model-scoped acceleration node for ComfyUI's native MiniMax H3 diffusion model. It caches the residual produced by the complete H3 transformer block stack, and reuses that residual when the sampled audio/video-token feature signature changes little enough.

Wiring

Place it on the MODEL path before the guider/sampler:

MiniMax H3 Model Loader
          |
          v
MiniMax H3 Cache
          |
          +--> Patch Comfy Kitchen Attention (optional)
          |              |
          +--------------v
                    Guider / Sampler

The Cache and Patch Comfy Kitchen Attention are model-clone patches and may be chained in either order. Cache-hit steps bypass the complete H3 block stack, so no attention backend runs on those steps. On cache-miss steps, Comfy Kitchen's selected attention override remains present in transformer_options and is used normally.

Controls

This is an approximation. Compare it with Cache disabled using the same checkpoint, prompt, seed, sampler, step count, and resolution. In particular, check audio continuity, motion stability, and reference adherence. A displayed speedup is only a theoretical block-stack ratio; it is not an end-to-end generation benchmark.

Current-ComfyUI behavior

The node clones the incoming MODEL, installs a reversible object patch for only that clone's diffusion_model._forward, adds a complete H3 block-loop replacement point, and attaches an outer-sampling lifecycle wrapper. It does not mutate the global MiniMaxH3Model class. The patched block runner preserves current ComfyUI double_block replacements, prefetching, and transformer_options, including optimized-attention overrides.

Provenance and licensing

This node is GPL-3.0-compatible and is based on the cache algorithm from:

The current-ComfyUI model-scoped lifecycle and feature set were independently implemented after studying the design of:

No AGPL-licensed source code from UtilsCollection was copied into this GPL-3.0 collection. The silveroxides project itself credits the lihaoyun6 cache as its algorithmic upstream.

Compatibility

下载此文件