Views
No views yet
[!IMPORTANT] Naming notice (2026-04-10). The "HLWQ" technique used in this model is being rebranded to HLWQ (Hadamard-Lloyd Weight Quantization). The change is only the name; the algorithm and the weights in this repository are unchanged.The rebrand resolves a name collision with an unrelated, earlier KV cache quantization method also named HLWQ (Han et al., arXiv:2502.02617, 2025). HLWQ addresses weight quantization with a deterministic Walsh-Hadamard rotation and Lloyd-Max scalar codebook; Han et al.'s HLWQ addresses KV cache quantization with a random polar rotation. The two methods are technically distinct.Existing loaders that load this repository by ID continue to work without changes. Future model uploads will use the HLWQ name.Reference paper for this technique: arXiv:2603.29078 (v2 in preparation; v1 still uses the old name).


| Component | Original | PQ5 Packed | Reduction |
|---|---|---|---|
| Transformer (42 layers) | 11.3 GB | 3.9 GB | -65% |
| T5 Text Encoder | 9.5 GB | 3.1 GB | -67% |
| VAE | 0.9 GB | 0.9 GB | BF16 |
| Total | 21.6 GB | 8.7 GB | -60% |
1# 1. Install
2pip install safetensors huggingface_hub scipy diffusers transformers accelerate
3
4# 2. Download & setup (8.7 GB)
5git clone https://huggingface.co/caiovicentino1/CogVideoX-5b-I2V-HLWQ-Q5 ./CogVideoX-PQ5
6cd CogVideoX-PQ5 && python setup.py
7
8# 3. Generate video from image
9python generate_cogvideo.py --image photo.jpg --prompt "A dog running in a park"1from diffusers import CogVideoXImageToVideoPipeline
2from diffusers.utils import load_image, export_to_video
3import torch
4
5# After running setup.py:
6pipe = CogVideoXImageToVideoPipeline.from_pretrained(
7 "./CogVideoX-PQ5", torch_dtype=torch.bfloat16
8).to("cuda")
9
10image = load_image("photo.jpg")
11video = pipe(image=image, prompt="A cat playing", num_frames=49).frames[0]
12export_to_video(video, "output.mp4", fps=8)CogVideoXImageToVideoPipeline)| GPU | VRAM | Status |
|---|---|---|
| RTX 4090 (24 GB) | 24 GB | Fits after dequant |
| RTX 3090 (24 GB) | 24 GB | Fits after dequant |
| A100 (40 GB) | 40 GB | Comfortable |
| T4 (16 GB) | 16 GB | With CPU offloading |
CogVideoX-5b-I2V-HLWQ-Q5/
├── setup.py # One-command setup
├── generate_cogvideo.py # Easy generation wrapper
├── polarquant/
│ ├── codes/ (5 shards, 6.1 GB total)
│ └── bf16/ (5 shards, 1.7 GB total)
├── vae/ (0.9 GB, BF16)
├── transformer/config.json
├── text_encoder/config.json
├── tokenizer/
└── scheduler/