ComfyUI-H3-Text-Encoders
[!IMPORTANT] NEW (
v0.5.7+— Build Your Own Plato's Key for ANY LLM/VLM Locally + ALL 11/11pk_lora_visionVision Tower Models Recommended!):
- One-Click Zero-32B Calibration for ANY LLM / VLM (
v0.5.7+—PlatosKeyCalibrateCLIP+Alissonerdx/PlatosKey-H3-Calibration-Dataset): Want to build your own Plato's Key for any local or HuggingFace LLM/VLM (even on an 8 GB VRAM GPU)? Connect ONLY yourdonor_clipand leavetarget_clipunconnected! Using our pre-cachedQwen3-VL-32BLayer-50 targets (25 languages × 250 prompts + 250 real H3 vision scenes + 1,024 SMD T2VA samples) is faster and much lighter because you never need to download or run the 32B model. Click⚡ Generate Plato's Keyright inside the node (no downstream nodes needed!) to auto-save Text +W_visionintoComfyUI/models/clip_projections/. Grab the 5 drag-and-drop workflows atComfyUI-H3-Text-Encoders/workflows!- ⭐ Recommended — VLM Vision Tower Variant (
*_pk_lora_vision_*.safetensors— ALL 11/11 Models: Qwen 3.5/3.8, Gemma 4 & Inkling-2-Mini):
- What it does: Includes the full
pk_loratext adapter plus a calibratedW_visionprojection matrix (and a bundled Rank-16 Vision Tower LoRAvis_lora.*on all Qwen 3.5/3.8 & Gemma 4 E4B/E2B models, calibrated on 420 prompts / 1,002 images covering 1–9 multi-image RefPacks, multi-shot prompts, and 5 languages: EN, ZH, PT, ES, RU). When you pass reference images (minimax_ref_items, Ref2VA / RefPacks) or keyframes (images, FL2VA / FLF2V / H3-Image), the node automatically routes them through the donor's native Vision Tower (bothPlatosKeyPatchCLIPandPlatosKeyHFTextEncoderLoader), appliesvis_loraonly to vision modules, projects visual tokens (tag = 0) withW_visionand text tokens (tag = 1) withpk_lora, and emits exactminimax_token_tags— zero workflow changes and zero impact on text-only prompts.- Why it is recommended (and why text-only
pk_lorastays available):*_pk_lora_vision_*.safetensorsis the recommended default for all MiniMax-H3 workflows (T2VA, FL2VA, Ref2VA / RefPacks), providing full native Vision Tower conditioning alongside the exact samepk_loratext/audio quality with zero overhead on text-only prompts. The lighter text-only*_pk_lora_*.safetensorsremains available side-by-side if you prefer a smaller file size or only run text-only prompts.- Where we started → Why
pk_lora: This project began with pure zero-training Plato's Key (closed-form linear Ridge). To achieve crisp spoken audio & multi-shot quality (especially on cross-family tokenizers like Gemma 4), we combined Plato's Key with Forced Qwen-Token Segmentation and a lightweight trained Projection + Rank-32 Text Encoder LoRA — all bundled inside 1 single.safetensorsfile (*_pk_lora_vision_*.safetensors/*_pk_lora_*.safetensors, works onbf16/fp8/int8/nvfp4, zero DiT changes).- Automatic Start-of-Video Speech Fix (
inject_token0_sink = Trueinv0.3.3+): RestoresQwen3-VL-32B's universal 20 KB Token-0 Attention Sink vector in<0.01 msto eliminate clipped opening words across all keys.- All Variants Stay Available Side-by-Side:
- Qwen 3.5 / Qwen 3.8:
*_pk_lora_vision_*.safetensors(⭐ Recommended — fullpk_lora+ VLM Vision Tower +vis_loraon ALL 5/5 models, up tocos 98.0%/vis cos 89.5%,v0.4.2+) ·*_pk_lora_*.safetensors(text-only, lighter — up tocos 98.0%/quotes 96.4%) ·*_pk_ridge_*.safetensors(pure zero-training Plato's Key,R² 0.985–0.992).- Gemma 4 / Inkling-2-Mini:
*_pk_lora_vision_*.safetensors(⭐ Recommended — fullpk_loraSpeech + Multi-Shot + VLM Vision Tower on ALL 6/6 models, up tovis cos 86.8%,v0.4.2+) ·*_pk_lora_*.safetensors(text-only, lighter — Speech + Multi-Shot) ·*_pk_ridge_charov_*.safetensors(pure zero-training linear,v0.2.0+) ·*_pk_ridge_4layer_*.safetensors(legacy word-span,v0.1.8+).
[!WARNING] Update your custom node (
v0.4.2+required forvis_lora& HF loader vision!) Runcd ComfyUI/custom_nodes/ComfyUI-H3-Text-Encoders && git pull(or update via ComfyUI Manager) and restart ComfyUI.
Drop-in Plato's Key text encoder adapters to run modern LLMs/VLMs (Qwen 3.5, Qwen 3.8, Google Gemma 4, Inkling-2-Mini, or any HuggingFace transformers model) as a conditioning encoder for MiniMax-H3 (T2VA, FL2VA, Ref2VA) in ComfyUI — 1 single Text Encoder, 1 .safetensors key, zero DiT changes.
Custom node repository: alisson-anjos/ComfyUI-H3-Text-Encoders.

Deep-Dive Docs:
PK_LORA.md·CHAR_OVERLAP_V6.md·ENGINEERING_NOTES.md
Pre-Calibrated Weights & Direct Download Links
Same-Tokenizer Encoders (Qwen 3.5 / Qwen 3.8 — 1:1 Token Ridge & pk_lora)
| Encoder | ComfyUI Loader | Text Encoder Download | pk_lora_vision (⭐ Recommended, Vision Tower + Audio) / pk_lora (Text-Only) |
pk_ridge Zero-Train (Cos / R²) |
|---|---|---|---|---|
| Qwen 3.5 9B 🏆⭐ | CLIPLoader + PlatosKeyPatchCLIP |
Comfy-Org/Qwen3.5 (int8 9.8 GB / bf16 19.3 GB) |
⭐ pk_lora_vision_qwen3.5_9b (+VLM vis_lora, vis 89.5%, R² 0.493) · pk_lora_qwen3.5_9b (text-only, cos 97.9%, H3 R² 0.912) |
pk_ridge_qwen3.5_9b (93.05% / R² 0.9905) |
| Qwen 3.5 2B | CLIPLoader + PlatosKeyPatchCLIP |
Comfy-Org/Qwen3.5 (bf16 4.6 GB) |
⭐ pk_lora_vision_qwen3.5_2b (+VLM vis_lora, vis 88.5%, R² 0.443) · pk_lora_qwen3.5_2b (text-only, cos 97.1%, H3 R² 0.874) |
pk_ridge_qwen3.5_2b (92.57% / R² 0.9916) |
| Qwen 3.5 4B | CLIPLoader + PlatosKeyPatchCLIP |
Comfy-Org/Qwen3.5 (bf16 9.3 GB) |
⭐ pk_lora_vision_qwen3.5_4b (+VLM vis_lora, vis 88.9%, R² 0.463) · pk_lora_qwen3.5_4b (text-only, cos 97.6%, H3 R² 0.899) |
pk_ridge_qwen3.5_4b (91.82% / R² 0.9902) |
| Qwen 3.5 0.8B | PlatosKeyHFTextEncoderLoader |
Qwen/Qwen3.5-0.8B |
⭐ pk_lora_vision_qwen3.5_0.8b (+VLM vis_lora, vis 87.4%, R² 0.389) · pk_lora_qwen3.5_0.8b (text-only, cos 96.2%, H3 R² 0.835) |
pk_ridge_qwen3.5_0.8b (91.11% / R² 0.9901) |
| Qwen 3.8 27B 🏆 | CLIPLoader + PlatosKeyPatchCLIP |
Comfy-Org/Qwen3.8-27B (w4a8 17.3 GB) |
⭐ pk_lora_vision_qwen3.8_27b (+VLM vis_lora, vis 89.3%, R² 0.484) · pk_lora_qwen3.8_27b (text-only, cos 98.0%, H3 R² 0.917) |
pk_ridge_qwen3.8_27b (89.94% / R² 0.9846) |
Cross-Family Encoders (pk_lora Unified vs charov Zero-Training vs 4layer Legacy)
Why Cross-Family Encoders Need
pk_lorafor Audio & Spoken Dialogue: UnlikeQwen 3.5 / 3.8(which shareQwen3-VL-32B's exact BPE tokenizer 1:1), Gemma 4 and Inkling-2-Mini use completely different tokenizers and internal hidden-state geometry. Purely linear keys (4layer/charov) transfer visuals well, but struggle with crisp spoken dialogue and multi-shot choreography.pk_lorabundles Forced Qwen-Segmentation + Multi-Layer Plato's Key + a lightweight Rank-32 Text Encoder LoRA in 1 single.safetensorsfile to fix spoken audio & multi-shot alignment (zero DiT changes).
| Encoder | ComfyUI Loader | pk_lora_vision (⭐ Recommended · ✅ Vision Tower + Speech) / pk_lora (Text-Only) |
charov Zero-Train (v0.2.0+ · ⚠️ Visuals OK, Speech Limited) |
4layer Legacy (v0.1.8+ · ❌ Visuals Only, Garbled Speech) |
|---|---|---|---|---|
| Gemma 4 E4B 🏆 | CLIPLoader + PlatosKeyPatchCLIP (Comfy-Org/gemma-4) |
⭐ pk_lora_vision_gemma4_e4b (+VLM vis_lora, vis 86.4%) · pk_lora_gemma4_e4b (text-only, cos 97.6%, H3 R² 0.894) |
charov_gemma4_e4b (95.59%) |
4layer_gemma4_e4b (94.86%) |
| Gemma 4 E2B ⭐ | CLIPLoader + PlatosKeyPatchCLIP (Comfy-Org/gemma-4) |
⭐ pk_lora_vision_gemma4_e2b (+VLM vis_lora, vis 86.3%) · pk_lora_gemma4_e2b (text-only, cos 96.8%, H3 R² 0.864) |
charov_gemma4_e2b (94.77%) |
4layer_gemma4_e2b (94.46%) |
| Gemma 4 12B | CLIPLoader + PlatosKeyPatchCLIP (Comfy-Org/gemma-4) |
⭐ pk_lora_vision_gemma4_12b (+VLM Vision, vis 86.6%) · pk_lora_gemma4_12b (text-only, cos 97.3%, H3 R² 0.889) |
charov_gemma4_12b (95.26%) |
4layer_gemma4_12b (93.67%) |
| Inkling-2-Mini | PlatosKeyHFTextEncoderLoader (thinkingmachines/Inkling-2-Mini) |
⭐ pk_lora_vision_inkling2_mini (+VLM Vision, vis 85.9%) · pk_lora_inkling2_mini (text-only, cos 96.8%, H3 R² 0.863) |
charov_inkling2_mini (93.52%) |
4layer_inkling2_mini (96.23%) |
| Gemma 4 26B-A4B | PlatosKeyHFTextEncoderLoader (google/gemma-4-26B-A4B-it) |
⭐ pk_lora_vision_gemma4_26b_a4b (+VLM Vision, vis 86.6%) · pk_lora_gemma4_26b_a4b (text-only, cos 97.4%, H3 R² 0.892) |
charov_gemma4_26b_a4b (95.32%) |
4layer_gemma4_26b_a4b (95.43%) |
| Gemma 4 31B 🏆 | CLIPLoader + PlatosKeyPatchCLIP (text_encoders/) |
⭐ pk_lora_vision_gemma4_31b (+VLM Vision, vis 86.8%) · pk_lora_gemma4_31b (text-only, cos 97.9%, H3 R² 0.912) |
charov_gemma4_31b (95.90%) |
4layer_gemma4_31b (95.97%) |
Quick Setup
- Install or update (
v0.4.2+for Vision Tower /v0.5.7+for local calibration):
cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-H3-Text-Encoders.git
cd ComfyUI-H3-Text-Encoders && pip install -r requirements.txt
- Place files:
ComfyUI/models/
├── text_encoders/
│ ├── qwen3.5_9b_int8_convrot.safetensors
│ └── gemma4_e4b_it_fp8_scaled.safetensors
└── clip_projections/
├── minimax_h3_32b_pk_lora_vision_qwen3.5_9b.safetensors
└── minimax_h3_32b_pk_lora_vision_gemma4_e4b.safetensors
- Wire in ComfyUI (
strength = 1.00,apply_to_pooled = False):- Native ComfyUI encoders:
Load CLIP→Plato's Key Patch CLIP (H3 Plug & Play)→MiniMax H3 Reference to Video/MiniMax H3 Image to Video. - Any HuggingFace model:
Plato's Key Load Any HF Text Encoder (H3)(offload_to_cpu = True) →MiniMax H3 Reference to Video/MiniMax H3 Image to Video.
- Native ComfyUI encoders:
Visual Showcases
Explainer & 3-Way Comparison
4-Way Ref2VA & Pure T2VA Comparison
10-Second 6-Way Action Stress Test (Qwen + Gemma 4 + Inkling-2-Mini)
License
Apache 2.0 — see LICENSE. Inspired by Stanford Hazy Research's Plato's Key.