ComfyUI Node

Loras

Stack LoRAs onto an AnyText model (and reset them without polluting it)

By zmwv823·Created 2 years ago·Updated about a year ago· 103
Loras
  • model
  • model
  • path
lora_name
weight1.00
switchfalse
lora_name1
weight11.00
switch1false
lora_name2
weight21.00
switch2false
lora_name3
weight31.00
switch3false
lora_name4
weight41.00
switch4false

If you want to bend AnyText's style with a LoRA or two - say a particular art look on top of the SD 1.5 base while AnyText handles the text - U_LoRAS is how you stack them. It takes an AnyText_Model, lets you apply up to five LoRAs each with its own weight, and hands the patched model back.

The thing that makes this node different from a normal LoRA loader is the switch design, and the author is emphatic about why it exists. Read the warning on the node before you wire it in.

How it works

Normal ComfyUI LoRA loaders are functional - they take a model, return a new patched model, and if you bypass the node the original is untouched. AnyText's model object isn't handled the same way, and applying a LoRA mutates its state_dict in place. So U_LoRAS gives each LoRA slot a switch boolean instead of relying on bypass. Turn a switch off to reset that LoRA and restore the model's weights. If you instead bypass or mute the node after a LoRA's been applied, the model stays polluted - the change already happened, and muting the node just hides the control that would undo it. The node's own description spells this out: "Don't bypass or mute if lora not needed after lora applied, turn off the switch to reset model state_dict, or the model will be polluted."

The inputs and outputs that matter

  • model (AnyText_Model) - in and out. The output model is the patched one; feed it to the encoder/sampler.
  • lora_namelora_name4 - five LoRA slots. On this ComfyICU listing the dropdowns read empty because the crawl instance had no LoRAs installed; on your machine they list whatever's in ComfyUI/models/loras.
  • weightweight4 (default 1, range −10 to 10) - per-LoRA strength. Negative values invert the effect, which is occasionally useful and usually not.
  • switchswitch4 (default off) - the important control. On applies the LoRA; off resets it. This is your undo, not the bypass button.

Second output is path (STRING), the resolved LoRA path, handy for logging or feeding a saver.

How to install it

Comes with the pack. ComfyUI Manager, search ComfyUI_Anytext, or:

cd ComfyUI/custom_nodes
git clone https://github.com/zmwv823/ComfyUI_Anytext

then restart. Drop your LoRA files in ComfyUI/models/loras as usual and they'll show up in the dropdowns.

Common issues & troubleshooting

Your model got "stuck" looking wrong. You almost certainly bypassed or muted the node after applying a LoRA, exactly the thing the warning covers. The fix isn't to mute harder - it's to keep the node in the graph and turn the switch off so it resets the state_dict, then re-run.

The LoRA does nothing. Two common causes: the switch is off (it defaults off, so you have to turn it on to apply), or the LoRA relies on a trigger word AnyText's text pipeline doesn't feed through cleanly. Style/aesthetic LoRAs behave better here than trigger-word-dependent character LoRAs.

Which LoRAs make sense? These attach to the SD 1.5 side of AnyText, so SD 1.5 LoRAs are what fit - see the KB's LoRA notes for how weights and stacking behave. Don't expect an SDXL or Flux LoRA to load; wrong base entirely.

CategoryUL Group/Image Generation

Inputs (16)

NameTypeDefaultDescription
modelAnyText_Model
lora_nameCOMBO0 options:
weightFLOAT1.00-10–10
switchBOOLEANfalse
lora_name1COMBO0 options:
weight1FLOAT1.00-10–10
switch1BOOLEANfalse
lora_name2COMBO0 options:
weight2FLOAT1.00-10–10
switch2BOOLEANfalse
lora_name3COMBO0 options:
weight3FLOAT1.00-10–10
switch3BOOLEANfalse
lora_name4COMBO0 options:
weight4FLOAT1.00-10–10
switch4BOOLEANfalse

Outputs (2)

NameTypeDescription
modelAnyText_Model
pathSTRING