Nodes/Corza LoRA Loader (Clean)/Corza LoRA Loader (Clean)
ComfyUI Node

Corza LoRA Loader (Clean)

The LoRA loader that scrubs out turbo-model crunch before it happens

By CoreyCorza·Created 2 months ago·Updated 2 months ago· 7
Corza LoRA Loader (Clean)
  • model
  • clip
  • model
  • clip
lora_name
strength_model1.00
strength_clip1.00
keep_energy100.0
max_rank0
tame_layers0.00
star_rescalefalse
gate_strength1.00

You know the look: a style LoRA is gorgeous on the full model, then you run it on Krea 2 Turbo or a Flux turbo and get blocky patches, crunchy edges, and details that look compressed twice. That's not your prompt. It's what stacking LoRAs on a few-step distilled model does. Corza LoRA Loader (Clean) is a drop-in replacement for the stock Load LoRA that quietly rewrites the LoRA's internal math before ComfyUI ever applies it - and with every cleanup knob at default, it behaves exactly like the stock node, so you can A/B it without changing anything else in the graph.

Why turbo models turn LoRAs ugly

Distilled models (Krea 2 Turbo via TDM, Flux turbo, LCM-style LoRAs) run in 4–12 steps instead of 30–50. Fewer steps means the sampler never gets to average noise out. Two things inside a LoRA file exploit that:

  • Noise tail. Each layer's update is decomposed with an SVD, and the low-energy singular components are mostly training noise - little signal, plenty of high-frequency crunch.
  • Hot layers. A handful of layers carry a much stronger update than the rest and shove activations off the distilled model's narrow manifold, which is where blockiness and fuzzy/aliased edges come from.

This node attacks both before application: it factorizes each LoRA layer's low-rank factors (an exact SVD via a cheap QR reduction on the small factors - seconds per LoRA, not minutes - the same math as kohya's resize_lora dynamic mode), trims the tail, tames the outliers, and hands the cleaned state dict to ComfyUI's own load_lora_for_models. Because it operates on the LoRA file itself, it's architecture-agnostic: SD/SDXL, Flux, Krea 2, whatever.

The inputs that matter

Wire it exactly like the stock loader: model and optional clip in, lora_name to pick the file, strength_model / strength_clip for the usual strength knobs. Outputs are model and clip, straight into your sampler and conditioning pipeline.

The cleanup knobs are what make it different, and only three of them earn your attention at first:

  • keep_energy (default 100 = off) - per layer, keep only the strongest SVD components summing to this % of the update's energy, drop the rest as noise. Try 95, then 90 if artifacts persist.
  • tame_layers (default 0 = off) - compress layers whose update is above the LoRA's 90th percentile back toward the pack. 0.5 is the go-to for crunchy edges.
  • gate_strength (default 1 = off) - scales the LoRA's effect on gate layers only (below). 0.5 is the first thing to try when stacked LoRAs are fighting.

max_rank hard-caps each layer's rank after the energy cut (useful for VRAM, less for quality). star_rescale (from the STAR paper, arXiv:2502.10339) boosts the kept components after trimming so a layer keeps its total strength - turn it on if cleaning weakens the LoRA too much.

What "gate layers" means

Modern DiTs like Krea 2 use gated attention and SwiGLU MLPs - every block has attn.gate and mlp.gate projections, roughly a quarter of a Krea 2 LoRA's layers. Gates are multiplicative sigmoid controls, so a small LoRA edit there has an outsized, nonlinear effect, and when you stack LoRAs their gate edits compound instead of averaging - a major cause of blocky artifacts and of stacked LoRAs fighting into deformities. Norm-based tame_layers misses them because gate updates are modest in norm; gate_strength targets them by name instead. On a LoRA without gate layers it does nothing, which is expected.

Install

ComfyUI Manager: search for Corza LoRA Loader and install.

Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/CoreyCorza/comfyui-lora-loader

Restart ComfyUI. The nodes appear under corza/lora. No extra dependencies - just PyTorch and ComfyUI's own LoRA code, and no model files to download.

Troubleshooting

  • Cleaning off = stock loader. If keep_energy is 100, max_rank 0, tame_layers 0, star_rescale off, and gate_strength 1, the node skips cleanup entirely and is bit-for-bit the stock behavior. That's the feature - it's how you A/B honestly.
  • Check the console. It logs a short per-LoRA report (rank saved, hottest layers). If it says no cleanable up/down pairs found, the LoRA loaded as-is: exotic formats (DoRA scale, LoCon/Tucker conv-mid matrices, reshape metadata, unknown keys) are passed through untouched by design, not broken.
  • Cleaned LoRA feels weaker - turn on star_rescale to push keep_energy down to 90 without losing the effect.
  • Stacked LoRAs fighting on Krea 2 - reach for gate_strength = 0.5 first. It targets the compounding-gate mechanism the norm-based controls can't see.

The author suggests keep_energy = 95, tame_layers = 0.5 as a starting point for a style LoRA on a turbo model, cleaning each LoRA individually when stacking. If artifacts persist after that, this won't merge two conflicting LoRAs - for TIES/DARE-style cross-LoRA conflict resolution you're in the territory of a tool like ethanfel/ComfyUI-LoRA-Optimizer instead.

Categorycorza/lora

Inputs (10)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
strength_modelFLOAT1.00-100–100
strength_clipFLOAT1.00-100–100
keep_energyFLOAT100.050–100Per layer, keep only the strongest SVD components adding up to this % of the update's energy; the rest is mostly training noise. 100 = off. Try 95, then 90 if artifacts persist.
max_rankINT00–1024Hard cap on each layer's rank after the energy cut. 0 = off.
tame_layersFLOAT0.000–1Compress layers whose update is much stronger than the rest (above the LoRA's 90th percentile) back toward the pack. 0 = off, 1 = fully clamped. Try 0.5 for crunchy edges.
star_rescaleBOOLEANfalseSTAR (arXiv:2502.10339): after keep_energy trims a layer, boost the kept components so the layer's total strength matches the original — trims the conflict-prone tail without weakening the LoRA. Only does something when keep_energy < 100.
gate_strengthFLOAT1.000–1How much of the LoRA's effect reaches 'gate' layers only (Krea 2's gated attention + SwiGLU gates, etc.). Gates are multiplicative sigmoid controls, so LoRA edits there have outsized, compounding effect — a big source of artifacts and of stacked LoRAs fighting, which the norm-based tame_layers misses. 1 = full effect (default), 0 = strip the LoRA from gates (they stay at base). Try 0.5 if stacked LoRAs deform. No effect on LoRAs without gate layers.
clipoptCLIP

Outputs (2)

NameTypeDescription
modelMODEL
clipCLIP