Nodes/ComfyUI-RecipeMerge/LoRA Elemental Apply (Recipe)
ComfyUI Node

LoRA Elemental Apply (Recipe)

Per-key LoRA strength — de-poison your LoRAs surgically

By galigali-san·Created 2 months ago·Updated 2 months ago· 1
LoRA Elemental Apply (Recipe)
  • model
  • clip
  • model
  • clip
  • report
lora_name
recipe# LoRAの適用強度(0=そのキーに適用しない。マイナスや1超えもOK) 1.0 # 例: # ff:0.0 質感への影響を切る # attn2:1.2 プロンプト反応だけ強める # OUT*:norm:0.5 OUT側のnormだけ半分 # attn2:__VAL__ sweep_valueでスイープ(XYプロット用)
strength_clip1.00
sweep_value1.000

You know the pain: a style LoRA nails the look but drags in its own textures, or a character LoRA's trigger word works but the face details overcook. Standard LoRA block-weight tools stop at the block level - and most of the time that's the wrong granularity. LoRA Elemental Apply (Recipe) from ComfyUI-RecipeMerge lets you set LoRA strength per UNet key (down to attn2.to_q), which is how you actually fix those two problems.

Think of it as the elemental merge concept turned into a LoRA loader. Instead of one global strength, you write a recipe where each line says "this element, at this strength." The semantics are slightly different from the merge nodes: the number is apply strength, not a mix ratio. 0 = don't apply the LoRA to that key, 1 = apply it normally, and negatives or values above 1 are fair game.

How the recipe behaves

Same grammar as the pack's merge recipes (# comments, comma lists, IN04:attn2:0.9 targeting, __VAL__ for sweeps), but three rules govern the whole thing:

  • A bare-number line is the default strength for every key the rules don't mention. 1.0 is the sane starting point.
  • No default line? Then keys your rules don't touch get 0 - the LoRA is off there. That's the trap that makes people think the LoRA "broke": write only attn2:1.2 and everything else silently goes quiet.
  • Empty recipe = plain LoRA apply at full strength. So the node degrades gracefully to a normal loader when you don't configure it.

A few recipes people actually run:

ff:0.0              # kill a style LoRA's texture contamination
1.0
OUT04,OUT05:0.0     # keep the face region LoRA-free
attn2:1.2
NOT attn2:0.3       # everything except prompt-response, lightly
attn2:__VAL__       # sweep with XY plot -> "efficacy map" of the LoRA

The inputs that matter

model is your base, lora_name is a dropdown of your models/loras. recipe is the strength text, sweep_value replaces __VAL__ (right-click it → Convert to Input, feed from an XY plot to map exactly which element a LoRA affects). Then there's strength_clip - a uniform strength for the text-encoder side. The clip input is optional, and the README's advice is right: for trigger-word character LoRAs, plug clip in so the trigger actually fires; leave it disconnected and the LoRA is UNet-only. Outputs are model, clip (pass both into your sampler/text encode), and report.

The gotcha that confuses everyone

A LoRA can only apply to keys it actually trained. Most normal LoRAs only hold attn1, attn2, and ff (their to_qto_out/net sub-keys) - they often don't have norm or proj keys at all; LoCon-style ones add conv. So if your report shows ★一致キーなし for a rule, that's usually not a typo - it means the LoRA simply doesn't contain that element. Read the report before you go hunting for a formatting bug. Also note this node can only weaken or reshape what the LoRA has: it can't invent an attn1 channel for a LoRA that never learned one.

Install

No dependencies - this pack runs on stock ComfyUI (dependencies = [] in its pyproject). Manager search "ComfyUI-RecipeMerge", or:

cd ComfyUI/custom_nodes
git clone https://github.com/galigali-san/ComfyUI-RecipeMerge

Restart, and it's under advanced/model_merging. The UI is Japanese-labelled for now (the author, galigali, is a Japanese dev). One more thing: this node is apply-time only - it never writes a modified LoRA file. If you want to bake a per-key mix into a permanent LoRA, that's the pack's LoRA Merge (Knobs) node; if you prefer knobs over typing recipes, the sibling LoRA Elemental Matrix (Knobs) is this exact engine with a synth panel that starts everything at 1.0.

Categoryadvanced/model_merging

Inputs (6)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
recipeSTRING# LoRAの適用強度(0=そのキーに適用しない。マイナスや1超えもOK) 1.0 # 例: # ff:0.0 質感への影響を切る # attn2:1.2 プロンプト反応だけ強める # OUT*:norm:0.5 OUT側のnormだけ半分 # attn2:__VAL__ sweep_valueでスイープ(XYプロット用)
strength_clipFLOAT1.00-10–10テキストエンコーダ部分の適用強度(clip未接続なら無視)
sweep_valueFLOAT1.000-10–10レシピ内の __VAL__ をこの値で置換(XYプロット用)
clipoptCLIP

Outputs (3)

NameTypeDescription
modelMODEL
clipCLIP
reportSTRING