Nodes/ComfyUI Model Bending/LoRA Bending (list)
ComfyUI Node

LoRA Bending (list)

Hit one component, not the whole file

By abuzreq·Created about a year ago·Updated 3 months ago· 21
LoRA Bending (list)
  • model
  • clip
  • bending_module
  • MODEL
  • CLIP
  • all_component_keys
lora_name
component_index0
component_key

A LoRA is a bundle of patches - usually one matrix pair per layer it touches, sometimes dozens of them. The plain LoRA Bending node bends all of them at once; LoRA Bending (list) lets you bend one component and leave the rest alone. That's the difference between "make this LoRA louder" and "rotate the matrices for the attention layers only, leave the rest as trained."

If you're coming from the main LoRA Bending node, this is the fine-grained version. Same idea, but you pick the target by index or by weight key, and the node hands you a reference list of every component key so you can figure out which one does what.

Inputs and outputs

Required:

  • model (MODEL), clip (CLIP) - same as Load LoRA.
  • lora_name - dropdown of your models/loras.
  • component_index (STRING, default "0") - a comma-separated list of indices, e.g. "0, 2, 5". Indices refer to the LoRA's components sorted by key name.
  • bending_module (BENDING_MODULE) - the module to apply to the chosen component's weights.

Optional:

  • component_key (STRING, default "") - instead of indices, name the exact weight key(s) to bend, comma-separated. If this is non-empty it takes priority over component_index.

Outputs:

  • MODEL and CLIP - the patched model, same as Load LoRA.
  • all_component_keys (STRING) - a numbered reference list of every component key, exactly as 0: <key> per line. Wire this into a text display node; it's your map.

How it works

The node loads the LoRA exactly like the main LoRA Bending node, but instead of bending every loaded value it builds a sorted list of keys, resolves your indices against it, and only pushes the selected component's weight tensor through the bending module before patching. Out-of-range indices are skipped with a warning rather than crashing, and a component_key that isn't in the LoRA gets logged and ignored. Nothing you don't select changes, so the rest of the LoRA applies exactly as trained.

The workflow you'll actually want

The real power is the loop: connect all_component_keys to a Show Text node, run once to see the numbering, then try index 0, then 1, then 2, each with a Rotate Module (Bending) or Multiply Scalar Module (Bending), and compare. LoRA components correspond to real parts of the network - typically a mix of UNet and CLIP key groups - so you'll quickly find that bending the down matrix of a given layer does something entirely different from bending the up matrix. That's the tinkering groove this pack is built for.

Installing

Ships in the ComfyUI-Model-Bending pack:

cd ComfyUI/custom_nodes
git clone https://github.com/abuzreq/ComfyUI-Model-Bending

Restart ComfyUI and refresh. Or search ComfyUI-Model-Bending in ComfyUI Manager. Light dependencies (kornia, scikit-learn), no model downloads. Clone folder should stay ComfyUI-Model-Bending despite the README's stale ComfyUI-Web-Bend-Demo snippet.

One thing to keep straight: the component_index string refers to the component list after the LoRA is converted and loaded against your model's key map, not the raw keys in the file. If all_component_keys lists 34 components and you type 35, nothing gets bent and it tells you so. Trust the output, not the file.

Categorymodel_bending

Inputs (6)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lora_nameCOMBO0 options:
component_indexSTRING0
bending_moduleBENDING_MODULE
component_keyoptSTRING

Outputs (3)

NameTypeDescription
MODELMODEL
CLIPCLIP
all_component_keysSTRING