From a2df80be7e01c2bc93593a88abebfe672c6cbeef Mon Sep 17 00:00:00 2001 From: F1LIP3 Date: Sat, 15 Aug 2026 14:39:15 -0300 Subject: [PATCH] Preserve full_precision_matrix_mult in the NVFP4 metadata rewrite The conversion now copies the int8 layer's full_precision_matrix_mult flag into the rewritten .comfy_quant metadata instead of replacing it with a bare nvfp4 entry, so layers that require the full-precision matmul path keep it. --- comfy/text_encoders/minimax_music.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/comfy/text_encoders/minimax_music.py b/comfy/text_encoders/minimax_music.py index b03a08795..1f458148e 100644 --- a/comfy/text_encoders/minimax_music.py +++ b/comfy/text_encoders/minimax_music.py @@ -36,7 +36,10 @@ def _to_nvfp4(sd): sd[prefix + ".weight"] = qdata sd[prefix + ".weight_scale"] = params.block_scale sd[prefix + ".weight_scale_2"] = params.scale - sd[key] = torch.tensor(list(b'{"format": "nvfp4"}'), dtype=torch.uint8) + meta = {"format": "nvfp4"} + if "full_precision_matrix_mult" in conf: + meta["full_precision_matrix_mult"] = conf["full_precision_matrix_mult"] + sd[key] = torch.tensor(list(json.dumps(meta).encode()), dtype=torch.uint8) MODEL_CONFIG = {