Nodes/ComfyUI_Mira/LoRA Loader from Text
ComfyUI Node

LoRA Loader from Text

Parse <lora:...> tags from a prompt

By mirabarukaso·Created 2 years ago·Updated 5 days ago· 206
LoRA Loader from Text
  • model
  • clip
  • model
  • clip
  • model_to_hifix
  • clip_to_hifix
  • plain_text
text

If you've ever copied a prompt off Civitai and hit a wall in ComfyUI, this node is the fix. Civitai and the A1111/Forge world write LoRAs inline, right in the prompt text, like <lora:mylora:0.8>. ComfyUI doesn't do that natively - you're supposed to add a separate LoRA loader node per LoRA and set strengths by hand. LoRA Loader from Text reads those <lora:...> tags straight out of your prompt string, applies them to your model and CLIP, and spits the clean prompt (tags stripped) back out for encoding. Paste a webui prompt, wire it up, done.

It's part of ComfyUI_Mira, mirabarukaso's utility pack, and it's a genuinely nice bit of glue - LoRAs are how the community layers styles, characters, and concepts onto a base checkpoint, and being able to keep them written in the familiar inline syntax saves a real amount of node-wiring for anyone who lives in that ecosystem.

How it works

It scans text for tags and supports the full webui format, from bare to fully specified:

<lora:name>
<lora:name:model_str>
<lora:name:model_str:clip_str>
<lora:name:model_str:clip_str:hires_model_str:hires_clip_str>

Each tag gets applied to the incoming model and clip. The clever part is the two-stage support: those last two numbers are separate strengths for a hires/second-pass model and clip, so the same prompt can carry different LoRA weights for the base pass and the upscale pass. Set both first-stage numbers to 0 to bypass a LoRA in the first pass, both second-stage numbers to 0 to skip it in the second.

The inputs and outputs that matter

  • model / clip - your base MODEL and CLIP.
  • text - the prompt, LoRA tags and all.
  • model / clip (outputs) - the first-pass model and CLIP with LoRAs applied.
  • model_to_hifix / clip_to_hifix (outputs) - the second-pass (hires) versions, for your upscale sampler.
  • plain_text (output) - the prompt with all <lora:...> tags removed, wired into your CLIP Text Encode.

Installing it

ComfyUI Manager: search ComfyUI_Mira, install, restart. Or clone:

cd ComfyUI/custom_nodes && git clone https://github.com/mirabarukaso/ComfyUI_Mira.git

then restart. If it errors on load, run pip install -r requirements.txt in the ComfyUI_Mira folder. It's under Mira/Lora.

Common issues

  • The filename in the tag has to match your file. <lora:name> must resolve to an actual file in your models/loras folder. Civitai prompts often reference a LoRA you haven't downloaded, or under a different filename - mismatches are the number-one reason a LoRA silently doesn't apply. Escaped brackets in odd filenames (like il\[IL]...) need to match exactly.
  • Encode the plain_text, not the raw prompt. Wire plain_text into your CLIP Text Encode, not the original string - otherwise the literal <lora:...> text gets encoded as words and pollutes your conditioning.
  • Use the right stage outputs. If you're doing hires fix, feed model_to_hifix/clip_to_hifix into the second sampler. Send both to the same sampler and the two-stage strengths do nothing useful.
  • Base-model match. A LoRA trained on SDXL won't apply to an SD1.5 model (or Flux, etc.). The node will try; the result will be garbage or an error. Keep LoRA and checkpoint families aligned.
CategoryMira/Lora

Inputs (3)

NameTypeDefaultDescription
modelMODEL
clipCLIP
textSTRING

Outputs (5)

NameTypeDescription
modelMODEL
clipCLIP
model_to_hifixMODEL
clip_to_hifixCLIP
plain_textSTRING