Nodes/CMK Flow/CMK LoRA Text Loader
ComfyUI Node

CMK LoRA Text Loader

Apply LoRAs from a text field, no manager required

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK LoRA Text Loader
  • model
  • clip
  • opt_lora_stack
  • model
  • clip
  • trigger_words
  • loaded_loras
◄opt_lora_syntax►

A LoRA loader that takes a MODEL and a CLIP, reads <lora:name:strength> syntax and/or a LORA_STACK, applies what it finds, and gives the patched model and clip back. If there's nothing to apply, it's a pure throughpass. That's the whole node - and the file resolution underneath it is where the thought went.

Inputs and outputs

Required: model (MODEL), clip (CLIP).

Optional: opt_lora_syntax - STRING, forced input, tooltip: "Optional. Format: <lora:name:strength> or <lora:name:model_strength:clip_strength>." And opt_lora_stack (LORA_STACK, forced input).

Out: model, clip, trigger_words, loaded_loras.

Three behaviours that will surprise you

Stack entries win, and duplicates get dropped. The stack is parsed first, then the syntax text, then exact duplicates are removed. Duplicate means same resolved real path and same model and clip strengths - so <lora:foo:0.8> twice collapses to one application, but <lora:foo:0.8> and <lora:foo:1.0> both run, in that order. Deliberately different strengths are a legitimate thing to want and the node respects it.

Trigger words come back empty. Always. The source says it outright: CMK v1 intentionally doesn't depend on LoRA-manager metadata, so trigger_words is "" unless no metadata path is added later. If you were counting on this output to auto-populate your prompt, it won't. Type the trigger words yourself (or pass them straight to trigger_words on the stack builder side, which does forward them).

Name resolution is much more forgiving than ComfyUI's. Give it folder/name.safetensors, folder/name, or just name from a nested subfolder - it searches the whole loras index and matches on full relative path, stem, or basename. No extension needed; .safetensors, .pt, .pth and .ckpt are tried. Absolute paths work too.

The flip side: if a bare name matches more than one file, you don't get a silent guess. You get a FileNotFoundError listing the matches so you can be specific. That's the correct call, and it's the error beginners will actually see:

LoRA file not found.
Requested:
• myChar_v3
Searched in ComfyUI loras folder, including subfolders.

What it's doing under the hood

Standard ComfyUI plumbing, nothing exotic: comfy.utils.load_torch_file(path, safe_load=True) for each entry, then comfy.sd.load_lora_for_models(model, clip, lora, model_strength, clip_strength). Both inputs are validated first, so a missing model or clip gives you a named error instead of a crash deep in a torch call. The loaded_loras output is normalized back into <lora:name:strength> text - with the three-argument form when model and clip strengths differ - which is the string you actually want for a log, a filename, or a later prompt edit.

That split between model and clip strength is worth using. Backing the clip strength off on a character LoRA usually keeps your prompt working while the likeness stays; it's the most under-used setting in the LoRA toolchain, and here it's one extra number in a text field.

Install

cd ComfyUI
git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py

Manager: search CMK Flow (registry cmk-flow, publisher CMKFlow), install, restart ComfyUI. A manual clone never runs pip, so that second command is part of the install and again after every git pull --ff-only. The pack's dependency list is on the heavy side - insightface, onnxruntime, ultralytics, segment-anything, nudenet==3.4.2, opencv-python, imageio-ffmpeg - none of which this node needs, but you're installing the pack.

Turn on Vue Nodes / Nodes 2.0 too. CMK warns at startup without it and its dynamic widgets lose their proper behaviour, which for this node matters less than for the pipeline modules.

Where it belongs

Two places. First, as the LoRA stage inside a CMK flow, fed by CMK LoRA Stack Builder and forwards. Second, oddly, as a drop-in on a stock ComfyUI graph: it's a normal MODEL/CLIP in, MODEL/CLIP out node, so if you want text-driven LoRA switching without installing a manager or wiring a loader chain, this is a reasonable excuse to install the pack. Architecture lock-in still applies - an SDXL LoRA on a Flux model is a shape error, not a subtle quality difference - so keep the model and the LoRA in the same family.

CategoryCMK/Toolbox/Model & LoRA

Inputs (4)

NameTypeDefaultDescription
modelMODEL—
clipCLIP—
opt_lora_syntaxoptSTRINGOptional. Format: <lora:name:strength> or <lora:name:model_strength:clip_strength>.
opt_lora_stackoptLORA_STACK—

Outputs (4)

NameTypeDescription
modelMODEL—
clipCLIP—
trigger_wordsSTRING—
loaded_lorasSTRING—