[MiniMax-H3] Load the pruned ComfyUI checkpoints and add single-file support for MiniMax-H3-Image

Đang mở
#15,302 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@guoriyue đang làm issue này rồi.

Từ ngày 15/11/2026.

  • #15299 của @guoriyue — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, pytorch
Lĩnh vực
machine-learning

Hướng nghiên cứu

The referenced implementation is PR #15299, already open, so start by reading that diff rather than the issue text alone. The transformers live under src/diffusers/models/transformers/ (MiniMaxH3Transformer3DModel, MiniMaxH3ImageTransformer2DModel), and the single-file mapping is in src/diffusers/loaders/single_file_model.py plus the MiniMax-H3 original-config file in single_file_utils.py. The open design question — whether a new config_from_checkpoint_fn key in the single-file registry is acceptable — needs a maintainer answer before any patch, and done means a pruned ComfyUI checkpoint loads through from_single_file with tests covering the unstripped config path.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem? Please describe.

ComfyUI distributes pruned MiniMax-H3 checkpoints (Comfy-Org/MiniMax-H3, Comfy-Org/MiniMax-H3-Image). They cannot be loaded in diffusers today:

  • The pruned files replace the timestep MLP and the wide AdaLN projections (about 40% of the parameters) with the activated timestep curve sampled on a 1025-point grid (adaln_t_table) and 8-input AdaLN projections. MiniMaxH3Transformer3DModel has no module that matches these weights, and from_single_file refuses adaln_t_table.
  • MiniMaxH3ImageTransformer2DModel has no single-file support at all (no FromOriginalModelMixin), and the ComfyUI file stores the PDD heads as a stacked bank (head 0 plus per-step offsets) rather than as pdd_proj_out.{i}.

Describe the solution you'd like.

  1. An opt-in config field (adaln_curve_grid) on both transformers. When set, time_embedder is a lookup of the sampled curve, linearly interpolated as ComfyUI does, and the AdaLN projections skip their SiLU. Stock configs keep their current behaviour.
  2. from_single_file for both transformers: map adaln_t_table to the table, unstack the PDD head bank for the image model, and refuse quantized ComfyUI files with a message naming the bf16 file.
transformer = MiniMaxH3ImageTransformer2DModel.from_single_file(
    "https://huggingface.co/Comfy-Org/MiniMax-H3-Image/blob/main/diffusion_models/minimax_h3_image_pruned_bf16.safetensors",
    dtype=torch.bfloat16,
)

Design question for maintainers

The repository config on the Hub describes the unpruned model, and no Hub repo carries a pruned diffusers config that a model type could point at. So the pruned shape (adaln_curve_grid, time_embed_dim) has to be read off the checkpoint itself. #15299 does this with a new optional key in the single-file registry, config_from_checkpoint_fn. Is a new registry key acceptable here, or would you prefer another route (for example a separate model type with its own config)?

Additional context.

Implementation proposed in #15299.

Ngôn ngữ chính
Python
Star
34.9k
Fork
7.5k
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
65

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của huggingface/diffusers

Tất cả issue của huggingface/diffusers

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.