MiniMax H3 nvfp4-awq text encoder fails to load: UnicodeDecodeError (utf-32-be) on empty comfy_quant tensors, then "Unknown quantization format"
### Describe the bug
The official MiniMax H3 text encoder from `Comfy-Org/MiniMax-H3` (`text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors`, 15.69 GB) cannot be loaded with `CLIPLoader(type="minimax")` in the native H3 workflow (as documented at https://docs.comfy.org/tutorials/video/minimax/minimax-h3). Two separate failures occur in sequence.
**Error 1 — UnicodeDecodeError on empty `comfy_quant` tensors:**
```
UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 28: truncated data
```
Traceback: `comfy/sd.py` `load_text_encoder_state_dicts` → `comfy/ops.py` `_load_from_state_dict` → `json.loads(layer_conf.numpy().tobytes())`.
Some `comfy_quant` tensors in this file contain only NUL bytes (e.g. `model.embed_tokens.comfy_quant` is a `uint8` tensor of shape `[29]`, all zeros — an "unquantized" placeholder). Python's `json.loads` runs `detect_encoding()` on the bytes, sees the leading NULs and guesses utf-32-be, then crashes.
**Error 2 — "Unknown quantization format" (after working around #1):**
```
ValueError: Unknown quantization format for layer model.layers.0.self_attn.q_proj
```
at `comfy/ops.py:1166` (`if module.quant_format is None: raise ...`). After treating the empty payloads as `{}`, the layer config of the official nvfp4 file apparently uses a format name that is not mapped in `QUANT_ALGOS` on current master.
### Expected behavior
The officially published files for the native H3 tutorial should load out of the box on current master (they are the files linked from the official docs).
### Reproduction steps
1. Download `qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors` from `Comfy-Org/MiniMax-H3` into `ComfyUI/models/text_encoders/`.
2. Submit the native I2V workflow: `UNETLoader(minimax_h3_fl2va_pruned_int8_convrot.safetensors)` + `CLIPLoader(qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors, type="minimax")` + `MiniMaxH3ImageToVideo`.
3. Observe Error 1; apply the local workaround (`json.loads(x) if x.strip(b'\x00') else {}`), observe Error 2.
### Environment
- ComfyUI: master @ `344b4398` ("Support asym w4a8_int (#15308)")
- Python 3.12, CUDA 12.9, RTX 3090
- Models: `Comfy-Org/MiniMax-H3` (public), official pruned INT8 FL2VA diffusion model + nvfp4-AWQ text encoder
1 条评论