ComfyUI Extension: comfyui-lora-hook-trigger
A clean and simple ComfyUI custom node that creates a LoRA Hook and automatically finds and loads trigger TXT files placed in a folder named after the LoRA file.
Custom Nodes (0)
README
ComfyUI LoRA Hook + Trigger Text Node
A clean and minimal ComfyUI custom node that automatically links LoRA hooks with LoRA-specific trigger text files.
This node removes the need to manually manage trigger prompts for each LoRA by detecting and loading .txt files placed next to the LoRA model.
⨠Features
- Creates a LoRA Hook Group using
comfy_extras.nodes_hooks.CreateHookLora - Automatically detects trigger
.txtfiles for each LoRA - Provides a dropdown selector (UI-only) for trigger selection
- Outputs both the LoRA hook group and the selected trigger text
- Safe text loading with encoding fallback:
- UTF-8
- UTF-8-SIG
- CP949
- No external dependencies
- Minimal, stable, and workflow-safe design
š Folder Structure
Example (generic, not user data)
models/
āāā loras/
āāā my_lora.safetensors
āāā my_lora/
āāā trigger1.txt
āāā style.txt
āāā preset_prompt.txt
Rules
- The folder name must match the LoRA filename without extension
- Every
.txtfile inside that folder appears in the trigger selector - If no
.txtfiles are found, the trigger list defaults toNONE
š„ Installation
1) Install via ComfyUI Manager (Recommended)
- Open ComfyUI Manager
- Go to Custom Nodes ā Install via URL
- Paste:
https://github.com/akaugun/comfyui-lora-hook-trigger
- Click Install
- Restart ComfyUI
Hard refresh if UI does not update:
- Windows / Linux:
Ctrl + F5 - macOS:
Cmd + Shift + R
2) Manual Installation
ComfyUI/custom_nodes/comfyui-lora-hook-trigger
comfyui-lora-hook-trigger/
āāā __init__.py
āāā js/
āāā lora_trigger_ui.js
Restart ComfyUI.
š§© Node Overview
Inputs
| Name | Type | Description |
|-----|-----|------------|
| lora_name | Combo | Select LoRA |
| trigger | String | Selected TXT name or NONE |
| strength_model | Float | LoRA model strength |
| strength_clip | Float | LoRA CLIP strength |
| prev_hooks | HOOKS (optional) | Previous hook group to append |
Outputs
| Name | Type | Description | |-----|-----|------------| | hook | HOOKS | LoRA hook group | | trigger_text | String | Contents of selected TXT |
š How It Works
Python (__init__.py)
- Defines the custom node
- Exposes
/lora_trigger_listAPI - Scans trigger TXT files next to LoRA models
- Builds and combines LoRA hooks safely
JavaScript (js/lora_trigger_ui.js)
- Injects a UI-only trigger dropdown
- Keeps workflow serialization stable
- Syncs selected trigger with hidden value widget
ā Requirements
- ComfyUI (latest recommended)
- No external dependencies
š License
See LICENSE.