Nodes/comfyui-adaptiveprompts/🟰 Normalize Lora Tags 🟰
ComfyUI Node

🟰 Normalize Lora Tags 🟰

Rebalance the combined weight of your lora tags

By AlectricitiΒ·Created 12 months agoΒ·Updated 23 days agoΒ· 87
🟰 Normalize Lora Tags 🟰
    • STRING
    β—„stringβ–Ί
    β—„target_weight1.00β–Ί
    β—„boundsBOTHβ–Ί
    β—„modeNORMALIZEβ–Ί

    Stack enough <lora:x:0.8> <lora:y:0.6> <lora:z:0.9> tags in a single prompt and the combined strength climbs past what the model handles cleanly - the classic oversaturated, crunchy-looking output that comes from too much LoRA weight fighting the base model at once. NormalizeLoraTags rescales the numbers inside those tags automatically, so you're not manually retyping weights by hand every time you add or drop a LoRA from a stack.

    How it works

    It operates purely on the text - scanning <lora:...:weight> tags in a string and rewriting their numeric weight according to whichever mode you pick. NORMALIZE always rescales the selected tags so their combined magnitude lands exactly at target_weight, whether the original sum was over or under. LIMITER is more conservative: if the combined weight is already under target_weight, it does nothing at all; only once you cross the cap does it normalize down to it. SOFT_COMPRESS and HARD_COMPRESS are gentler compressor curves - roughly 1:2 and 1:5 reduction ratios respectively, per the node's own tooltip - meaning the total still creeps up somewhat as you stack more LoRAs rather than snapping hard to a fixed ceiling the way NORMALIZE or LIMITER do.

    bounds decides which tags even participate: POSITIVE only touches tags with weight above zero, NEGATIVE only touches tags below zero, and BOTH works on magnitude across both while preserving each tag's original sign - a negative-weight LoRA doesn't flip positive under normalization, it just gets scaled toward the target the same way a positive one would.

    The inputs and outputs that matter

    • string - the text containing <lora:...> tags to rebalance.
    • target_weight - the desired combined total (default 1).
    • bounds - POSITIVE, NEGATIVE, or BOTH.
    • mode - NORMALIZE, LIMITER, SOFT_COMPRESS, or HARD_COMPRESS.
    • Output: a single STRING - the same text with rebalanced lora tag weights.

    How to install it

    Bundled with the rest of the pack. Search comfyui-adaptiveprompts in ComfyUI Manager, or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Alectriciti/comfyui-adaptiveprompts
    

    Restart ComfyUI. No models to download, no extra dependencies.

    Common issues & troubleshooting

    LoRAs still aren't loading after running this. This node only rewrites the numeric weight inside the tag text - it does not load or apply any LoRA itself. The README pairs it explicitly with either this pack's own LoadLoraTags or with badjeff's separate comfyui_lora_tag_loader for the actual model application. Run NormalizeLoraTags first, then feed its output into whichever of those you're using.

    A negative-weight LoRA behaved unexpectedly under NORMALIZE with bounds set to BOTH. It's scaled by magnitude but keeps its original sign - if you were expecting it to be excluded entirely, set bounds to POSITIVE instead so only the positive-weight tags participate.

    Output weight keeps creeping above your target as you add more LoRAs. That's expected behavior specifically under SOFT_COMPRESS and HARD_COMPRESS, which are deliberately soft caps rather than hard ones. Switch to NORMALIZE or LIMITER if you want the combined total to never exceed target_weight regardless of how many tags you stack.

    Categoryadaptiveprompts/utils

    Inputs (4)

    NameTypeDefaultDescription
    stringSTRINGβ€”
    target_weightFLOAT1.00Desired total weight (renamed from total_weight).
    boundsCOMBOBOTHWhich lora tags participate: POSITIVE only >0, NEGATIVE only <0, BOTH uses magnitudes and preserves sign.
    modeCOMBONORMALIZEMode of operation: NORMALIZE β€” always scale selected tags so their combined magnitude equals target_weight. LIMITER β€” if combined magnitude <= target_weight do nothing; otherwise normalize down to target_weight (hard cap). SOFT_COMPRESS β€” gentle compressor (approx. 1:2 style). If sum > target_weight, reduce values using a soft curve (keeps sum > target but much smaller than original). HARD_COMPRESS β€” stronger compressor (approx. 1:5 style). Uses the same algorithm as SOFT_COMPRESS but with stronger settings.

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”