Extensions/Orion4D_ModelOnlyLoRA
ComfyUI Extension

Orion4D_ModelOnlyLoRA

A lightweight ComfyUI custom-node package for managing Model-Only LoRA stacks and combining LoRA trigger text with prompts.

By orion4d·Created about a month ago·Updated 30 days ago· 5
orion4d/Orion4D_ModelOnlyLoRA
Nodes2
On cloudLocal install
CategoryOrion4D_Utils/LoRA, Orion4D_Utils/Text
Stars5
Updated30 days ago
Readme

Orion4D Model Only LoRA Tools

<img width="1495" height="631" alt="image" src="https://github.com/user-attachments/assets/678d1f1c-4e0a-4cd3-bf80-2c314809a2c5" /> <img width="953" height="708" alt="image" src="https://github.com/user-attachments/assets/9ff612db-a014-4dac-a3c1-93923d1f740d" />

A lightweight ComfyUI custom-node package for managing Model-Only LoRA stacks and combining LoRA trigger text with prompts.

Designed for workflows using architectures where LoRA weights are applied to the diffusion model only, such as:

  • Krea 2
  • FLUX / FLUX Klein
  • Z-Image
  • Other compatible model-only LoRA workflows

The package is compatible with ComfyUI Nodes 2.0 and includes a custom browser interface for LoRA selection, preview display, trigger extraction, and per-LoRA strength control.


Included Nodes

1. Model Only LoRA Stack

Applies one or more LoRA files sequentially to the MODEL input without modifying the text encoder.

Features

  • Dynamic LoRA stack
  • Add LoRA rows with the + Add LoRA button
  • Remove individual LoRAs with the button
  • Enable or disable each LoRA independently
  • Model-only LoRA application
  • Per-LoRA strength slider
  • Manual numeric strength input
  • Strength range from -1.00 to 2.00
  • Strength slider and numeric field remain synchronized
  • Searchable LoRA browser
  • External preview panel outside the node
  • Companion image preview detection
  • Companion trigger text detection with metadata fallback
  • Automatic trigger aggregation with editable per-LoRA overrides
  • Duplicate trigger removal
  • Trigger output as a standard STRING
  • Global stack enable/bypass control
  • Reorder LoRA rows with up/down controls
  • Editable trigger field for each LoRA
  • Copy trigger text button
  • Reset manual trigger text to the automatically detected value
  • Trigger source indicators: TXT, Metadata, Manual, or None
  • Negative LoRA strengths supported
  • Multi-file LoRA cache
  • Folder browser with regex search scope controls

Inputs

| Input | Type | Description | |---|---|---| | model | MODEL | Base diffusion model to patch with the selected LoRAs |

Outputs

| Output | Type | Description | |---|---|---| | model | MODEL | Model with all enabled LoRAs applied sequentially | | triggers | STRING | Combined trigger text from all enabled LoRAs |


2. Trigger + Prompt Concat

Combines LoRA trigger text with a normal prompt using a configurable delimiter.

Features

  • Two optional text inputs
  • Editable local text fields when no input is connected
  • Automatic field locking when an input connection is present
  • Custom delimiter field
  • Clean fallback when one text source is empty
  • Single combined STRING output

Inputs

| Input | Type | Description | |---|---|---| | trigger_text | STRING | LoRA trigger text, usually connected from Model Only LoRA Stack | | prompt_text | STRING | Main positive prompt |

Local Fields

| Field | Description | |---|---| | Trigger TXT | Editable only when trigger_text is not connected | | Prompt TXT | Editable only when prompt_text is not connected | | Delimiter | Text inserted between trigger text and prompt text |

Output

| Output | Type | Description | |---|---|---| | text | STRING | Concatenated trigger text and prompt text |

Concatenation Logic

trigger_text + delimiter + prompt_text

If only one text source is available, the node returns that text unchanged.

Example:

Trigger TXT:
lomographic photography, analog film grain

Delimiter:
, 

Prompt TXT:
a cinematic portrait of a woman standing in a neon street

Output:
lomographic photography, analog film grain, a cinematic portrait of a woman standing in a neon street

Companion Preview and Trigger Files

The LoRA browser automatically looks for preview images and trigger text files stored next to the LoRA file.

The companion file must use the same basename as the LoRA.

Example:

ComfyUI/
└── models/
    └── loras/
        └── Krea2/
            ├── Lomographic_epoch_10.safetensors
            ├── Lomographic_epoch_10.png
            └── Lomographic_epoch_10.txt

Supported Preview Formats

.png
.jpg
.jpeg
.webp

Supported Trigger Format

.txt

The file matching is:

  • Case-insensitive
  • Regex-safe
  • Based on the exact LoRA filename stem
  • Limited to files located in the same directory as the LoRA

Trigger File Format

The trigger text file may contain:

One trigger per line

lomographic photography
analog film grain
vintage color rendering

Comma-separated triggers

lomographic photography, analog film grain, vintage color rendering

Mixed format

lomographic photography, analog film grain
vintage color rendering
soft halation

The node automatically:

  • Ignores empty lines
  • Ignores lines beginning with #
  • Splits comma-separated values
  • Normalizes repeated spaces
  • Removes duplicate triggers
  • Preserves trigger order

Example output:

lomographic photography, analog film grain, vintage color rendering, soft halation

Installation

Manual Installation

  1. Download or clone this repository.
  2. Copy the folder into:
ComfyUI/custom_nodes/Orion4D_ModelOnlyLoRA
  1. Restart ComfyUI.
  2. Refresh the browser interface if required.

Expected Folder Structure

Orion4D_ModelOnlyLoRA/
├── __init__.py
├── model_only_lora_stack.py
├── trigger_prompt_concat.py
├── README.md
└── web/
    ├── model_only_lora_stack.js
    └── trigger_prompt_concat.js

Node Locations

The nodes are available in the ComfyUI node menu under:

Orion4D_Utils
├── LoRA
│   └── Model Only LoRA Stack
└── Text
    └── Trigger + Prompt Concat

Recommended Workflow

Load Diffusion Model
        │
        ▼
Model Only LoRA Stack
        │
        ├──────────────► Patched MODEL
        │
        └──────────────► Trigger STRING
                              │
                              ▼
                    Trigger + Prompt Concat
                              │
                              ▼
                       Text Encode / Conditioning

Example connection layout:

[Load Diffusion Model]
          │
          ▼
[Model Only LoRA Stack]
          │ model
          ├──────────────────────────────► [Sampler / Guider]
          │
          └─ triggers ───────┐
                             ▼
                  [Trigger + Prompt Concat]
                             ▲
                             │
                      [Prompt STRING]
                             │
                             ▼
                     [Text Encode Node]

Model-Only Behavior

This package applies LoRA weights using the diffusion model path only.

The text encoder is not passed through the LoRA loader and is not modified.

Conceptually:

MODEL + LoRA weights → patched MODEL

Not:

MODEL + CLIP + LoRA weights

This is useful for LoRA files that contain only diffusion-model or DiT weights.

If a LoRA was explicitly trained with text-encoder weights, those text-encoder weights will not be applied by this node.


LoRA Strength

Each LoRA row includes:

  • A slider from -1.00 to 2.00
  • A synchronized numeric field
  • A step of 0.01

Typical values:

-1.00 Negative influence / style suppression
0.00  Disabled effect
0.50  Light influence
0.80  Moderate influence
1.00  Full nominal strength
1.20  Strong influence
1.50  Very strong influence
2.00  Maximum UI range

A strength of 0.00 keeps the LoRA row in the stack but does not apply its model weights. Negative strengths can be used experimentally to push away from learned LoRA characteristics.


LoRA Browser

Clicking a LoRA name opens a dedicated browser window with:

  • Search field
  • Folder-style navigation through LoRA subdirectories
  • Breadcrumb navigation
  • Search scope selection:
    • Open folder
    • All folders
  • Optional regular-expression search
  • Up to 500 displayed results
  • Preview image panel
  • Trigger text panel
  • Trigger source indicator
  • Current LoRA highlighting

The preview is displayed in the browser window only and does not occupy space inside the node.

The refresh button reloads the LoRA catalogue after files have been added, removed, or modified.

Trigger Sources

Trigger text is resolved in the following order:

  1. Same-name companion .txt file
  2. Explicit trigger metadata stored in the .safetensors header
  3. Kohya ss_tag_frequency metadata
  4. Manual text entered directly in the node

The trigger field remains editable after selecting a LoRA. Manual edits are stored in the workflow without modifying the original LoRA or companion TXT file.

The reset button restores the automatically detected trigger text.


Notes

  • LoRAs are applied sequentially in the same order as they appear in the node.
  • Disabled LoRAs are ignored.
  • Empty LoRA rows are ignored.
  • Missing enabled LoRA files produce an error instead of silently failing.
  • Trigger text is collected from enabled LoRAs.
  • Trigger duplicates are removed case-insensitively.
  • Preview images are optional.
  • Trigger text files are optional.
  • Safetensors metadata is used as a fallback when no companion TXT file is available.
  • Manual trigger edits are stored in the workflow.
  • The global stack bypass preserves the configured rows while returning the unmodified input model and an empty trigger string.
  • No external Python dependencies are required beyond ComfyUI's standard environment.

Release Notes

v1.3.0

  • Added negative LoRA strengths from -1.00 to 2.00
  • Added automatic trigger extraction from safetensors metadata when no companion TXT file is available
  • Added editable per-LoRA trigger fields with workflow-persistent manual overrides
  • Added reset-to-auto and copy-trigger controls
  • Added trigger source indicators: TXT, Metadata, Manual, and None
  • Added multi-file LoRA caching
  • Added global stack enable/bypass control
  • Added row reordering with up/down controls
  • Added double-click strength reset to 1.00
  • Added finite-value strength validation in the Python backend
  • Added folder-style navigation in the LoRA browser
  • Added regex search with Open folder and All folders scopes
  • Increased the displayed browser result limit to 500
  • Improved ComfyUI Nodes 2.0 compatibility
  • Fixed LoRA row creation and stack bypass behavior in Nodes 2.0
  • Improved dynamic node sizing in the legacy interface
  • Fixed picker keyboard-listener cleanup

v1.2.1

  • Fixed duplicated LoRA rows when reopening or restoring a workflow
  • Fixed a workflow-load display issue caused by overlapping asynchronous UI renders

v1.0.0

  • Initial public release
  • Added Model Only LoRA Stack
  • Added Trigger + Prompt Concat
  • Added companion preview and trigger TXT support

Compatibility

Tested with:

  • ComfyUI
  • ComfyUI Nodes 2.0 interface
  • Legacy ComfyUI node interface
  • Krea 2 workflows

The nodes should also work with other architectures supported by ComfyUI's model-only LoRA loading system.


Troubleshooting

The node does not appear

Check that the folder is installed directly under:

ComfyUI/custom_nodes/Orion4D_ModelOnlyLoRA

Then restart ComfyUI completely.

The preview does not appear

Verify that:

  • The image is in the same folder as the LoRA
  • The image uses the exact same basename
  • The extension is supported

Correct:

MyStyle.safetensors
MyStyle.png

Incorrect:

MyStyle.safetensors
MyStyle_preview.png

The trigger text does not appear

Verify that the .txt file:

  • Is in the same folder as the LoRA
  • Uses the exact same basename
  • Contains valid UTF-8 text

Correct:

MyStyle.safetensors
MyStyle.txt

The editable text field is disabled

This is expected when a text input is connected.

The connected input has priority over the local field.

Disconnect the input to edit the local text again.

The detected metadata trigger is too long or inaccurate

Metadata-derived tags are automatic candidates and may include dataset-specific or generic tags.

Edit the trigger field directly in the LoRA row to keep only the desired trigger words. The manual value is saved with the workflow.

Use the reset button to restore the automatically detected value.

The LoRA is listed but fails during execution

Confirm that the LoRA is compatible with the currently loaded model architecture.

A LoRA trained for another model family may appear in the list but cannot necessarily be applied successfully.


<div align="center"> <h3>🌟 <strong>Show Your Support</strong></h3> <p>If this project helped you, please consider giving it a ⭐ on GitHub!</p> <p><strong>Made with ❤️ for the ComfyUI community</strong></p> <p><strong>by Orion4D</strong></p> <a href="https://ko-fi.com/orion4d"> <img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Buy Me A Coffee" height="41" width="174"> </a> </div>