Extensions/ComfyUI LoRA Trigger Helper
ComfyUI Extension

ComfyUI LoRA Trigger Helper

Local metadata backend for ComfyUI Prompt Workbench: offline safetensors trigger scanning, editable character/outfit groups and output organization. Optional explicit online scans query Civitai using SHA-256 hashes. No models or personal database bundled; no standalone panel.

By yonghaozheng64-commits·Created 13 days ago·Updated a day ago· 3
yonghaozheng64-commits/comfyui-lora-trigger-helper
Nodes
On cloudLocal install
Stars3
Updateda day ago
Readme

ComfyUI LoRA Trigger Helper

Local metadata and character-archive backend for ComfyUI Prompt Workbench.

本插件为提示词工作台提供 LoRA 扫描、触发词分组、人物身份标记和未来输出路径分类。旧悬浮面板已合并到工作台;本插件不单独显示界面。

Installation / 安装

Install both repositories using ComfyUI-Manager's Install via Git URL when permitted, then restart ComfyUI and refresh your browser:

https://github.com/yonghaozheng64-commits/comfyui-lora-trigger-helper
https://github.com/yonghaozheng64-commits/comfyui-prompt-workbench

For manual installation, clone this repository into ComfyUI/custom_nodes/. Requires Python 3.10+ and ComfyUI (including aiohttp). No extra packages are required. Directory names may differ; imports are package-relative.

Manager catalog submission: PR #3266, submitted together with Prompt Workbench. Search installation becomes available only after upstream review and catalog refresh. 两个插件已一起申请收录;审核期间请通过 Git URL 安装。

手动安装请克隆到 ComfyUI/custom_nodes/,并使用运行 ComfyUI 的 Python 安装 requirements.txt。安装两个插件后,在工作台点击“刷新 LoRA”进行本地扫描。发布包不含个人模型数据库;首次使用为空库是正常现象。

Usage / 使用

  • 数据库:data/lora_triggers.json
  • 手工数据可在面板中新增或编辑,且不会被联网扫描覆盖。
  • 离线扫描:python sync_civitai.py --offline
  • Civitai 扫描:python sync_civitai.py

联网扫描通过本地文件 SHA-256 调用 Civitai 的公开 hash API,只发送哈希,不上传模型。

Offline scans read local safetensors metadata and do not contact Civitai. Explicit online scans query civitai.com, then civitai.red as fallback using SHA-256 hashes. File contents are not uploaded. Online scans retrieve available trained words; they do not guarantee full outfit groups, translations, IP/studio or artist descriptions. Add those through the workbench group editor.

Data and behavior / 数据与行为

  • data/lora_triggers.json is created locally and excluded from Git. Back it up separately before reinstalling or moving this plugin.
  • Groups accept id, name, note, words, archiveCharacter and sourceLabel. Character markers enable workbench character cards and output classification.
  • Future-output classification returns a modified prompt with character filename prefixes when enabled in the workbench; it does not move existing files.
  • New prefixes use CharacterArchive/<character>/, _UnknownCharacter for unknown characters, and Multiple_ for multi-character folders. Unknown video output still uses Video/. Character names provided by the user are preserved in their original language. Existing 人物归档/ prefixes are left unchanged for compatibility; no existing folders or files are renamed or moved.
  • 新目录默认采用英文名称;用户自定义的人物名称保持原文,旧的 人物归档/ 工作流路径继续保留,不迁移已有文件。
  • Model deletion and existing-output organization have been removed, including all HTTP aliases and the underlying trash/move implementations. Use your operating system's file manager to delete models or move existing outputs, then refresh the library. Send2Trash is no longer required.
  • 删除模型和移动已有输出的网页功能已移除;请使用操作系统文件管理器处理,再刷新 LoRA。未来生成任务的人物目录分类仍保留。
  • Restart ComfyUI after updating to unload the old routes. Updating files without restarting does not remove handlers already registered in a running process.
  • Keep the ComfyUI server limited to trusted users: the remaining routes can edit metadata and scan models. This plugin is not an authentication layer for ComfyUI.
  • Private curation scripts, model files, generated images and personal metadata are not part of this repository.

Development

python -m unittest discover -s tests

Tests use temporary files and stub ComfyUI services; they do not scan your library, call Civitai or move existing outputs.