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.0: projection matrices and controls
Browse filesFiles changed (5)
- README.mdAdded+109
- h3_control_identity.ptAdded+3
- h3_control_zero.ptAdded+3
- h3_qwen3vl_4b_tap24.ptAdded+3
- h3_qwen3vl_4b_tap24_200prompts.ptAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109---license: mittags: - comfyui - minimax-h3 - text-to-video - qwen3-vl - text-encoderbase_model: - Comfy-Org/MiniMax-H3 - Qwen/Qwen3-VL-4B-Instructlibrary_name: comfyui---
# ClipProj — MiniMax H3 conditioning from a Qwen3-VL-4B
**Projection matrices that let a Qwen3-VL-4B replace the Qwen3-VL-32B text encoder of MiniMax H3.**
**15.7 GB → 5.2 GB of VRAM**, with no change to the diffusion model, the VAEs or the sampler.
> ⚠️ **Proof of concept — working, but a proof of concept.** It runs and produces good video, and every number below was measured on real hardware. Built and tested on a single setup (Windows 11, NVIDIA, ComfyUI 0.31.0) with deliberately limited exploration.
These files are useless on their own. They require the custom node:**[github.com/nicolab28/ComfyUI-ClipProj](https://github.com/nicolab28/ComfyUI-ClipProj)**
## What this is
MiniMax 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² ||---|---|---|---|---|| 200 prompts | 37 361 | 0.95 | 0.699 | 0.490 || 2 000 prompts | 288 608 | 0.92 | **0.712** | 0.507 |
Eight 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 first
The two control matrices exist to prove the learned matrix is doing the work rather than the diffusion model. Same prompt, same seed, only the matrix changes:
| Matrix | Output for *"a red ball on a wood table"* ||---|---|| `h3_control_zero.pt` | a countryside landscape — the prompt is entirely ignored || `h3_control_identity.pt` | a golden object in flames — unusable || `h3_qwen3vl_4b_tap24.pt` | the red ball on a wood table |
`‖W_identity‖ = 50.6` against `‖W_learned‖ = 52.4` — near-identical energy, so the difference is structural, not a matter of scale.
**If the identity control ever looks fine, the learned matrix adds nothing — and you want to know that before trusting it.**
## Known limitations
The 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.
## Licence and responsibility
These matrices are released under **MIT**, like the node.
They are derived from the activations of both models, and their legal status is unclear. They are provided as-is, for research, with no claim of ownership over anything derived from the underlying models.
- **Qwen3-VL** is published by Alibaba under **Apache 2.0**. Read and comply with its terms and acceptable-use policy.- **MiniMax H3** ships under a **custom licence**. Read it before any use, particularly commercial.
This project is **not affiliated with, endorsed by, or connected to** Alibaba / Qwen, MiniMax, or Comfy Org.
You remain responsible for what you generate and for complying with the licences of every model you load.
## Credits
Vibe-coded with **Anthropic Claude Code (Opus 5)**. Every number quoted was measured on real hardware, not estimated: where a prediction turned out wrong, the measurement won and the text was corrected.123version https://git-lfs.github.com/spec/v1oid sha256:48c70ae8c619c2818a4e4b1d19ebcfef9ce339979030aa4f7ebbd1f6ac0b6f79size 52493396123version https://git-lfs.github.com/spec/v1oid sha256:99cac87a9f75e65ad45c06822cc7a280c51c681e197bc45ba04a47312ad898a4size 52493418123version https://git-lfs.github.com/spec/v1oid sha256:85db0214838af840e5de75cfc6abc4faff5f1948a8d0918173373e6fae961358size 52493451123version https://git-lfs.github.com/spec/v1oid sha256:5789fd6f533a8985360047c53a06fe12e84ac97d10093a7c70dedf57a52cc405size 52493063README.mdAdded+109
h3_control_identity.ptAdded+3
h3_control_zero.ptAdded+3
h3_qwen3vl_4b_tap24.ptAdded+3
h3_qwen3vl_4b_tap24_200prompts.ptAdded+3