Run this model with HF Jobs
Run NicoLab28/ClipProj-MiniMax-H3 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/NicoLab28/ClipProj-MiniMax-H3. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/NicoLab28/ClipProj-MiniMax-H3 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
ClipProj v0.1.1: attention-sink vector added to every matrix, plus 8B and int8_convrot
Browse filesFiles changed (7)
22 unmodified lines2324252627282930313233343536373839404142434445464748493 unmodified lines53545556575859606111 unmodified lines73747576777879808182838485868788899091929322 unmodified linesThese files are useless on their own. They require the custom node:**[github.com/nicolab28/ComfyUI-ClipProj](https://github.com/nicolab28/ComfyUI-ClipProj)**## What this isMiniMax H3 conditions on a Qwen3-VL-32B truncated to 50 layers β 15.7 GB in NVFP4 β solely to turn a prompt into a `[seq, 5120]` tensor. This repository provides a learned linear map that lets the much smaller Qwen3-VL-4B (2560 dims) produce the same conditioning:```cond = ((h - mean_in) / std_in) @ W * std_out + mean_out```It works because the 4B and the 32B share the **same tokenizer** (151936 tokens): a prompt yields the same tokens at the same positions in both models, so a position-by-position mapping between their hidden states can be learned. Calibration is plain **ridge regression** β no gradients, no epochs, no learning rate.## Files| File | Size | Description ||---|---|---|| `h3_qwen3vl_4b_tap24.pt` | 50 MB | **The learned matrix.** Calibrated on 2 000 prompts / 288 608 tokens, tap 24 of 36 || `h3_qwen3vl_4b_tap24_200prompts.pt` | 50 MB | Same, calibrated on 200 prompts only β kept for comparison || `h3_control_identity.pt` | 50 MB | **Control**: raw copy of the 2560 dims, no learning || `h3_control_zero.pt` | 50 MB | **Control**: `W = 0`, carries no prompt information |Put them in `ComfyUI/models/clip_projections/`.## Measured results| Corpus | Tokens | Cross-prompt CKA | Test cosine | Test RΒ² |3 unmodified linesEight times the data buys 1.8 % of cosine: the linear projection is **at its ceiling**, not starved of data. Going further needs an MLP, not more prompts.A cosine of 0.71 sounds poor and is not β the DiT tolerates far more than the metric suggests. What holds up in actual generation: simple prompts, structured multi-shot prompts (four distinct cuts with no bleed between them), and fl2va with first and last frame, even though the matrix only ever saw text positions.The matrix is also **robust to a change of encoder weights**: one calibrated on bf16 works on an abliterated fp8 variant, with a measured cosine gap of 0.0023. One matrix covers every Qwen3-VL-4B variant.## Run the controls first11 unmodified lines## Known limitationsThe 4B holds up well enough on everything tried so far, but the trials were not pushed far, and the honest summary is that **you lose knowledge the 32B has**.**Named references disappear.** Some real people come through, others do not: in testing, one well-known actor rendered correctly while another was simply absent, replaced by a generic figure. The same almost certainly applies to landmarks, artworks, brands, film styles and any other named reference. A 4B stores far fewer facts than a 32B, and no projection can restore knowledge that was never encoded. We did not map which references survive β assume any proper noun is at risk.Other known gaps:- **ref2va** (video / audio references) is untested and refused by the node- image references work in **fl2va**, but the matrix was calibrated on text positions only, so vision positions are projected out of their training distribution## Required models| Role | Model ||---|---|| Diffusion model + VAEs | [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3) || Text encoder (small) | [Comfy-Org/Krea-2](https://huggingface.co/Comfy-Org/Krea-2) β `text_encoders/qwen3vl_4b_fp8_scaled.safetensors` |The 32B text encoder is **no longer needed** β that is the entire point.22 unmodified lines23242526272829303132333435363738394041424344454647484950515253545556575859606162633 unmodified lines67686970717273747511 unmodified lines8788899091929394959697989910010110210310410510610710810922 unmodified linesThese files are useless on their own. They require the custom node:**[github.com/nicolab28/ComfyUI-ClipProj](https://github.com/nicolab28/ComfyUI-ClipProj)**## v0.1.1 β re-download if you got the first release**The first release was missing the attention-sink vector, and short prompts suffered for it.** The first token of a sequence is an attention sink: its direction is constant from one prompt to the next (cosine 1.0000 measured over 1966 prompts) and it carries nothing from the text, yet its norm reaches 16 500 against 291 for a text token. Calibration excluded it, rightly β its extreme values would wreck the statistics β but the node projected it anyway, through a matrix that had never seen one, producing an arbitrary vector of enormous norm. Invisible on a 200-token prompt where it is 0.5 % of the positions, ruinous on a 7-token one where it is 14 %.Every matrix here now carries the measured sink vector and substitutes it at inference. Since the vector is constant, this is not an approximation: it is the value the 32B would have produced.Also new in this release: an **8B matrix**, an **int8_convrot matrix**, and **ref2va now works** β see below.## What this isMiniMax H3 conditions on a Qwen3-VL-32B truncated to 50 layers β 15.7 GB in NVFP4 β solely to turn a prompt into a `[seq, 5120]` tensor. This repository provides a learned linear map that lets a much smaller Qwen3-VL produce the same conditioning:```cond = ((h - mean_in) / std_in) @ W * std_out + mean_out```It works because every Qwen3-VL shares the **same tokenizer** (151936 tokens): a prompt yields the same tokens at the same positions in both models, so a position-by-position mapping between their hidden states can be learned. Calibration is plain **ridge regression** β no gradients, no epochs, no learning rate.## FilesPut them in `ComfyUI/models/clip_projections/`.| File | Encoder it was calibrated on | Corpus | Test cosine ||---|---|---|---|| `h3_qwen3vl_4b_tap24.pt` | `qwen3vl_4b_bf16` | 2 000 prompts | 0.712 || `h3_qwen3vl_4b_tap24_200prompts.pt` | `qwen3vl_4b_bf16` | 200 prompts | 0.699 || `h3_qwen3vl_4b_int8convrot_tap24.pt` | `qwen3vl_4b_int8_convrot` | 240 prompts | 0.697 || `h3_qwen3vl_8b_tap24.pt` | `qwen3vl_8b_nvfp4` | 203 prompts | 0.731 || `h3_control_identity.pt` | β | β | control || `h3_control_zero.pt` | β | β | control |**Start with `h3_qwen3vl_4b_tap24.pt`.** It is calibrated on the largest corpus, and one matrix covers every Qwen3-VL-4B variant β the measured cosine gap between a bf16-calibrated matrix applied to an abliterated fp8 encoder is 0.0023. The two smaller-corpus matrices are provided for comparison, not because they are better.The **8B matrix needs an 8B encoder** β different input width (4096 instead of 2560), so it is not interchangeable with the 4B ones. The node checks and refuses a mismatch.## Measured results| Corpus | Tokens | Cross-prompt CKA | Test cosine | Test RΒ² |3 unmodified linesEight times the data buys 1.8 % of cosine: the linear projection is **at its ceiling**, not starved of data. Going further needs an MLP, not more prompts.A cosine of 0.71 sounds poor and is not β the DiT tolerates far more than the metric suggests. What holds up in actual generation: simple prompts, structured multi-shot prompts (four distinct cuts with no bleed between them), fl2va with first and last frame, and ref2va with a reference image.Fidelity does **not** collapse on short prompts, contrary to what one might expect from a corpus of long ones: measured per-token cosine goes from 0.937 at 80 words down to 0.908 at 2 words, a 3 % decline, once the sink is handled.## Run the controls first11 unmodified lines## Known limitations**Named references depend on the encoder, not on the projection.** This was measured rather than guessed: asking the encoder to describe a person in plain text β which bypasses the matrix entirely β shows where the knowledge actually stops. The 4B places Scarlett Johansson correctly as Black Widow but believes she has dark brown hair; the 8B describes her correctly as blonde with blue eyes. So when a proper noun renders as the wrong person, question the encoder first.The practical workaround is to describe rather than name: *"the actress X as [role], blonde, ..."* recovers an identity that the bare name loses, on both the 4B and the 8B. A name is a fragile signal carried by two or three tokens; a description spreads it over a dozen redundant ones and the reconstruction error averages out instead of accumulating.Note that this does not apply to **ref2va**: there the identity comes from the reference image, so the encoder's factual gaps stop mattering.**Quantisation costs facts.** The same test on `int8_convrot` against `bf16` shows two factual errors appearing under quantisation. Fine for general use, worth knowing if your prompts lean on proper nouns.**Speech in languages other than English degrades.** Reported and reproduced with French: the 32B pronounces it cleanly, a projected 4B or 8B does not. This is *not* a corpus problem β measured on identical English prompts differing only in the quoted line, French tokens reconstruct at 0.8974 against 0.8996 for English, which is noise. A cosine of 0.90 is ample for visual semantics and insufficient for phonetics; the DiT's audio branch is far more demanding than its image branch, and a language the model handles less confidently has less margin to absorb the error.## Required models| Role | Model ||---|---|| Diffusion model + VAEs | [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3) || Text encoder, 4B | [Comfy-Org/Krea-2](https://huggingface.co/Comfy-Org/Krea-2) β `text_encoders/qwen3vl_4b_fp8_scaled.safetensors` || Text encoder, 8B | any ComfyUI-format Qwen3-VL-8B (the 8B matrix expects 4096 input dims) |The 32B text encoder is **no longer needed** β that is the entire point.
123version https://git-lfs.github.com/spec/v1oid sha256:48c70ae8c619c2818a4e4b1d19ebcfef9ce339979030aa4f7ebbd1f6ac0b6f79size 52493396123version https://git-lfs.github.com/spec/v1oid sha256:36119c56154dda6984317a35feee38577a4f8793ae87cd9db79a42aa2d676922size 52514021
123version https://git-lfs.github.com/spec/v1oid sha256:99cac87a9f75e65ad45c06822cc7a280c51c681e197bc45ba04a47312ad898a4size 52493418123version https://git-lfs.github.com/spec/v1oid sha256:ee3e85bf9851f0370b3a5ec328da34f0a4ba8b0845d230b89a00fb73a2491136size 52513909
123version https://git-lfs.github.com/spec/v1oid sha256:11aa0b0f14c8dd5a2f0c2206d3a44dabebbe4167ffb13bee0c23817d2ceab587size 52514229123version https://git-lfs.github.com/spec/v1oid sha256:85db0214838af840e5de75cfc6abc4faff5f1948a8d0918173373e6fae961358size 52493451123version https://git-lfs.github.com/spec/v1oid sha256:941b94675714985232346ffb9e06cf8a3dfb1c61cfa6e2fb24a733dabec60df1size 52514021
123version https://git-lfs.github.com/spec/v1oid sha256:5789fd6f533a8985360047c53a06fe12e84ac97d10093a7c70dedf57a52cc405size 52493063123version https://git-lfs.github.com/spec/v1oid sha256:74a78d637e3799bd380c772c016e7a8e577216699c191d703c331d9c541cda8bsize 52514089
123version https://git-lfs.github.com/spec/v1oid sha256:363d15189c5a5fdd67d831e613108e9e9babd88fd2d09e6a14727493f89b4f33size 83983589README.md+33-17
h3_control_identity.pt+2-2
h3_control_zero.pt+2-2
h3_qwen3vl_4b_int8convrot_tap24.ptAdded+3
h3_qwen3vl_4b_tap24.pt+2-2
h3_qwen3vl_4b_tap24_200prompts.pt+2-2
h3_qwen3vl_8b_tap24.ptAdded+3