lilcheaty commited on
Commit
652a4ec
Β·
verified Β·
1 Parent(s): a4b2aaf

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +148 -0
README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: minimax-h3-community-license-agreement
4
+ license_link: https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/LICENSE
5
+ tags:
6
+ - comfyui
7
+ - nvfp4
8
+ - quantized
9
+ - video
10
+ - text-to-video
11
+ base_model: MiniMaxAI/MiniMax-H3
12
+ base_model_relation: quantized
13
+ ---
14
+
15
+ # MiniMax H3 β€” NVFP4
16
+
17
+ NVFP4 quantizations of the **MiniMax-H3** diffusion transformer for ComfyUI, produced from
18
+ the **unpruned bf16** weights.
19
+
20
+ - Original model: https://huggingface.co/MiniMaxAI/MiniMax-H3
21
+ - ComfyUI repackage these were built from: https://huggingface.co/Comfy-Org/MiniMax-H3
22
+
23
+ Quantized with [comfy-kitchen](https://pypi.org/project/comfy-kitchen/) 0.2.26 via
24
+ [comfyui-starnodes-modelconverter](https://github.com/Starnodes2024/comfyui-starnodes-modelconverter),
25
+ using a hand-authored per-layer profile (included below).
26
+
27
+ **NVFP4 requires an NVIDIA Blackwell GPU** (RTX 50-series, RTX PRO 6000, B200). On older
28
+ architectures the NVFP4 path is emulated and you should use Comfy-Org's `int8_convrot`
29
+ files instead.
30
+
31
+ ## Why a custom per-layer profile
32
+
33
+ H3's parameters are not evenly distributed, and the biggest single group is the one most
34
+ hostile to aggressive quantization:
35
+
36
+ | group | params | share |
37
+ |---|---|---|
38
+ | `adaln_proj` (AdaLN modulation) | 13.04B | **39.4%** |
39
+ | `mlp` (fc1/fc2) | 12.02B | 36.3% |
40
+ | `attn` (qkv/out_proj) | 8.02B | 24.2% |
41
+ | norms / embedders / final heads | 0.04B | 0.1% |
42
+ | **total** | **33.12B** | |
43
+
44
+ AdaLN layers emit the per-block scale and shift applied to every residual stream, so error
45
+ there is multiplicative and compounds across all 50 blocks and every sampling step β€” unlike
46
+ mlp/attn error, which tends to average out.
47
+
48
+ The conventional "blacklist the sensitive layers" approach is **useless here**: keeping
49
+ 13.04B params at bf16 yields a ~36 GB file, *larger* than Comfy-Org's 34 GB
50
+ `int8_convrot`, for no speed gain. There is no conservative-and-small option. Hence two
51
+ deliberate variants.
52
+
53
+ ## Variants
54
+
55
+ | file | AdaLN | attn + mlp | size | s/it |
56
+ |---|---|---|---|---|
57
+ | `minimax_h3_ref2va_nvfp4_mixed.safetensors` | FP8 (e4m3) | NVFP4 | 24.4 GB | 1.92 |
58
+ | `minimax_h3_ref2va_nvfp4_full.safetensors` | NVFP4 | NVFP4 | 18.7 GB | 1.91 |
59
+
60
+ Norms, biases, RoPE frequencies, patch/time/condition embedders and the final output heads
61
+ are kept at BF16 in both (0.1% of params, negligible size cost).
62
+
63
+ **`mixed` is the recommended default.**
64
+
65
+ Note what the numbers say: quantizing AdaLN from FP8 down to NVFP4 saves **5.7 GB but buys
66
+ no speed at all** (1.91 vs 1.92 s/it β€” noise). AdaLN projections are small per-block
67
+ matmuls that are memory-bound rather than compute-bound, so FP4 tensor cores have nothing
68
+ to accelerate there. All of the speedup comes from attn+mlp.
69
+
70
+ So `full` is **not** the "faster" variant β€” it is the "smaller" variant, and it pays for
71
+ that with 4-bit weights in the most error-sensitive 39% of the model. Use it only if you
72
+ are VRAM-constrained. Otherwise take `mixed`.
73
+
74
+ ## Measured performance
75
+
76
+ RTX PRO 6000 Blackwell (96 GB), ComfyUI 0.30.0, ref2va, 864Γ—480, 39 frames, 20 steps,
77
+ `res_multistep` / `beta`:
78
+
79
+ | model | source | size | s/it |
80
+ |---|---|---|---|
81
+ | `pruned_int8_convrot` (Comfy-Org) | pruned | 21.0 GB | 2.18 |
82
+ | `nvfp4_mixed` (this repo) | unpruned bf16 | 24.4 GB | **1.92** |
83
+ | `nvfp4_full` (this repo) | unpruned bf16 | 18.7 GB | 1.91 |
84
+
85
+ ~12% faster sampling than the pruned int8 baseline, from unpruned source weights.
86
+ Baseline `--highvram` / `--fast` made no measurable difference (2.18 s/it either way), so
87
+ the quantization change is the only thing that moved this number.
88
+
89
+ ## Honest limitations
90
+
91
+ - Quality was spot-checked against the pruned-int8 baseline at matched seeds and showed no
92
+ visible degradation, but this is **not a rigorous evaluation** β€” no FVD, no human study,
93
+ no long-duration or 2K testing.
94
+ - Only the **ref2va** task is converted so far. `fl2va` is not included.
95
+ - `full` (AdaLN at NVFP4) is the more speculative variant and has had less testing. It
96
+ showed no visible artifacts at matched seeds, but 4-bit modulation weights are the kind
97
+ of thing that fails on hard cases rather than easy ones.
98
+ - Benchmarks are single-GPU on one card at one resolution.
99
+
100
+ If you find failure cases, please open a discussion β€” concrete artifacts are more useful
101
+ than aggregate scores for judging whether the AdaLN policy is right.
102
+
103
+ ## Usage
104
+
105
+ Place in `ComfyUI/models/diffusion_models/`, and pair with the text encoder and VAEs from
106
+ Comfy-Org's repo:
107
+
108
+ ```
109
+ πŸ“‚ ComfyUI/
110
+ β”œβ”€β”€ πŸ“‚ models/
111
+ β”‚ β”œβ”€β”€ πŸ“‚ diffusion_models/
112
+ β”‚ β”‚ └── minimax_h3_ref2va_nvfp4_mixed.safetensors
113
+ β”‚ β”œβ”€β”€ πŸ“‚ text_encoders/
114
+ β”‚ β”‚ └── qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors
115
+ β”‚ β”œβ”€β”€ πŸ“‚ vae/
116
+ β”‚ β”‚ β”œβ”€β”€ minimax_h3_audio_vae_fp32.safetensors
117
+ β”‚ β”‚ └── minimax_h3_video_vae_fp16.safetensors
118
+ ```
119
+
120
+ Use the official R2V template, swapping the diffusion model:
121
+ https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_minimax_h3_r2v.json
122
+
123
+ Requires a ComfyUI new enough to have native H3 support (`comfy/ldm/minimax/`,
124
+ `comfy_extras/nodes_minimax_h3.py`) β€” ComfyUI β‰₯ 0.30.0.
125
+
126
+ Notes: `CLIPLoader` type must be `minimax`; sampler `res_multistep`; frame `length` must
127
+ satisfy 17n+5.
128
+
129
+ ## Reproducing
130
+
131
+ `profiles/` in this repo contains the two per-layer profiles. To rebuild:
132
+
133
+ ```bash
134
+ pip install comfy-kitchen
135
+ git clone https://github.com/Starnodes2024/comfyui-starnodes-modelconverter \
136
+ ComfyUI/custom_nodes/comfyui-starnodes-modelconverter
137
+ # copy profiles/*.json into that node pack's profiles/ dir, then run
138
+ # StarUltimateModelConverterPro with:
139
+ # model_name = minimax_h3_ref2va_bf16.safetensors
140
+ # profile = minimax_h3_nvfp4_mixed.json
141
+ # use_blacklist = no (the profile controls precision per-tensor)
142
+ # target_quant_format = NVFP4
143
+ ```
144
+
145
+ ## License
146
+
147
+ Inherits the MiniMax-H3 Community License Agreement from the original model. See the
148
+ license link above.