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tags:
|
| 5 |
+
- quantization
|
| 6 |
+
- gptq
|
| 7 |
+
- awq
|
| 8 |
+
- nvfp4
|
| 9 |
+
- text-encoder
|
| 10 |
+
- ltx-video
|
| 11 |
+
- comfyui
|
| 12 |
+
base_model: Lightricks/LTX-2.5
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# LTX-2.5 Text Encoder — nvfp4, portable
|
| 16 |
+
|
| 17 |
+
The Gemma4-12B text encoder that drives LTX-2.5's DiT, compressed from
|
| 18 |
+
**26.264 GB to 8.46 GB** (3.10x), with **no compute-capability floor**.
|
| 19 |
+
|
| 20 |
+
Built from the encoder Lightricks published on 2026-08-17
|
| 21 |
+
(`1b92891c`, *"Aligns the published encoders with the LTX-2.5 model
|
| 22 |
+
checkpoints"*) — the revision that matches the released DiT.
|
| 23 |
+
|
| 24 |
+
## Why this one
|
| 25 |
+
|
| 26 |
+
Every other public quantization of this encoder needs recent hardware:
|
| 27 |
+
|
| 28 |
+
| build | size | needs |
|
| 29 |
+
|---|---:|---|
|
| 30 |
+
| Lightricks BF16 | 26.264 GB | — |
|
| 31 |
+
| Lightricks `comfy-int8-convrot` | 15.373 GB | cc 8.9 |
|
| 32 |
+
| DmitryDB `nvfp4` | 11.197 GB | cc 8.9, `comfy_kitchen`, CUDA 13 |
|
| 33 |
+
| joeygambino / Winnougan `w4a8` | 10.604 GB | SM 8.0+ |
|
| 34 |
+
| **this** | **8.46 GB** | **nothing beyond PyTorch** |
|
| 35 |
+
|
| 36 |
+
Dequantization happens on the CPU at load and the resident model is BF16, so
|
| 37 |
+
there is no kernel requirement to satisfy. Verified running on **Tesla V100
|
| 38 |
+
(cc 7.0)**, **A100 (cc 8.0)** and **RTX 6000 Ada (cc 8.9)**.
|
| 39 |
+
|
| 40 |
+
It is also the smallest of the set, because it quantizes the three tensors the
|
| 41 |
+
other nvfp4 recipe protects as BF16 "precision islands" — `embed_tokens` and
|
| 42 |
+
both aggregate tables, 4.4 GB of the source.
|
| 43 |
+
|
| 44 |
+
## Files
|
| 45 |
+
|
| 46 |
+
| file | build | video relL2 | audio relL2 | `\|\|Q\|\|/\|\|W\|\|` |
|
| 47 |
+
|---|---|---:|---:|---:|
|
| 48 |
+
| `A3.packed.safetensors` | bypass guard + group-bounded AWQ | **0.05204** | **0.04827** | **4.216** |
|
| 49 |
+
| `A0.packed.safetensors` | legacy guard, for comparison | 0.06061 | 0.06095 | 302.654 |
|
| 50 |
+
|
| 51 |
+
**Use `A3`.** `A0` is published only so the comparison can be checked; it
|
| 52 |
+
carries weights up to 300x their proper norm in near-dead channels, which is
|
| 53 |
+
harmless on this calibration set and fragile by construction.
|
| 54 |
+
|
| 55 |
+
## Memory
|
| 56 |
+
|
| 57 |
+
| mode | resident | encode |
|
| 58 |
+
|---|---:|---|
|
| 59 |
+
| `resident` (default) | **7.75 GiB** | dequantizes inside `forward` |
|
| 60 |
+
| `dequantized` | ~26.3 GB | one dense build at load |
|
| 61 |
+
|
| 62 |
+
The two produce `torch.equal` conditioning, so the choice is footprint against
|
| 63 |
+
speed and never quality. `resident` measured at **8.34 GiB** peak on a 16 GB
|
| 64 |
+
V100 — the encoder fits one consumer card for the first time.
|
| 65 |
+
|
| 66 |
+
## Use it
|
| 67 |
+
|
| 68 |
+
### Standalone
|
| 69 |
+
|
| 70 |
+
```python
|
| 71 |
+
from ltx_packed_codec import load_packed_model
|
| 72 |
+
from transformers import AutoTokenizer
|
| 73 |
+
|
| 74 |
+
model = load_packed_model("path/to/encoder-hf", "A3.packed.safetensors",
|
| 75 |
+
resident=True)
|
| 76 |
+
tokenizer = AutoTokenizer.from_pretrained("path/to/encoder-hf")
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
`encoder-hf` is a normal HF model directory for this encoder — config,
|
| 80 |
+
tokenizer and the assets that ship inside the original safetensors. Extract it
|
| 81 |
+
with `ltx_extract_encoder_assets.py` from the Lightricks file.
|
| 82 |
+
|
| 83 |
+
### ComfyUI
|
| 84 |
+
|
| 85 |
+
`comfy_nodes/ComfyUI-LTXPacked/` provides **LTX Packed Encoder Loader** and
|
| 86 |
+
**LTX Packed Text Encode**, which replace `CLIPTextEncode` and emit a
|
| 87 |
+
CONDITIONING directly.
|
| 88 |
+
|
| 89 |
+
They do not go through `LTXAVTextEncoderLoader`, and cannot: ComfyUI's LTX CLIP
|
| 90 |
+
path wants a sentencepiece `spiece_model` where this checkpoint carries
|
| 91 |
+
`tokenizer_json`, and its nvfp4 support requires `comfy_kitchen` plus CUDA 13
|
| 92 |
+
plus cc 8.9 — the floor this file exists to avoid. The DiT only ever needed a
|
| 93 |
+
CONDITIONING.
|
| 94 |
+
|
| 95 |
+
> **Not yet run inside ComfyUI.** The encode path is the same code this
|
| 96 |
+
> project's `ltx_conditioning_dump.py` runs daily and the conditioning wrapper
|
| 97 |
+
> is lifted verbatim from its renderer, so the pieces are exercised — but the
|
| 98 |
+
> nodes themselves have not been loaded in a live ComfyUI, and that is a
|
| 99 |
+
> different claim.
|
| 100 |
+
|
| 101 |
+
## How it was built
|
| 102 |
+
|
| 103 |
+
nvfp4 4.5 bpw (E2M1, group 16 with an fp8-e4m3 scale) on 320 projections;
|
| 104 |
+
int8 row-wise on `embed_tokens` and both aggregate tables; norms and asset blobs
|
| 105 |
+
left BF16. Per-tensor AWQ alpha search, then sequential GPTQ error compensation
|
| 106 |
+
(blocksize 128, percdamp 0.01), packed inside the build because the group scales
|
| 107 |
+
cannot be recovered afterwards.
|
| 108 |
+
|
| 109 |
+
`A3` adds three things the plain recipe lacks:
|
| 110 |
+
|
| 111 |
+
1. **No weight column is ever zeroed.** Channels are classified by an *absolute*
|
| 112 |
+
activation RMS, not a threshold relative to `mean(diag(H))` — the relative
|
| 113 |
+
rule moves with the calibration Hessian's dynamic range, which made the old
|
| 114 |
+
guard's best setting differ between Volta and Ada.
|
| 115 |
+
2. **The AWQ scale is shaped to the storage grid.** nvfp4 carries one scale per
|
| 116 |
+
16 input channels and its E2M1 grid spans 12:1; an unshaped per-channel scale
|
| 117 |
+
spans far wider inside a group and pushes the low channels under the grid
|
| 118 |
+
floor, where they quantize to exactly zero. Bounding the spread to 12:1 keeps
|
| 119 |
+
both the smoothing and the channels. The identity
|
| 120 |
+
`x·diag(1/s) @ Q(W·diag(s))ᵀ` holds for any `s`, so this needs no format
|
| 121 |
+
change.
|
| 122 |
+
3. **Escalating damping, recorded.** Group shaping removes conditioning that
|
| 123 |
+
per-channel smoothing was supplying as a side effect; `A3` needed a 10x
|
| 124 |
+
escalation, written into the artifact metadata so a damped build is never
|
| 125 |
+
silently compared with an undamped one.
|
| 126 |
+
|
| 127 |
+
## Measured limits
|
| 128 |
+
|
| 129 |
+
* **Packing is lossless.** A twin BF16 build plus a full `verify`: all 686
|
| 130 |
+
tensors value-exact. No drift here is attributable to the format.
|
| 131 |
+
* **GPTQ builds do not reproduce across GPU architectures.** Same code, plan,
|
| 132 |
+
calibration and guard: V100 0.06879, Ada 0.11210 on the older source. Within
|
| 133 |
+
one architecture they reproduce to five decimals across separate machines.
|
| 134 |
+
These files were built on an **A100**; quote that alongside any figure.
|
| 135 |
+
* **No KL or CE ratio is reported.** This artifact carries no LM head, so
|
| 136 |
+
vocabulary KL and CE ratio are undefined for its deployment path. Measured
|
| 137 |
+
instead: conditioning relL2/cosine per branch, and a five-prompt render
|
| 138 |
+
comparison against a BF16 conditioning from the same card, where `A3` is
|
| 139 |
+
closer on four of five (mean 0.05931 against `A0`'s 0.06571).
|
| 140 |
+
* **Not evaluated**: human listening, native DiT cross-attention KL, or whether
|
| 141 |
+
the remaining gap to BF16 is visible at all in finished video.
|
| 142 |
+
* Prompts asking for four-legged or wheeled robots still render humans. That
|
| 143 |
+
happens with the BF16 encoder too — a model limit, not compression damage.
|
| 144 |
+
|
| 145 |
+
## Provenance
|
| 146 |
+
|
| 147 |
+
Source `Lightricks/LTX-2.5` revision `1b92891c`+, torch 2.11.0+cu128,
|
| 148 |
+
transformers 5.14.1, plan `r45c`, calibration `calib-large.txt`. Evidence in
|
| 149 |
+
`evidence/`: gate JSON, build logs with per-layer drift and `||Q||/||W||`, the
|
| 150 |
+
A100 BF16 reference, all three conditionings, and fifteen rendered clips.
|
| 151 |
+
|
| 152 |
+
Earlier builds against the pre-2026-08-17 encoder, and the method results that
|
| 153 |
+
came from them, are at `topabaem/Pacific-LTX-2.5-Encoder-r45d`.
|