The randomized Hadamard transform needs its sign flips applied before the
transform. Applied afterwards they cannot spread anything: absmax and a
codebook symmetric about zero are both invariant under a sign flip, so the
reconstruction comes back bit-for-bit identical. The documented decorrelation
step was therefore a no-op, and any block carrying an offset or low-frequency
content stayed collapsed into a single Hadamard coefficient - a constant block
round-tripped at cosine 0.611 with a relative L2 error of 1.27, i.e. worse
than returning zeros.
Also make the test suite runnable (it errored out entirely, because pytest
imports the repository root __init__.py as a top-level module and the relative
imports failed) and stop the attention patch from raising AttributeError on
ComfyUI's attn2 path, which does not coerce a None context the way attn1 does.
Co-authored-by: Vyacheslav-Tomashevskiy <Vyacheslav-Tomashevskiy@users.noreply.github.com>
The LICENSE file held only the boilerplate notice, with the operative
terms replaced by a URL. This restores the canonical text. The existing
copyright notice is unchanged and the licence is unchanged.
Signed-off-by: Scott <scottbphone12@gmail.com>
- Replace assert-based validation with explicit checks in public API
- Correct node descriptions: round-trip experiment, not persistent KV cache
- Clear global state when TurboQuantPatch disabled
- Fix compression stats to use actual tensor bytes
Reviewed by GPT-5.4 (Codex). 14 issues found across session codebase.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Custom ComfyUI node that compresses attention KV cache by 4.6x using
TurboQuant (Google ICLR 2026) 3-bit quantization. Enables LTX-2.3 22B
to run on a single V100-SXM2-32GB with 6GB headroom.
Verified: 41 frames generated, 26.5GB peak VRAM (down from 32.4GB).
First known TQ3 KV compression deployment in a video generation pipeline.
Nodes: TurboQuantPatch (model patcher), TurboQuantInfo (stats display)
Quality: 0.983 cosine similarity, 4.57x compression ratio
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>