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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: minimax-h3-community-license-agreement
|
| 4 |
+
license_link: LICENSE
|
| 5 |
+
base_model: MiniMaxAI/MiniMax-H3
|
| 6 |
+
library_name: comfyui
|
| 7 |
+
pipeline_tag: image-text-to-video
|
| 8 |
+
tags:
|
| 9 |
+
- minimax-h3
|
| 10 |
+
- comfyui
|
| 11 |
+
- quantization
|
| 12 |
+
- int8
|
| 13 |
+
- convrot
|
| 14 |
+
- video
|
| 15 |
+
- audio
|
| 16 |
+
- fl2va
|
| 17 |
+
- ref2va
|
| 18 |
+
- experimental
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# MiniMax-H3 INT8 Lean ConvRot — Dynamic Time / Separate QKV
|
| 22 |
+
|
| 23 |
+
> **Experimental, patch-required release.** These checkpoints do not load in
|
| 24 |
+
> unmodified ComfyUI. Apply the included core patch before loading them. For
|
| 25 |
+
> stock ComfyUI, use the table-based checkpoints in
|
| 26 |
+
> [`DmitryDB/MiniMax-H3-INT8-Lean-ConvRot`](https://huggingface.co/DmitryDB/MiniMax-H3-INT8-Lean-ConvRot).
|
| 27 |
+
|
| 28 |
+
This repository contains the experimental dynamic-time, physically
|
| 29 |
+
separate-Q/K/V editions of a quality-oriented mixed-precision INT8 ConvRot
|
| 30 |
+
conversion of [`MiniMaxAI/MiniMax-H3`](https://huggingface.co/MiniMaxAI/MiniMax-H3).
|
| 31 |
+
FL2VA and Ref2VA are provided separately because their diffusion-transformer
|
| 32 |
+
weights are task-specific.
|
| 33 |
+
|
| 34 |
+
These are community derivatives, not official MiniMax or ComfyOrg checkpoints.
|
| 35 |
+
|
| 36 |
+
## Files
|
| 37 |
+
|
| 38 |
+
| Path | Purpose |
|
| 39 |
+
|---|---|
|
| 40 |
+
| `FL2VA/minimax-h3-fl2va-int8-lean-convrot-dynamic-k16-separate-qkv-quality21.safetensors` | FL2VA diffusion transformer, 20.999 GiB |
|
| 41 |
+
| `Ref2VA/minimax-h3-ref2va-int8-lean-convrot-dynamic-k16-separate-qkv-quality21.safetensors` | Ref2VA diffusion transformer, 20.999 GiB |
|
| 42 |
+
| `patches/comfyui-minimax-h3-dynamic-time-separate-qkv.patch` | Required ComfyUI core patch |
|
| 43 |
+
| `reports/validation_dynamic_separate_fl2va.json` | Structural and numerical FL2VA validation |
|
| 44 |
+
| `reports/validation_dynamic_separate_ref2va.json` | Structural and numerical Ref2VA validation |
|
| 45 |
+
| `reports/loadtest_dynamic_separate_fl2va.json` | Full CPU loader result for FL2VA |
|
| 46 |
+
| `reports/loadtest_dynamic_separate_ref2va.json` | Full CPU loader result for Ref2VA |
|
| 47 |
+
| `reports/layer_policy*.json` | Per-layer BF16/INT8 quality policy |
|
| 48 |
+
| `reports/mm_quant_profile*.json` | Row-sampled reconstruction profiles |
|
| 49 |
+
|
| 50 |
+
The MiniMax-H3 text encoder and VAEs are not duplicated here. The two standard
|
| 51 |
+
VAE files remain available in the stock-compatible repository linked above.
|
| 52 |
+
A compatible MiniMax-H3 Qwen3-VL text encoder must be installed separately.
|
| 53 |
+
|
| 54 |
+
## What is different
|
| 55 |
+
|
| 56 |
+
### Original FP32 time MLP
|
| 57 |
+
|
| 58 |
+
The official pruned checkpoints replace the wide time/AdaLN path with a cached
|
| 59 |
+
table. These checkpoints instead keep all four tensors of the original FP32
|
| 60 |
+
time MLP. At each forward pass:
|
| 61 |
+
|
| 62 |
+
```text
|
| 63 |
+
full_t = SiLU(original_time_embedder(t))
|
| 64 |
+
coords = full_t @ shared_rank16_basis
|
| 65 |
+
AdaLN_i(t) = separate_linear_i(coords)
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
The rank-16 basis compresses the shared input subspace of the 51 wide AdaLN
|
| 69 |
+
projections. It does not replace the time MLP with interpolation, and every
|
| 70 |
+
block plus the final layer keeps an independent FP32 projection.
|
| 71 |
+
|
| 72 |
+
### Physically separate Q, K and V
|
| 73 |
+
|
| 74 |
+
The source MiniMax Diffusers checkpoints contain separate `to_q`, `to_k`, and
|
| 75 |
+
`to_v` tensors. Stock ComfyUI normally expects a fused `qkv_proj` tensor. This
|
| 76 |
+
release preserves separate projections through loading and forward execution:
|
| 77 |
+
|
| 78 |
+
- 50 main transformer attention blocks and two token-refiner blocks;
|
| 79 |
+
- 156 separate Q/K/V projection tensors in total;
|
| 80 |
+
- no fused `qkv_proj` weights;
|
| 81 |
+
- three projection calls per attention block.
|
| 82 |
+
|
| 83 |
+
The released Q/K/V tensors were checked bit-for-bit against the corresponding
|
| 84 |
+
contiguous slices used by the stock-compatible quality21 conversion.
|
| 85 |
+
|
| 86 |
+
### Mixed-precision quality21 policy
|
| 87 |
+
|
| 88 |
+
Both variants use the same quality-oriented policy:
|
| 89 |
+
|
| 90 |
+
- 170 of the 200 semantic main transformer matrices use INT8 ConvRot with
|
| 91 |
+
Hadamard group size 256;
|
| 92 |
+
- 30 high-risk main matrices remain BF16;
|
| 93 |
+
- token-refiner attention/MLP weights remain BF16;
|
| 94 |
+
- normalization tensors remain BF16;
|
| 95 |
+
- patch projections and video/audio output heads retain source FP32;
|
| 96 |
+
- dynamic time MLP, basis, and all 51 AdaLN projections are FP32.
|
| 97 |
+
|
| 98 |
+
Because Q, K and V are stored separately, each checkpoint contains 270
|
| 99 |
+
physical INT8 ConvRot modules even though the policy represents the same 170
|
| 100 |
+
semantic main matrices as the stock-compatible quality21 edition.
|
| 101 |
+
|
| 102 |
+
## Why a patch is required
|
| 103 |
+
|
| 104 |
+
Unmodified ComfyUI detects the stock MiniMax-H3 layout through fused
|
| 105 |
+
`qkv_proj` weights and either `adaln_t_table` or the standard wide AdaLN
|
| 106 |
+
construction. It does not construct the combination used here:
|
| 107 |
+
|
| 108 |
+
- independent `q_proj`, `k_proj`, and `v_proj` modules;
|
| 109 |
+
- original wide FP32 time MLP;
|
| 110 |
+
- shared dynamic rank-16 coordinates;
|
| 111 |
+
- 51 separate reduced AdaLN projections.
|
| 112 |
+
|
| 113 |
+
The included patch adds model detection, construction, forward execution, and
|
| 114 |
+
partial-offload support for this exact layout. No custom node is required after
|
| 115 |
+
the core patch is applied.
|
| 116 |
+
|
| 117 |
+
## Installation
|
| 118 |
+
|
| 119 |
+
1. Apply the patch from the root of your ComfyUI checkout:
|
| 120 |
+
|
| 121 |
+
```powershell
|
| 122 |
+
git apply --check C:\path\to\comfyui-minimax-h3-dynamic-time-separate-qkv.patch
|
| 123 |
+
git apply C:\path\to\comfyui-minimax-h3-dynamic-time-separate-qkv.patch
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
The patch was checked against ComfyUI commit `14b05228`. If `--check`
|
| 127 |
+
fails on a newer checkout, do not force it; port the small changes to the
|
| 128 |
+
current MiniMax implementation and validate loading again.
|
| 129 |
+
|
| 130 |
+
2. Put one or both diffusion checkpoints in:
|
| 131 |
+
|
| 132 |
+
```text
|
| 133 |
+
ComfyUI/models/diffusion_models/
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
3. Install a compatible MiniMax-H3 Qwen3-VL text encoder and the standard
|
| 137 |
+
MiniMax-H3 visual/audio VAEs.
|
| 138 |
+
|
| 139 |
+
4. Use the FL2VA checkpoint for T2VA/I2VA/first-last-frame workflows and the
|
| 140 |
+
Ref2VA checkpoint for multimodal reference workflows.
|
| 141 |
+
|
| 142 |
+
## Validation performed
|
| 143 |
+
|
| 144 |
+
The following checks were completed on CPU:
|
| 145 |
+
|
| 146 |
+
- safetensors structure, shapes, dtypes, and all ConvRot descriptors;
|
| 147 |
+
- 1,181 keys and 270 INT8 ConvRot descriptors per checkpoint;
|
| 148 |
+
- zero fused-QKV keys;
|
| 149 |
+
- all 156 Q/K/V projection tensors matched their stock quality21 slices
|
| 150 |
+
bit-for-bit;
|
| 151 |
+
- all four FP32 time-MLP tensors matched the raw MiniMax-H3 source bit-for-bit;
|
| 152 |
+
- dynamic AdaLN output relative error on 19 tested timesteps was approximately
|
| 153 |
+
`2.85e-7` to `3.29e-7`;
|
| 154 |
+
- both files fully loaded through patched ComfyUI as `MiniMaxH3Model`, with
|
| 155 |
+
dynamic basis enabled, table mode disabled, and independent Q/K/V modules in
|
| 156 |
+
the main stack and token refiner.
|
| 157 |
+
|
| 158 |
+
SHA-256:
|
| 159 |
+
|
| 160 |
+
```text
|
| 161 |
+
495b9d565b17194196646ef39b0c04ac7dde4a8df695b103b3fcbe04b5da00a6 FL2VA/minimax-h3-fl2va-int8-lean-convrot-dynamic-k16-separate-qkv-quality21.safetensors
|
| 162 |
+
82d16de12bee9d006c83c80b8843f2bb7e05cd25320724113ca7d128c6be6a04 Ref2VA/minimax-h3-ref2va-int8-lean-convrot-dynamic-k16-separate-qkv-quality21.safetensors
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
## Validation not yet completed
|
| 166 |
+
|
| 167 |
+
- GPU loading and peak-VRAM measurement;
|
| 168 |
+
- fixed-seed end-to-end FL2VA/Ref2VA generation;
|
| 169 |
+
- video and audio A/B quality comparison against BF16, official INT8, and the
|
| 170 |
+
stock table-based quality21 edition;
|
| 171 |
+
- throughput comparison between fused QKV and three independent projections.
|
| 172 |
+
|
| 173 |
+
Therefore, the 20.999 GiB file size is a disk-weight target, not a guarantee
|
| 174 |
+
that every 24 GiB workflow will fit. Runtime memory also depends on activation
|
| 175 |
+
size, resolution, frame count, attention implementation, and offload settings.
|
| 176 |
+
|
| 177 |
+
## Intended use
|
| 178 |
+
|
| 179 |
+
This edition is for testing whether retaining the original time encoder and
|
| 180 |
+
independent Q/K/V projections improves quality or behavior enough to justify a
|
| 181 |
+
small core patch and extra projection launches. Users who want ordinary ComfyUI
|
| 182 |
+
compatibility should use the stock table edition instead.
|
| 183 |
+
|
| 184 |
+
Do not treat CPU structural/numerical validation as proof of perceptual video
|
| 185 |
+
quality. End-to-end fixed-seed generation remains required.
|
| 186 |
+
|
| 187 |
+
## License
|
| 188 |
+
|
| 189 |
+
MiniMax H3 is distributed under the MiniMax H3 Community License Agreement.
|
| 190 |
+
Read `LICENSE` before using or redistributing these derivatives. The
|
| 191 |
+
modification summary is provided in `NOTICE`.
|
| 192 |
+
|
| 193 |
+
## Links
|
| 194 |
+
|
| 195 |
+
- [Original MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3)
|
| 196 |
+
- [Stock-compatible Lean ConvRot edition](https://huggingface.co/DmitryDB/MiniMax-H3-INT8-Lean-ConvRot)
|
| 197 |
+
- [Official ComfyOrg MiniMax-H3 files](https://huggingface.co/Comfy-Org/MiniMax-H3)
|
| 198 |
+
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
|