LoRA Quantize FP8 (CCN)
LoRA Quantize FP8 (CCN)
- saved_path
LoRA Quantize FP8 (CCN) takes a LoRA file and re-saves it with its weights in 8-bit floating point - half the size, same file, same architecture. Given the KB's settled consensus that fp8 is "basically free" for diffusion inference (half the VRAM of fp16 at near-zero quality loss), this is the node for the person with 300 LoRAs and a shrinking disk, or a LoRA library that's about to move to a small SSD. The math is a straight cast: every floating-point tensor becomes float8_e4m3fn (the default, the one ComfyUI uses everywhere) or float8_e5m2 (more exponent range, less precision) - integer/index tensors are left alone.
A couple of things make it more than a dumb cast. There's a prune_ratio knob (0 to 0.9) that zeroes out the smallest fraction of a LoRA layer's singular values before quantizing - it SVDs the up/down product, kills the bottom fraction of singular values, and rebuilds the up/down pair. That's real pruning, not just rounding, and it can shave meaningful size on top of fp8 for LoRAs with lots of near-zero components. 0 disables it, which is the right default - pruning is lossy by design, and the fp8 cast alone is the free win.
The node outputs a single saved_path string pointing at the new file. If you leave output_filename blank, it auto-names as <original>_fp8.safetensors in the same folder as the source - which is convenient and also the thing to watch, because it writes next to your originals rather than into an output folder. Set a custom output_filename if you want it elsewhere, and it'll append .safetensors if you forget the extension. It's an output node, so the path prints to the UI, and it logs the size reduction ("120.0MB -> 60.0MB (50%)") to the console.
Caveat on the format itself, worth internalizing from the KB: fp8 is a single rung on the quantization ladder, not a compression scheme. It trades the precision of values, not the count - so a rank-128 LoRA stays rank-128, just with 8-bit values. For a rank-32 character LoRA that's already small, you might save single-digit megabytes and gain nothing but a quality question mark. This node shines on the big, heavy extracted LoRAs, not the whole library.
Install
Part of ComfyCollectorNodes - note this one ships in the pack's WIP folder, so install via git clone (which includes it) rather than assuming a registry build:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Restart ComfyUI; find "LoRA Quantize FP8 (CCN)" in the "CCN" category. Uses only torch + safetensors, both stock. No model downloads, MIT.
Common issues
The main gotcha is the output location - it writes beside the source file, so check saved_path before you start cleaning up "duplicates." Pruning more than ~0.3 usually starts to bite quality on character LoRAs; if you're pruning, validate on a real generation, not just a loading test. And there's a subtle one for those using ComfyUI's native fp8 compute: 40-series and newer cards handle e4m3fn natively and fast, but older GPUs will load fp8 and still compute in higher precision - you save memory either way, just not speed. Don't re-quantize a file that's already fp8; it gains nothing and adds a rounding step.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| lora_name | COMBO | 0 options: | |
| output_filename | STRING | Leave blank to auto-name with _fp8 suffix | |
| prune_ratio | FLOAT | 0.000–0.9 | Fraction of smallest singular values to zero out before quantizing. 0 = no pruning. |
| dtype | COMBO | 2 options: float8_e4m3fn, float8_e5m2 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| saved_path | STRING | — |