Skip to content

feat(minimax-h3): model support — vendored classes, taxonomy, probe, loader - #139

Open
lstein wants to merge 1 commit into
minimax-h3/01-audio-muxfrom
minimax-h3/02-model-support
Open

feat(minimax-h3): model support — vendored classes, taxonomy, probe, loader#139
lstein wants to merge 1 commit into
minimax-h3/01-audio-muxfrom
minimax-h3/02-model-support

Conversation

@lstein

@lstein lstein commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked PR 2 of 5 for MiniMax H3 (Hailuo 3.0) support — the 33B omni-modal transformer that jointly denoises video and 32 kHz stereo audio, open-sourced 2026-08-03. This PR makes the FL2VA checkpoint installable and loadable; the invocation nodes come in the next PR.

Depends on #138 (branch is stacked on minimax-h3/01-audio-mux).

  • Vendored model classes (invokeai/backend/minimax_h3/): MiniMaxH3Transformer3DModel, AutoencoderKLMiniMaxH3 (video VAE), AutoencoderKLMiniMaxH3Audio, MiniMaxH3Scheduler — from diffusers PR #14355 at abc5e9bf71 (unreleased branch; verified byte-identical except absolute-import rewrite + import sorting; every referenced symbol exists in the pinned diffusers 0.39.0). When a tagged diffusers ships these, the vendoring deletes cleanly.
  • Taxonomy: BaseModelType.MiniMaxH3, MiniMaxH3VariantType.FL2VA, SubModelType.AudioVAE + SubModelType.Processor (H3 needs the Qwen3VLProcessor even for text-only encoding).
  • Probe: keys on the Modular Diffusers root config (modular_model_index.json, class MiniMaxH3ModularPipeline) plus the audio_vae config as a partial-download guard, and the FL2VA transformer folder for the variant. The HF repo's FL2VA//Ref2VA/ remote-code subtrees (class MiniMaxH3Pipeline) are deliberately rejected; Ref2VA-only downloads fail identification rather than being mislabeled. modular_model_index.json is now a recognized root-config marker in the directory scan — H3 installs have hundreds of shard files and would otherwise be rejected by the 50-file guard.
  • Loader: explicit submodel dispatch (vendored classes in bf16; Qwen3-VL-32B via Qwen3VLForConditionalGeneration with the rope-config fix lifted from krea2 into model_manager/util/qwen3_vl.py; audio VAE kept fp32 — it's 0.6 GB and half-precision audio artifacts are audible).
  • Defaults: steps 50, cfg 1.0 (checkpoints are guidance-distilled — no CFG, no negative prompt), native 1344×768 canvas.
  • Schema/typegen: regenerated openapi.json + schema.ts, with the minimal type-level frontend registration (zod enums + exhaustive MODEL_BASE_TO_* records) so tsc and typegen-checks stay green. All UI behavior lands in the linear-UI PR.

An adversarial review of this diff was run; confirmed findings fixed: ModelRecordChanges.variant union (editing an installed H3 model 422'd), typegen drift, and a TypeError on non-string _class_name in the marker check.

Testing

  • tests/model_identification: 88/88, including a new LFS fixture built from the real HF repo config files (stripped stub shards). Reviewer verified exactly-one-config-matches, and that Ref2VA-only / missing-audio-VAE folders fail identification as designed.
  • tests/app/services/model_install|model_records|model_load: 82 passed.
  • Frontend: tsc clean, eslint/prettier clean, 1718 unit tests pass.
  • Vendored classes instantiate from the real configs on the meta device (transformer = 33.12B params); scheduler round-trips both shift configs.

Manual test gate for this PR: install the H3 diffusers layout via Model Manager (HF repo MiniMaxAI/MiniMax-H3, root layout minus transformer_ref — ~106 GB, or wait for PR 5's starter entry) and confirm it probes as minimax-h3 / fl2va with working submodel loads.

🤖 Generated with Claude Code

…loader

Adds installable model support for MiniMax H3 (Hailuo 3.0) FL2VA, the
33B omni-modal transformer that jointly denoises video and stereo audio.

- Vendors MiniMaxH3Transformer3DModel, AutoencoderKLMiniMaxH3,
  AutoencoderKLMiniMaxH3Audio and MiniMaxH3Scheduler from diffusers PR
  #14355 at abc5e9bf71 (unreleased branch) into invokeai/backend/minimax_h3.
  Only local changes: absolute imports + ruff import sorting; all
  referenced symbols exist in the pinned diffusers 0.39.0. B905 is
  ignored for the vendored files to keep them upstream-identical.
- Taxonomy: BaseModelType.MiniMaxH3, MiniMaxH3VariantType.FL2VA,
  SubModelType.AudioVAE + SubModelType.Processor (the H3 layout needs
  both; the Qwen3VLProcessor is used even for text-only encoding).
- Probe: Main_Diffusers_MiniMaxH3_Config keys on the Modular Diffusers
  root config (modular_model_index.json, class MiniMaxH3ModularPipeline)
  plus the audio_vae config as a partial-download guard. The repo's
  FL2VA/-Ref2VA/ remote-code subtrees declare MiniMaxH3Pipeline and are
  deliberately not matched. Ref2VA-only installs fail identification
  rather than mislabeling. modular_model_index.json is now a recognized
  root config marker in the factory scan (H3 installs have hundreds of
  shard files and would otherwise be rejected as non-models).
- Loader: explicit submodel dispatch (vendored classes bf16; Qwen3-VL-32B
  via Qwen3VLForConditionalGeneration with the shared rope-config fix,
  lifted from krea2.py into model_manager/util/qwen3_vl.py; audio VAE
  kept fp32 - half-precision audio artifacts are audible).
- Default UI settings: steps=50, cfg 1.0 (checkpoints are
  guidance-distilled - no CFG), native 1344x768 canvas.
- Identification fixture built from the real HF repo config files
  (stripped stub shards); tests/model_identification passes 88/88.

Part of the MiniMax H3 stack (PR 2 of 5); depends on the audio-mux PR.

Post-review additions:
- ModelRecordChanges.variant accepts fl2va (editing an installed H3
  model otherwise 422s on the PATCH route).
- Regenerated openapi.json + schema.ts, with the matching type-level
  frontend registration (zBaseModelType/zMainModelBase/zSubModelType/
  zAnyModelVariant entries and the exhaustive MODEL_BASE_TO_* records)
  so typegen-checks and tsc stay green. UI behavior lands in the
  linear-UI PR.
- _is_known_model_marker guards non-str _class_name (a list-valued
  _class_name in modular_model_index.json raised TypeError instead of
  reading as not-a-marker).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant