ComfyUI Node

PromptExtraNetworks

Tell ComfyUI which LoRA to load — inside the prompt text

By Taremin·Created 3 years ago·Updated 9 months ago· 6
PromptExtraNetworks
  • model
  • clip
  • model
  • clip
  • replaced string
  • original string
prompt

PromptExtraNetworks is the old A1111 habit smuggled into ComfyUI: instead of dragging a LoraLoader into your graph and hand-wiring it, you write <lora:my-lora.safetensors:0.8> straight into the prompt text and the node does the loading for you. The point isn't laziness, it's automation. If your prompt is generated or randomized per run - wildcards, the {this|that} bracket trick, an LLM writing prompts, a batch job - the LoRA you want can change with the prompt, no graph rewiring and no branch nodes. The README says it plainly: the whole reason this node exists is so random prompts can swap LoRAs without you touching the wires.

It's a different axis from the usual suspects. rgthree's Power Lora Loader is great when you pick the LoRAs and stack five of them with toggles. This node is for when a script, a wildcard file, or a batch picker does the choosing. If you never randomize prompts, you may not need it - that's not a knock, it's just a narrower job.

How it works

Under the hood it's not doing anything exotic. process() runs the prompt through a regex that finds <lora:...> and <hypernet:...> tags, strips them out of the text, then hands the filename and strengths to ComfyUI's own LoraLoader (or HypernetworkLoader) one at a time, chaining the results onto the model and clip. Multiple tags apply in order, so <lora:a:1.0><lora:b:0.5> stacks them left to right. It leans on the built-in loaders rather than reimplementing them, which is why it's stable and why lbw support is an optional bolt-on.

The grammar, from the README:

<lora:lora-filename[:model_strength[:clip_strength]][:cache={always|once|none}]>
<hypernet:hn-filename[:strength]>

Filename includes the extension, same as the file picker in LoraLoader. Default strengths are 1.0; if you set one number it applies to both model and CLIP, set two and they split. The tag vanishes from the prompt so the text encoder sees clean text.

Inputs and outputs

Three inputs, all required: model and clip come from your checkpoint loader and pass straight through, and prompt is a multiline string - wired in with forceInput, so you can feed it from a wildcard or dynamic-prompt node. That's the whole setup. Outputs are the pass-through model and clip that go to your sampler, plus two strings: replaced string (the prompt with tags stripped) and original string (the raw prompt). Wire replaced string into CLIPTextEncode.

Install

No model downloads, no heavy dependencies - the shipped code is stdlib-only Python that calls into ComfyUI's own loaders. Install via ComfyUI Manager (search "ComfyUI Prompt ExtraNetworks") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Taremin/comfyui-prompt-extranetworks

Restart ComfyUI after. One optional extra: install ComfyUI-Inspire-Pack if you want block weight support - with it, <lora:name:0.8:0.8:lbw=SDXL-ALL> (or a raw 1,0,0,... weight list) rides Inspire's LoraLoaderBlockWeight instead of the plain loader. Without it, lbw is silently ignored.

Gotchas worth knowing

  • Cache is a lie most of the time. cache=always / cache=once skip re-reading the LoRA file between runs, but the author's own README warns that on fast storage and with OS file caching you'll see almost no gain, and always is rarely worth it. If you try it, use once.
  • Wrong filename = console error. It prints LoraLoader Error: ... to the terminal and skips that LoRA - check the extension, and don't expect a node popup to tell you.
  • Hypernetworks are legacy and here they're explicitly untested by the author. LoRA replaced them for good reason (see the KB's concepts essay); treat <hypernet:...> as a courtesy for old files, not a feature to build on.
  • Escaping works. \<lora:...> won't be parsed, so you can show a literal tag in the prompt if you ever need to.
  • The pack also ships an experimental ControlNet/T2I-Adapter syntax, but it needs two sibling nodes (PromptControlNetPrepare before CLIPTextEncode, PromptControlNetApply after), so it's a separate workflow from the single-node LoRA path.

If you live on static prompts, this node is a solution to a problem you don't have. If you batch, randomize, or pipe prompts through anything generative, it turns LoRA selection into just another part of the prompt - and that's a genuinely nice way to work.

Categoryloaders

Inputs (3)

NameTypeDefaultDescription
modelMODEL
clipCLIP
promptSTRING

Outputs (4)

NameTypeDescription
modelMODEL
clipCLIP
replaced stringSTRING
original stringSTRING