Nodes/Comfyui-LoraUtils/LoRA Layers Operation
ComfyUI Node

LoRA Layers Operation

Modify specific layers in a LoRA by zeroing them out (when scale=0) or scaling them (otherwise) based on pattern matching.

By lrzjason·Created 10 months ago·Updated 4 months ago· 32
LoRA Layers Operation
  • lora
  • modified_lora
layer_pattern.*transformer_blocks\.(\d+)\.
layer_indices59
scale_factor1.00
CategoryLoraUtils

Inputs (4)

NameTypeDefaultDescription
loraLORAThe LoRA state dictionary to modify.
layer_patternSTRING.*transformer_blocks\.(\d+)\.Regex pattern to match layer names. Use groups to extract layer indices.
layer_indicesSTRING59Comma-separated list of layer indices to operate on, with support for ranges (e.g., '59', '10,11,12', or '50-53').
scale_factorFLOAT1.00-10–10Scale factor to apply. Use 0 to zero out layers.

Outputs (1)

NameTypeDescription
modified_loraLORA