feat(minimax-h3): single-file truncated int8-convrot Qwen3-VL text encoder (PR 7) - #146
Open
lstein wants to merge 1 commit into
Open
Conversation
lstein
force-pushed
the
minimax-h3/07-quantized-text-encoder
branch
from
August 5, 2026 21:22
d514aa4 to
471df42
Compare
lstein
force-pushed
the
minimax-h3/06-single-file-int8
branch
from
August 5, 2026 21:22
a19f545 to
1f1a342
Compare
…coder support
Loads Comfy-Org's qwen3vl_32b_minimax_h3_{bf16,int8_convrot} single files (25.3 GiB int8 vs
the folder's 62 GiB bf16) as a text-encoder override on the H3 model loader node. The files
are a 50-layer truncation matching H3's conditioning contract (unnormalized hidden state
after layer 50; no final norm, no LM head - the loader installs an Identity norm and ties
the unused head to the embeddings). Quantized layers reuse the PR-6 Int8ConvrotLinear
runtime; tokenizer/processor still come from the diffusers folder. nvfp4 repacks are
rejected from the header before any tensor read.
Probe keys on the file's explicit minimax_h3_te safetensors metadata (structural fallback
for stripped re-uploads); Krea-2's Qwen3VLEncoder pickers and default-encoder selection are
scoped to exclude the H3-truncated encoders. Params persist v6->v7 (adds
minimaxH3TextEncoderModel); loader node v1.2.0; metadata + recall wired.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lstein
force-pushed
the
minimax-h3/06-single-file-int8
branch
from
August 6, 2026 00:28
1f1a342 to
ed05671
Compare
lstein
force-pushed
the
minimax-h3/07-quantized-text-encoder
branch
from
August 6, 2026 00:28
471df42 to
724ad4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 7 of the MiniMax H3 stack (on top of #145): load Comfy-Org's layer-truncated int8-convrot Qwen3-VL-32B text encoder (
qwen3vl_32b_minimax_h3_int8_convrot.safetensors, 25.3 GiB) as a single-file override for the H3 folder's 62 GiB encoder. Tokenizer and processor still come from the folder.Why: the bf16 encoder is ~64 GB of RAM/VRAM working set — two-thirds of a 96 GB machine by itself, and the reason concurrent H3 sessions thrash. The quantized file is fully resident on one GPU, drops session RAM by ~40 GB, and encodes ~22% faster (50 layers computed instead of 64).
The subtle part: truncation semantics
The file ships 50 of 64 layers, no
model.norm, nolm_head, and declares its contract in safetensors metadata:"output": "unnormalized_hidden_after_layer_50". H3 conditioning readshidden_states[50]unnormalized — but on a truncated stack, transformers tie-replaces the last hidden-states entry with the post-final-norm tensor. The loader therefore installsnn.Identity()as the final norm, makinghidden_states[50]bit-identical to the raw last-layer output. Verified two ways:hidden_states[k]), with a negative control showing a surviving real norm corrupts the tensor;The absent
lm_headis tied to the embeddings (never used — H3 is hidden-states-only conditioning).Wiring
Qwen3VLEncoder_Checkpoint_MiniMaxH3_Config: metadata-primary fingerprint + structural key checks on both paths; cross-probed against Krea-2's 4B encoder configs and PR 6's transformer config in both directions; identification fixture from the real file header. nvfp4 files rejected before the 25 GiB read.SubModelType.TextEncoder; bundled Apache-2.0 config (field-identical to the folder's, verified) with layer-count override; strict load asserting the missing set is exactly{lm_head.weight}.minimax_h3_model_loaderv1.2.0: optionaltext_encoder_modelfield; default-workflow pins bumped; schema regen.modelsLoaded,modelSelectedauto-select) now use a Krea-2-scoped guard, with an unmocked regression test proving the H3 encoder is never auto-selected for Krea-2.Known limitations
_version5 (PR feat(minimax-h3): linear UI — generate-tab t2v/i2v and image output mode (PR 4/5) #143), 6 (PR feat(minimax-h3): single-file pruned/int8-convrot transformer support (PR 6) #145), 7 (this PR); flux2 also claims 5 — second-to-land renumbers.Testing
Backend 151 passed (H3 suite 46, identification 90 incl. new fixture, workflow-registry 15); ruff 0.11.2 clean. Frontend tsc/eslint/prettier/knip clean, 1722 tests, vite build OK. Real-header dry-run: all 1602 tensors map key-for-key; 350 int8 swaps. Adversarial fresh-context review completed; the one confirmed defect (unscoped Krea-2 auto-select) fixed with regression coverage.
Manual gate: download the encoder file, install by direct path (probes as
qwen3_vl_encoder / checkpoint / minimax-h3), select under Advanced → Text Encoder, generate t2v; expect prompt adherence indistinguishable from the folder encoder and session RAM down ~40 GB.🤖 Generated with Claude Code