Skip to content

Conversation

@woct0rdho
Copy link
Contributor

@woct0rdho woct0rdho commented Nov 17, 2025

This hugely reduces the time to prune a LoRA, without visible quality loss compared to the full SVD. The time is reduced from 3 hours (Wan) and 1 hour (Qwen-Image) to a few seconds on my laptop.

See https://docs.pytorch.org/docs/stable/generated/torch.svd_lowrank.html for details. Maybe we can increase niter for even better quality but I think the default niter=2 already gives good enough quality. Kijai's LoraExtractKJ node uses niter=7 by default, see https://github.com/kijai/ComfyUI-KJNodes/blob/bb205d809b467307b8ec3bb1a22680a4873187f8/nodes/lora_nodes.py#L30 (but they don't yet do adaptive rank after svd_lowrank)

@kohya-ss
Copy link
Owner

Thank you, this is really nice! I'd like to merge this sooner. I'm a little busy so please wait a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants