From 9f422aa5fe71dca13e24bc4d84199ff06e275fa5 Mon Sep 17 00:00:00 2001 From: uppet <110209+uppet@users.noreply.github.com> Date: Wed, 9 Sep 2026 00:02:46 +0800 Subject: [PATCH] Add MiniMax H3 architecture detection Community GGUF conversions of the MiniMax H3 video DiT (e.g. unsloth/MiniMax-H3-GGUF) ship without metadata fields, so loading falls back to tensor-name detection, which fails with 'This model is not currently supported - (Unknown model architecture!)'. Add a ModelMiniMaxH3 template detected by adaln_t_table, blocks.0.adaln_proj.linear.weight and blocks.0.attn.qkv_proj.weight, and register minimax_h3 in IMG_ARCH_LIST. Tensor names verified to match the official Comfy-Org safetensors state dict exactly. --- loader.py | 2 +- tools/convert.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/loader.py b/loader.py index 7cefb113..f124dabe 100644 --- a/loader.py +++ b/loader.py @@ -9,7 +9,7 @@ from .ops import GGMLTensor from .dequant import is_quantized, dequantize_tensor -IMG_ARCH_LIST = {"flux", "sd1", "sdxl", "sd3", "aura", "hidream", "cosmos", "ltxv", "hyvid", "wan", "lumina2", "qwen_image"} +IMG_ARCH_LIST = {"flux", "sd1", "sdxl", "sd3", "aura", "hidream", "cosmos", "ltxv", "hyvid", "wan", "lumina2", "qwen_image", "minimax_h3"} TXT_ARCH_LIST = {"t5", "t5encoder", "llama", "qwen2vl", "qwen3", "qwen3vl", "gemma3"} VIS_TYPE_LIST = {"clip-vision", "mmproj"} diff --git a/tools/convert.py b/tools/convert.py index 5029c874..8274fa3e 100644 --- a/tools/convert.py +++ b/tools/convert.py @@ -145,8 +145,14 @@ class ModelLumina2(ModelTemplate): ("cap_embedder.1.weight", "context_refiner.0.attention.qkv.weight") ] -arch_list = [ModelFlux, ModelSD3, ModelAura, ModelHiDream, CosmosPredict2, - ModelLTXV, ModelHyVid, ModelWan, ModelSDXL, ModelSD1, ModelLumina2] +class ModelMiniMaxH3(ModelTemplate): + arch = "minimax_h3" + keys_detect = [ + ("adaln_t_table", "blocks.0.adaln_proj.linear.weight", "blocks.0.attn.qkv_proj.weight") + ] + +arch_list = [ModelFlux, ModelSD3, ModelAura, ModelHiDream, CosmosPredict2, + ModelLTXV, ModelHyVid, ModelWan, ModelSDXL, ModelSD1, ModelLumina2, ModelMiniMaxH3] def is_model_arch(model, state_dict): # check if model is correct