Nodes/Model Utility Toolkit/LoRA Normalize Alpha
ComfyUI Node

LoRA Normalize Alpha

Bake a LoRA's Alpha Into Its Weights (and Drop the Alpha Tensors)

By silveroxides·Created about a year ago·Updated 4 days ago· 16
LoRA Normalize Alpha
    • output_path
    lora_name
    output_filenamenormalized_lora
    reference_modelNone

    Most LoRAs ship with per-layer alpha equal to the rank, so the loader's alpha / rank scale works out to 1.0 and you never think about it. But a decent chunk of the catalog - especially SDXL-era training, where the old advice was alpha at half rank - stores a different number per layer. That's where this node comes in. LoRA Normalize Alpha reads each layer's alpha, multiplies alpha / rank into the up matrix, and saves a new LoRA with the alpha tensors gone. Same effective strength, but the file no longer depends on a loader doing the scaling for you.

    Why bother? Because any downstream tool that ignores per-layer alpha - a merger, a resizer, a format converter, a script that assumes scale 1.0 - will quietly mis-scale a LoRA that has alpha ≠ rank. That's how you end up with a "merged" LoRA that's twice as strong as it should be and no idea why. Normalize first and the file is self-describing: whatever handles it next sees plain weights. It's a genuinely useful cleanup step before you merge a LoRA into a checkpoint or feed it to the pack's own resizers.

    How it works. A LoRA layer is down @ up, scaled by alpha / rank at load time. The node streams through the file layer by layer (memory-efficient safetensors reader, so no 2GB-in-RAM blowups), computes scale = alpha / rank for each, multiplies the up tensor by it in fp32 when scale != 1.0, and writes out a fresh safetensors with a metadata note that it was normalized. Only the up factors change; down tensors and everything else pass through untouched.

    The inputs that matter - there are exactly two, both from info_schema:

    • lora_name - a dropdown of the LoRAs in your ComfyUI/models/loras folder. Pick the one to clean up.
    • output_filename - the output name without extension (default normalized_lora). It lands as normalized_lora.safetensors back in your loras folder, so the original is never overwritten.

    The single output, output_path, just hands you the path to the new file. It's an output node - wire the path into something, or ignore it entirely and grab the file from your loras folder.

    Where people get burned: this node errors with "Input LoRA contains no alpha tensors" on LoRAs that don't store alpha per layer (common on newer formats) - that's expected, not a bug, there's just nothing to normalize. It also refuses to touch low-bit/quantized factors, and if your LoRA's alpha already equals rank, the numeric result is identical to the input; you're only stripping tensors. Fine as hygiene, pointless otherwise.

    Install is the usual two routes. ComfyUI Manager → search "Model Utility Toolkit", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/silveroxides/ComfyUI-ModelUtils
    

    then restart ComfyUI. The pack's requirements.txt pulls a few extras - unifiedefficientloader, PyAV, mutagen - that Manager handles for you. One real gotcha: the pack uses ComfyUI's newer extension API, so on an outdated ComfyUI the nodes simply won't register. Keep ComfyUI current.

    Worth knowing who wrote it: silveroxides is the same handle that publishes Chroma GGUF quants on Hugging Face, and this pack reads exactly like a quantizer's scratch kit - model surgery tools for people who live in safetensors internals. For a niche utility node, that's about as good a pedigree as you get.

    CategoryModelUtils/LoRA/Utilities

    Inputs (3)

    NameTypeDefaultDescription
    lora_nameCOMBOLoRA whose per-layer alpha scaling will be materialized.
    output_filenameSTRINGnormalized_loraOutput filename without extension, written under ComfyUI's LoRA directory.
    reference_modelCOMBONoneOptional diffusion model used to normalize flattened LoRA layer names to its exact model paths.

    Outputs (1)

    NameTypeDescription
    output_path*