Approximating LoRA (Project Target)
Squeeze Any Ordinary LoRA Into the Shared Subspace
- model
- clip
- subspace
- MODEL
- CLIP
ApplyUniversalLoRA (displayed as "Approximating LoRA (Project Target)") is the most interesting node in this pack, and the one least likely to be useful to you. Unlike ApplyUniversalWeights, which consumes a pre-compressed alpha file, this node takes a normal, everyday LoRA - the kind sitting in your loras folder - and projects it onto the shared subspace. Then it applies the projection instead of the original.
What "projecting" means here
You have a subspace basis V and mean μ for each layer (from the UNIVERSAL_SUBSPACE loaded by UniversalLoRALoader). Any LoRA's down/up weights can be approximated as w ≈ μ + V·α. To find the best α, the node does a least-squares fit - specifically it stacks the down and up matrices into one big joint system and calls torch.linalg.lstsq to solve for the alpha that minimizes reconstruction error. Then it rebuilds w = μ + V·α and applies that reconstruction.
That's why the display name says "approximating": this is a lossy compression. Whatever the basis can't express gets thrown away. The code even has to resize the LoRA's rank to match the basis rank first - truncating if your LoRA has more rank than the basis, zero-padding if it has less.
The inputs
modelandclip- as usual.subspace- theUNIVERSAL_SUBSPACEbasis.target_lora_name- a dropdown of the normal LoRA files in yourlorasfolder. This is the LoRA being projected.strength_model/strength_clip- default 1.0, range -10 to 10, same meaning as always.
Outputs are MODEL and CLIP, same as every other LoRA node.
The honest take
If you just want your LoRA to work, use the stock LoraLoader. You already have a perfectly good LoRA file - projecting it into a subspace and reconstructing it is strictly lossy with no visible payoff at inference. This node exists for people doing the research: checking how well a basis represents arbitrary LoRAs, measuring reconstruction quality, or preparing LoRAs for the pack's compressed representation. It's a tool for studying the subspace, not for generating prettier images. Set your expectations accordingly and you won't be disappointed.
Where it fails
Two silent gotchas. First, the same one as the whole pack: layers that can't be matched to the basis are skipped, and if nothing matches, the node returns the model unchanged with a Total Reconstructed Pairs: 0 debug line. Second, the rank resize is lossy by design - if your LoRA is rank 64 and the basis is rank 16, you keep 16 dimensions of it. The console tells you how many pairs were rebuilt; trust it, because the node won't tell you anything else.
Install
Nothing special, same as the rest of the pack - no requirements.txt, no model downloads:
# ComfyUI Manager: Manager → Install Custom Nodes → search "UniversalSubspace" → Install → Restart
cd ComfyUI/custom_nodes
git clone https://github.com/a-ru2016/ComfyUI_UniversalSubspace
Restart ComfyUI and find it under UniversalSubspace. Just remember: without the author's trained basis artifacts, there's nothing meaningful to project onto - the dropdown will list your LoRAs, but the subspace side will come up empty.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| subspace | UNIVERSAL_SUBSPACE | — | |
| target_lora_name | COMBO | 0 options: | |
| strength_model | FLOAT | 1.00-10–10 | — |
| strength_clip | FLOAT | 1.00-10–10 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |