Lora Reduce Rank (QQ)
Shrink an over-ranked LoRA without throwing away the effect
LoraReduceRank is a file-shop tool for LoRAs that are carrying more rank than they need. Rank is LoRA capacity - higher rank, bigger file, slower inference, and (above a point) overfitting - and a lot of community LoRAs are trained at rank 64 or 128 when the effect would survive at 16. This node does SVD compression to reduce the rank, based on kohya's sd-scripts, and writes out a smaller file. It's marked EXPERIMENTAL in the source, which is the author's honest way of saying "this works, but verify your results."
Inputs: lora_name (dropdown from ComfyUI/models/loras), new_rank (1–4096, default 8) - the target rank, or the cap when using a dynamic method - and dynamic_method, which is where it gets interesting:
disabled(default) - a straight SVD truncation tonew_rankfor every module.sv_ratio/sv_cumulative/sv_fro- pick the rank per module based on its singular-value spectrum (ratio of max singular value, cumulative energy, or Frobenius-norm retention), governed by dynamic_param (0–1, default 0.2). The result can be wildly different ranks per layer, which is often better than a flat cut because different layers need different capacity.
Then output_dtype (match_original/fp16/bf16/fp32) and verbose (console logging). No outputs - it's an output node that saves the resized LoRA.
How to think about rank here
The KB's LoRA essay has the useful framing: rank controls size and expressiveness, alpha scales the contribution, and those two interact. This node only touches rank - it re-factorizes up @ down via SVD and keeps the dominant singular directions, so the biggest chunk of the effect survives at a fraction of the size. The classic use cases: a 128-rank character LoRA you want to ship at rank 16 for faster loading on friends' machines, or a style LoRA that overfits at high rank and behaves better when squeezed (the KB notes style LoRAs often improve at lower rank). The dynamic methods are the underrated part - sv_fro with a 0.8+ retention ratio gives you a principled "keep 80% of the energy" cut instead of guessing a rank.
Installing it
Part of siraxe/ComfyUI-WanVideoWrapper_QQ via ComfyUI Manager (search WanVideoWrapper_QQ/SA-Nodes-QQ), or:
cd ComfyUI/custom_nodes
git clone https://github.com/siraxe/ComfyUI-WanVideoWrapper_QQ.git
Restart ComfyUI. No extra deps. Works on any LoRA that follows the standard key format.
Gotchas
- Test before you trust. SVD truncation is lossy; a huge rank cut on a character LoRA can soften the likeness. Cut to 32 first, A/B against the original, then go lower.
new_rankandalphaare separate - the resized file keeps its alpha, so a high-alpha LoRA reduced in rank still applies at the same strength. That's usually what you want.- Pack note: repo renamed to ComfyUI-SA-Nodes-QQ in v1.3.4; delete any stale
wanwrapper_qqfolder incustom_nodesif old workflows reference it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| lora_name | COMBO | The name of the LoRA. | |
| new_rank | INT | 81–4096 | The new rank to resize the LoRA. Acts as max rank when using dynamic_method. |
| dynamic_method | COMBO | disabled | Method to use for dynamically determining new alphas and dims |
| dynamic_param | FLOAT | 0.200–1 | Method to use for dynamically determining new alphas and dims |
| output_dtype | COMBO | match_original | Data type to save the LoRA as. |
| verbose | BOOLEAN | true | — |
Outputs (0)
No outputs