r/StableDiffusion • u/BakaPotatoLord • 6d ago
Resource - Update INT8 LoRA Quantizer + Loader for ComfyUI (about 50–75% less disk space)
It's a custom node pack for ComfyUI that stores LoRA and LoKr files in INT8. Decodes them in memory when loaded and applies to models normally, targets primarily savings in storage.
Roughly 75% savings from a FP32 LoRA and 50% for BF16/FP16.
For example, it took a 8-step MOSS LoRA from 1134 MiB down to 284 MiB, so it's mostly useful for large LoRAs of a few hundred MB or more.
Heads up: it's a disk saving, not a memory one. The INT8 loader expands the LoRA in RAM, so it uses more RAM than the normal LoRA loader. For my fp32 LoRA that was about 1.1 GB more. There's a dtype option, default is bf16, which brings it down to roughly 0.5-0.7 GB more for fp32 LoRAs. I haven't measured VRAM.
Has these nodes for now
- Quantize LoRA to INT8 - for one file
- Quantize LoRA Folder to INT8 - for processing a subfolder under loras folder
- Load INT8 LoRA - for loading a LoRA (Model only/Model + CLIP), there's also a node for stacking three loras
- LoRA Switch (INT8 / Original) - to switch between the INT8 lora, the original and no lora at all, so you can compare them with the same seed
You can chain em with normal lora loaders as well, quantized files get saved in models/loras_int8
Installation
Install it from ComfyUI Manager, it's listed as LoRA INT8 Quantizer & Loader (registry name int8-lora).
Or clone it into your ComfyUI/custom_nodes folder and restart:
git clone https://github.com/bakapotatolord/ComfyUI-INT8-LoRARepo - https://github.com/bakapotatolord/ComfyUI-INT8-LoRA

Same prompt and seed with the original fp32 LoRA, INT8 restored as fp32 and INT8 restored as bf16.

Same thing but with a lighting LoRA at -1, mode none on the left so you can see the effect.
Repeated image generations mostly yielded highly similar outputs with some cases where minor details can change slightly due to numerical changes. Quality seems to hold from my testing. A very detailed prompt keeps the outputs closer.

Quantization Method
By default it uses the 'auto' method which basically quantizes the file using INT8 and INT8 ConvRot (with rotation) and whichever has the overall lower error gets saved.
Ensure to refresh the models (press R) after quantizing so it shows up in the INT8 LoRA Loader
Limitations
- Saves storage, not RAM/VRAM (see the heads up above)
- I tested only MOSS and Anima LoRAs/LoKrs so other adapter formats might not work yet
Disclaimer
I used AI assistance heavily for this while I mostly just decided the direction and stuff. I did spend quite a while trying to understand the code and then testing it so hope it works well if you decide to try it out.
Hoping to get some feedback on this.
3
u/purelawan 6d ago
Nice, the H3 and MOSS loras are getting huge so this is useful. Two questions: are the scales per row or one per tensor? With fp32 loras that were trained with a few outlier weights, per-tensor int8 can flatten the small ones. And did you run the switch node with a fixed seed on a video model and diff the frames? On image models a small change rarely shows, but on video it sometimes turns into a slow drift over the clip, so that would be the test I'd trust.
2
u/BakaPotatoLord 5d ago
I really would like to know why this is getting downvoted. Did my node fall short of any expectation or? I really would appreciate feedback so I can work on improving it.