Compare commits

...
1 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 4.6 3957ec7d21 feat: Lora Loader (LoraManager) detection, M-tab Groups drop, P-tab Groups subtab (v0.3.32)
- I/Metadata tabs: detect LoRAs from Lora Loader (LoraManager) nodes in both workflow and API formats (inputs.loras.__value__)
- Fix strength parsing: use parseFloat to handle string values like "0.20" from LoraManager
- placeLoraMgrNode: sync text widget with LoRA syntax (<lora:name:s:c>) after drop
- M tab Groups: add "All N LoRAs" drag/drop item to place Lora Loader (LoraManager) with full group
- P tab: add Groups subtab (row2) showing wfm_prompt_preset_groups from localStorage
- Help (i18n.js), README, DEVLOG updated for v0.3.32

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 22:11:02 +09:00
6 changed files with 191 additions and 21 deletions
+34
View File
@@ -1,5 +1,39 @@
# DEVLOG - ComfyUI-Workflow-Studio
## 2026-06-08: v0.3.32 — Lora Loader (LoraManager) LoRA検出対応・ライブラリ機能拡張
### 変更内容
#### Lora Loader (LoraManager) LoRA検出対応(`web/comfyui/node_sets_menu.js`, `static/js/metadata-tab.js`)
- `_extractLoRAs` / `extractLoRAs` の `add` 関数を `parseFloat` ベースに変更。LoraManager ノードは `strength` / `clipStrength` を文字列 (`"0.20"`) で保存するため `typeof === "number"` では `1.0` にフォールバックしていたバグを修正
- APIフォーマット(`class_type` ベース)の `else` 節に `Lora Loader (LoraManager)` を追加。`inputs.loras.__value__` からLoRAリストを取得(`Array.isArray(inputs.loras)` をフォールバックとして併用)
- Iタブ(ライブラリ)・Metadataタブの両方に同様の修正を適用
#### `placeLoraMgrNode` textウィジェット同期(`web/comfyui/node_sets_menu.js`)
- LoraManagerノード配置時に `loras` ウィジェット(配列)だけでなく `text` ウィジェット(LoRA構文)も明示的に更新するよう修正
- strength = clipStrength の場合 `<lora:name:s>`、異なる場合 `<lora:name:s:c>` の形式で構文を生成
- `l.strength` フォールバックを追加し、GroupsのloraList形式(`strength` キー直接)にも対応
#### Mタブ Groupsの LoRAグループ → LoraManagerドロップ対応(`web/comfyui/node_sets_menu.js`)
- `renderModelGroups` でLoRAタイプのグループリスト末尾に「All N LoRAs → Lora Loader (LoraManager)」アイテムを追加
- ドラッグで `application/x-wfm-lora-multi` データ送出 → キャンバスに Lora Loader (LoraManager) ノードを全LoRAセット済みで配置
- ダブルクリックでも即時配置(`placeLoraMgrNode`)
- モデルファイル名から stem(拡張子・パス除去)に変換して LoraManager 名前形式に合わせる
#### Pタブ Groupsサブタブ追加(`web/comfyui/node_sets_menu.js`)
- `state` に `promptSubTab2` と `promptGroups` を追加
- `loadPromptData` で `localStorage["wfm_prompt_preset_groups"]` からグループを読み込み、存在しないIDをクリーンアップ
- Pタブのrow2に「📁 Groups」サブタブを追加(Wタブ・Nタブと同様の2段構成)
- `renderPromptGroups` 関数を実装:グループ名セクション展開・検索フィルター対応・`createDraggablePromptItem` でドラッグ動作を継承
- Batchで作成したPromptグループが同じlocalStorageを参照するためそのままライブラリから利用可能
#### ヘルプ更新(`static/js/i18n.js`)
- `helpSidepanel11`(EN/JA/ZH):PタブGroups追加・MタブLoRAグループ→LoraManagerドロップを追記
- `helpSidepanel13`(EN/JA/ZH):Lora Loader (LoraManager) ノードタイプ対応を追記
- `helpSidepanel15`(EN/JA/ZH):LoRA検出ノードタイプ一覧・APIフォーマット対応・LoRA構文自動入力を追記
---
## 2026-06-08: v0.3.31 — LoRAペイン Single/Stack タブ分割・GenUI Model LoRA対応強化
### 変更内容
+11 -5
View File
@@ -5,7 +5,7 @@ A comprehensive workflow management and generation UI plugin for [ComfyUI](https
Browse, organize, and execute workflows directly from a dedicated studio interface — without switching between windows or manually editing JSON.
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.3.31-green)
![Version](https://img.shields.io/badge/version-0.3.32-green)
## Screenshots
@@ -172,12 +172,12 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
- **N — Nodes tab** — browse favorite nodes (All / ★ Favorites / Groups / Sets / 📂 Category / 🧩 Package sub-tabs), ★ star shown for favorites in All view
- **Category sub-tab** — dropdown to filter nodes by top-level category
- **Package sub-tab** — dropdown to filter nodes by custom node package name
- **M — Models tab** — browse installed models (All / ★ Favorites / Groups / By Type sub-tabs)
- **P — Prompts tab** — browse prompt presets with All / Favorites / Categories sub-tabs
- **I — Information tab** — drop a ComfyUI-generated PNG/WebP or workflow JSON in the side panel to view its metadata; supports `UnetLoaderGGUF` and `QuadrupleCLIPLoader` node types; preview area fixed at 110px
- **M — Models tab** — browse installed models (All / ★ Favorites / Groups / By Type sub-tabs); LoRA groups show an **All N LoRAs** item — drag to canvas to place a `Lora Loader (LoraManager)` node with all LoRAs pre-loaded
- **P — Prompts tab** — browse prompt presets with All / ★ Favorites / Categories sub-tabs; **Groups sub-tab** (row 2) — view presets by group (shared with the Batch tab's `wfm_prompt_preset_groups`)
- **I — Information tab** — drop a ComfyUI-generated PNG/WebP or workflow JSON in the side panel to view its metadata; detects LoRAs from `LoraLoader`, `LoraLoaderModelOnly`, and `Lora Loader (LoraManager)` nodes (API format supported); supports `UnetLoaderGGUF` and `QuadrupleCLIPLoader` node types; preview area fixed at 110px
- **A — AI TOOL tab** — 3-pane layout (Translation | TOOLS | Settings) always visible; Translation and TOOLS (VLM) powered by Ollama or LM Studio; settings (backend, URL, model) shared with the SPA AI TOOL tab via `localStorage`
- **model sub-tab** — Checkpoint, VAE, Diffusion Model, and Text Encoder; drag items to canvas to place the corresponding loader node (Checkpoint → `CheckpointLoaderSimple`, VAE → `VAELoader`, Diffusion Model → `UNETLoader`, Text Encoder → `CLIPLoader`); double-click also places at canvas center
- **lora sub-tab** — LoRA names with `strength_model / strength_clip` values; drag individual LoRA to place `LoraLoader`; **Multiple LORA** section (appears for 1+ LoRAs) drags all LoRAs into a single `Lora Loader (LoraManager)` node
- **lora sub-tab** — detects LoRAs from `LoraLoader`, `LoraLoaderModelOnly`, and `Lora Loader (LoraManager)` nodes (API format `inputs.loras.__value__` supported); shows `strength_model / strength_clip` values; drag individual LoRA to place `LoraLoader`; **Multiple LORA** section (appears for 1+ LoRAs) drags all LoRAs into a single `Lora Loader (LoraManager)` node with LoRA syntax pre-filled
- **Prompts sub-tab** — POS / NEG badge list; drag a prompt to place `CLIPTextEncode` with text pre-filled; click any entry to view full text + Copy button
- **Drag & drop workflows** — drag a workflow onto the canvas to load it
- **Drag & drop nodes** — drag nodes/node sets onto the canvas to place them
@@ -280,6 +280,12 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
## Changelog
### v0.3.32
- **Lora Loader (LoraManager) LoRA detection** — I tab and Metadata tab now correctly detect LoRAs from `Lora Loader (LoraManager)` nodes in API format (`inputs.loras.__value__`); `strength`/`clipStrength` stored as strings (e.g. `"0.20"`) are now parsed correctly
- **LoraManager node placement — LoRA syntax** — placing a `Lora Loader (LoraManager)` node via drag now also updates the `text` widget with `<lora:name:strength>` syntax (previously only the `loras` array widget was set)
- **M tab Groups — LoRA → LoraManager drop** — LoRA groups in the Library M tab show an **All N LoRAs** item; drag to canvas places a `Lora Loader (LoraManager)` node with all group LoRAs; double-click also places at canvas center
- **P tab — Groups sub-tab** — new Groups sub-tab (row 2) in the Library P tab; groups are read from `localStorage["wfm_prompt_preset_groups"]` (shared with Batch); expanding a group shows draggable preset items
### v0.3.31
- **LoRA pane — Single/Stack tabs** — LoRA pane split into two tabs: Single (filter, model dropdown, M/C strength, target node, Apply, P, LORA SYNTAX, TRIGGER WORDS) and Stack (target node, Apply, P, Toggle-all, global strength adjuster, LORA SYNTAX, TRIGGER WORDS, model list); each tab has independent strength settings
- **GenUI Model — LoRA improvements** — now correctly handles `Lora Loader (LoraManager)` nodes (previously failed to find the node); on apply: switches to Single tab, disables all Stack models, and updates LORA SYNTAX / TRIGGER WORDS in the Single tab panel
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-workflow-studio"
description = "A comprehensive workflow management and generation UI plugin for ComfyUI. Browse, organize, and execute workflows from a dedicated studio interface."
version = "0.3.30"
version = "0.3.32"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+9 -9
View File
@@ -508,11 +508,11 @@ const LANGUAGES = {
helpSidepanel8: "Copy individual positive (P) or negative (N) prompts from sidebar items",
helpSidepanel9: "Double-click items to load/place without dragging",
helpSidepanel10: "Search within each sub-tab to quickly find items",
helpSidepanel11: "Models tab: All / ★ Favorites / Groups / By Type sub-tabs",
helpSidepanel11: "Models tab: All / ★ Favorites / Groups / By Type sub-tabs; Prompts tab: All / ★ Favorites / Categories sub-tabs + Groups sub-tab (row 2); Models Groups — LoRA groups show an \"All N LoRAs\" item to drag all into a single Lora Loader (LoraManager) node",
helpSidepanel12: "⚙ Theme button (header): customize panel background, sub-header background, text, border, and secondary text colors — changes are saved to localStorage and applied on next open",
helpSidepanel13: "I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF and QuadrupleCLIPLoader node types",
helpSidepanel13: "I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata in the side panel — sub-tabs: model / lora / Prompts; supports UnetLoaderGGUF, QuadrupleCLIPLoader, and Lora Loader (LoraManager) node types",
helpSidepanel14: "Information tab — drag items to canvas: model sub-tab places the loader node (Checkpoint → CheckpointLoaderSimple, VAE → VAELoader, Diffusion Model → UNETLoader, Text Encoder → CLIPLoader); double-click also places at canvas center",
helpSidepanel15: "Information tab — LoRA sub-tab: drag individual LoRA to place LoraLoader; \"Multiple LORA\" section at bottom places all LoRAs in a single Lora Loader (LoraManager) node; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy",
helpSidepanel15: "Information tab — LoRA sub-tab: detects LoRAs from LoraLoader, LoraLoaderModelOnly, and Lora Loader (LoraManager) nodes (API format supported); drag individual LoRA to place LoraLoader; \"Multiple LORA\" section places all LoRAs in a single Lora Loader (LoraManager) node with LoRA syntax pre-filled; Prompts sub-tab: drag a prompt to place CLIPTextEncode node with text pre-filled; click prompt to view full text and copy",
helpSidepanel16: "A tab (AI Tools): Translation and VLM sub-tabs powered by Ollama or LM Studio; settings (backend, URL, model) are shared with the SPA AI tab via localStorage",
helpAiTitle: "AI Tab (A)",
helpAi1: "Translation sub-tab: translate text between Japanese, English, Chinese, or a custom Free language using Ollama or LM Studio",
@@ -1179,11 +1179,11 @@ const LANGUAGES = {
helpSidepanel8: "サイドバーアイテムからポジティブ(P)/ネガティブ(N)プロンプトを個別コピー",
helpSidepanel9: "ダブルクリックでもアイテムの読み込み・配置が可能",
helpSidepanel10: "各サブタブ内で検索してアイテムをすばやく検索",
helpSidepanel11: "Modelsタブ:All / ★ Favorites / Groups / By Typeサブタブ",
helpSidepanel11: "Modelsタブ:All / ★ Favorites / Groups / By Type サブタブ;Promptsタブ:All / ★ Favorites / Categories サブタブ+Groupsサブタブ(下段);Models Groupsの LoRA グループには「All N LoRAs」アイテムがあり、ドラッグで全 LoRA を Lora Loader (LoraManager) ノードに一括配置できる",
helpSidepanel12: "⚙ テーマボタン(ヘッダー):パネル背景・サブヘッダー背景・文字色・ボーダー・補助テキスト色をカスタマイズ可能、設定はlocalStorageに保存され次回起動時も反映",
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader ノードタイプに対応",
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader・Lora Loader (LoraManager) ノードタイプに対応",
helpSidepanel14: "Information タブ — キャンバスへドラッグ:model サブタブのアイテムをドラッグすると対応ローダーノードを配置(Checkpoint → CheckpointLoaderSimple、VAE → VAELoader、Diffusion Model → UNETLoader、Text Encoder → CLIPLoader);ダブルクリックでもキャンバス中央に配置可能",
helpSidepanel15: "Information タブ — lora サブタブ:個別 LoRA をドラッグで LoraLoader を配置;下部の「Multiple LORA」セクションをドラッグすると全 LoRA を一括で Lora Loader (LoraManager) に配置;Prompts サブタブ:プロンプトをドラッグするとテキスト入力済みの CLIPTextEncode ノードを配置;クリックで全文表示・コピー可能",
helpSidepanel15: "Information タブ — lora サブタブ:LoraLoader・LoraLoaderModelOnly・Lora Loader (LoraManager) ノード(APIフォーマット含む)から LoRA を検出;個別 LoRA をドラッグで LoraLoader を配置;「Multiple LORA」セクションで全 LoRA を Lora Loader (LoraManager) ノードに一括配置(LoRA構文自動入力);Prompts サブタブ:プロンプトをドラッグするとテキスト入力済みの CLIPTextEncode ノードを配置;クリックで全文表示・コピー可能",
helpSidepanel16: "A タブ(AI ツール):翻訳・VLM サブタブ;設定(バックエンド・URL・モデル)は SPA の AI タブと localStorage で共有される",
helpAiTitle: "AI タブ(A)",
helpAi1: "翻訳サブタブ:Ollama または LM Studio を使って日本語・英語・中国語・カスタム言語(Free)間でテキストを翻訳",
@@ -1846,11 +1846,11 @@ const LANGUAGES = {
helpSidepanel8: "从侧边栏项目中单独复制正面(P)或负面(N)提示词",
helpSidepanel9: "双击项目也可加载/放置",
helpSidepanel10: "在各子标签内搜索快速查找项目",
helpSidepanel11: "Models标签:All / ★ Favorites / Groups / By Type子标签",
helpSidepanel11: "Models标签:All / ★ Favorites / Groups / By Type子标签;Prompts标签:All / ★ Favorites / Categories子标签+Groups子标签(第二行);Models Groups的LoRA组显示「All N LoRAs」条目,可拖拽将全部LoRA放入单个Lora Loader (LoraManager)节点",
helpSidepanel12: "⚙ 主题按钮(标题栏):可自定义面板背景、子标题背景、文字颜色、边框及辅助文字颜色,设置保存至localStorage并在下次打开时生效",
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF 和 QuadrupleCLIPLoader 节点类型",
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF、QuadrupleCLIPLoader 和 Lora Loader (LoraManager) 节点类型",
helpSidepanel14: "Information 标签 — 拖拽到画布:model 子标签拖拽可放置对应加载节点(Checkpoint → CheckpointLoaderSimple、VAE → VAELoader、Diffusion Model → UNETLoader、Text Encoder → CLIPLoader);双击也可放置到画布中央",
helpSidepanel15: "Information 标签 — lora 子标签:拖拽单个 LoRA 放置 LoraLoader;底部「Multiple LORA」区域可将全部 LoRA 一次性放入 Lora Loader (LoraManager) 节点;Prompts 子标签:拖拽提示词放置预填文本的 CLIPTextEncode 节点;点击可查看全文并复制",
helpSidepanel15: "Information 标签 — lora 子标签:可检测 LoraLoader、LoraLoaderModelOnly 及 Lora Loader (LoraManager) 节点(含API格式)的 LoRA;拖拽单个 LoRA 放置 LoraLoader;「Multiple LORA」区域可将全部 LoRA 一次性放入 Lora Loader (LoraManager) 节点并自动填入LoRA语法;Prompts 子标签:拖拽提示词放置预填文本的 CLIPTextEncode 节点;点击可查看全文并复制",
helpSidepanel16: "A 标签(AI 工具):翻译子标签和 VLM 子标签;设置(后端、URL、模型)通过 localStorage 与 SPA 的 AI 标签共享",
helpAiTitle: "AI 标签页(A)",
helpAi1: "翻译子标签:使用 Ollama 或 LM Studio 在日语、英语、中文或自定义语言(Free)之间翻译文本",
+8 -1
View File
@@ -154,7 +154,9 @@ function extractLoRAs(wf) {
function add(name, sm, sc) {
if (!name || typeof name !== "string" || name === "None" || seen.has(name)) return;
seen.add(name);
results.push({ name, strength_model: typeof sm === "number" ? sm : 1.0, strength_clip: typeof sc === "number" ? sc : 1.0 });
const smNum = parseFloat(sm);
const scNum = parseFloat(sc);
results.push({ name, strength_model: isNaN(smNum) ? 1.0 : smNum, strength_clip: isNaN(scNum) ? 1.0 : scNum });
}
if (Array.isArray(wf.nodes)) {
for (const n of collectAllNodes(wf)) {
@@ -170,6 +172,11 @@ function extractLoRAs(wf) {
const ct = n.class_type ?? "";
if (ct === "LoraLoader") add(n.inputs?.lora_name, n.inputs?.strength_model, n.inputs?.strength_clip);
else if (ct === "LoraLoaderModelOnly") add(n.inputs?.lora_name, n.inputs?.strength, 1.0);
else if (ct === "Lora Loader (LoraManager)") {
const lorasData = n.inputs?.loras;
const list = lorasData?.__value__ ?? (Array.isArray(lorasData) ? lorasData : null);
if (list) for (const l of list) { if (l?.active !== false) add(l?.name, l?.strength ?? 1.0, l?.clipStrength ?? l?.strength ?? 1.0); }
}
}
}
return results;
+128 -5
View File
@@ -43,9 +43,11 @@ const state = {
wfLoaded: false,
// Prompts sub-tabs
promptSubTab: "prompt-all", // "prompt-all" | "prompt-favorites" | "prompt-categories"
promptSubTab2: null, // "prompt-groups" | null
promptList: [], // full prompt array from API
promptFavorites: [], // favorite === true
promptCategories: [], // unique category strings
promptGroups: {}, // { groupName: [promptId, ...] } from localStorage
promptLoaded: false,
// Models sub-tabs
modelSubTab: "model-all", // "model-all" | "model-favorites" | "model-groups"
@@ -143,6 +145,15 @@ const loadPromptData = async () => {
if (c) catSet.add(c);
}
state.promptCategories = [...catSet].sort();
try {
state.promptGroups = JSON.parse(localStorage.getItem("wfm_prompt_preset_groups") || "{}");
} catch { state.promptGroups = {}; }
const validIds = new Set(prompts.map(p => p.id));
for (const g of Object.keys(state.promptGroups)) {
state.promptGroups[g] = (state.promptGroups[g] || []).filter(id => validIds.has(id));
}
state.promptLoaded = true;
};
@@ -478,9 +489,21 @@ const placeLoraMgrNode = (loras, pos) => {
node.pos = pos || centerPos;
graph.add(node);
if (node.widgets) {
const loraList = loras.map(l => ({ name: l.name, strength: l.strength_model ?? 1.0, clipStrength: l.strength_clip ?? l.strength_model ?? 1.0, active: true }));
const loraList = loras.map(l => ({ name: l.name, strength: l.strength_model ?? l.strength ?? 1.0, clipStrength: l.strength_clip ?? l.strength_model ?? l.strength ?? 1.0, active: true }));
const w = node.widgets.find(ww => Array.isArray(ww.value) || ww.name === "loras");
if (w) { w.value = loraList; if (w.callback) w.callback(loraList); }
const textW = node.widgets.find(ww => ww.name === "text");
if (textW) {
textW.value = loraList
.filter(l => l.active !== false)
.map(l => {
const s = parseFloat(l.strength) || 1.0;
const c = parseFloat(l.clipStrength) || s;
return s === c ? `<lora:${l.name}:${s}>` : `<lora:${l.name}:${s}:${c}>`;
})
.join(" ");
if (textW.callback) textW.callback(textW.value);
}
}
app.canvas.setDirty(true, true);
showToast(`Placed: Lora Loader (${loras.length} loras)`, "success");
@@ -892,8 +915,11 @@ const rebuildSubTabs = () => {
{ key: "prompt-favorites", label: "\u2605 Favorites" },
{ key: "prompt-categories", label: "\ud83d\udcc1 Categories" },
];
const row2Tabs = [
{ key: "prompt-groups", label: "\ud83d\udcc1 Groups" },
];
const activeKey = state.promptSubTab;
const activeKey = state.promptSubTab2 || state.promptSubTab;
for (const t of row1Tabs) {
const btn = document.createElement("button");
@@ -902,13 +928,26 @@ const rebuildSubTabs = () => {
btn.textContent = t.label;
btn.addEventListener("click", () => {
state.promptSubTab = t.key;
state.promptSubTab2 = null;
updateAllActive();
btn.classList.add("active");
renderContent();
});
row1.appendChild(btn);
}
// No row2 tabs for prompts
for (const t of row2Tabs) {
const btn = document.createElement("button");
btn.className = "wfm-nlp-tab wfm-nlp-sub-tab" + (activeKey === t.key ? " active" : "");
btn.dataset.subtab = t.key;
btn.textContent = t.label;
btn.addEventListener("click", () => {
state.promptSubTab2 = t.key;
updateAllActive();
btn.classList.add("active");
renderContent();
});
row2.appendChild(btn);
}
} else if (state.topTab === "workflows") {
const row1Tabs = [
{ key: "wf-all", label: "All" },
@@ -1040,10 +1079,12 @@ const renderContent = () => {
content.innerHTML = `<div class="wfm-nlp-empty">Loading...</div>`;
return;
}
switch (state.promptSubTab) {
const promptKey = state.promptSubTab2 || state.promptSubTab;
switch (promptKey) {
case "prompt-all": renderPromptAll(content); break;
case "prompt-favorites": renderPromptFavorites(content); break;
case "prompt-categories": renderPromptCategories(content); break;
case "prompt-groups": renderPromptGroups(content); break;
}
} else if (state.topTab === "workflows") {
if (!state.wfLoaded) {
@@ -1529,6 +1570,32 @@ const renderModelGroups = async (container) => {
const item = createModelItem(name, type);
listEl.appendChild(item);
}
if (modelType === "lora" && filtered.length >= 1) {
const sep = document.createElement("div");
sep.className = "wfm-nlp-info-section-title";
sep.style.marginTop = "6px";
listEl.appendChild(sep);
const multiItem = document.createElement("div");
multiItem.className = "wfm-nlp-item wfm-nlp-model-item";
multiItem.draggable = true;
multiItem.title = `Drag to canvas to place Lora Loader (LoraManager) with all ${filtered.length} loras`;
multiItem.innerHTML = `<div class="wfm-nlp-item-row"><div class="wfm-nlp-item-body"><div class="wfm-nlp-item-label">All ${filtered.length} LoRAs</div><div class="wfm-nlp-item-sub">→ Lora Loader (LoraManager)</div></div></div>`;
const buildLoraList = () => filtered.map(n => {
const stem = n.replace(/\\/g, "/").split("/").pop().replace(/\.[^.]+$/, "");
return { name: stem, strength: 1.0, clipStrength: 1.0, active: true };
});
multiItem.addEventListener("dragstart", (e) => {
e.dataTransfer.effectAllowed = "copy";
e.dataTransfer.setData("application/x-wfm-lora-multi", JSON.stringify({ loras: buildLoraList() }));
multiItem.classList.add("dragging");
});
multiItem.addEventListener("dragend", () => multiItem.classList.remove("dragging"));
multiItem.addEventListener("dblclick", (e) => { e.stopPropagation(); placeLoraMgrNode(buildLoraList()); });
listEl.appendChild(multiItem);
}
section.appendChild(listEl);
container.appendChild(section);
}
@@ -1722,6 +1789,55 @@ const renderPromptCategories = (container) => {
}
};
const renderPromptGroups = (container) => {
container.innerHTML = "";
const groupNames = Object.keys(state.promptGroups).sort();
if (groupNames.length === 0) {
container.innerHTML = `<div class="wfm-nlp-empty">
No groups.<br><small>Create groups in Workflow Studio</small>
</div>`;
return;
}
const promptMap = new Map(state.promptList.map(p => [p.id, p]));
let hasAny = false;
for (const groupName of groupNames) {
const ids = state.promptGroups[groupName] || [];
const prompts = ids.map(id => promptMap.get(id)).filter(Boolean);
const filtered = prompts.filter(matchesPromptSearch);
if (state.searchText && filtered.length === 0) continue;
hasAny = true;
const section = document.createElement("div");
section.className = "wfm-nlp-group-section";
const header = document.createElement("div");
header.className = "wfm-nlp-group-header collapsed";
header.innerHTML = `<span>${esc(groupName)}</span> <span class="wfm-nlp-badge">${filtered.length}</span>`;
header.addEventListener("click", () => {
const list = section.querySelector(".wfm-nlp-group-list");
list.style.display = list.style.display === "none" ? "block" : "none";
header.classList.toggle("collapsed");
});
section.appendChild(header);
const list = document.createElement("div");
list.className = "wfm-nlp-group-list";
list.style.display = "none";
for (const p of filtered) {
list.appendChild(createDraggablePromptItem(p));
}
section.appendChild(list);
container.appendChild(section);
}
if (!hasAny) {
container.innerHTML = `<div class="wfm-nlp-empty">No matches.</div>`;
}
};
// ============================================
// Render – Node sub-tabs (existing)
// ============================================
@@ -2217,7 +2333,9 @@ function _extractLoRAs(wf) {
function add(name, sm, sc) {
if (!name || typeof name !== "string" || name === "None" || seen.has(name)) return;
seen.add(name);
results.push({ name, strength_model: typeof sm === "number" ? sm : 1.0, strength_clip: typeof sc === "number" ? sc : 1.0 });
const smNum = parseFloat(sm);
const scNum = parseFloat(sc);
results.push({ name, strength_model: isNaN(smNum) ? 1.0 : smNum, strength_clip: isNaN(scNum) ? 1.0 : scNum });
}
if (Array.isArray(wf.nodes)) {
for (const n of _collectAllNodes(wf)) {
@@ -2233,6 +2351,11 @@ function _extractLoRAs(wf) {
const ct = n.class_type ?? "";
if (ct === "LoraLoader") add(n.inputs?.lora_name, n.inputs?.strength_model, n.inputs?.strength_clip);
else if (ct === "LoraLoaderModelOnly") add(n.inputs?.lora_name, n.inputs?.strength, 1.0);
else if (ct === "Lora Loader (LoraManager)") {
const lorasData = n.inputs?.loras;
const list = lorasData?.__value__ ?? (Array.isArray(lorasData) ? lorasData : null);
if (list) for (const l of list) { if (l?.active !== false) add(l?.name, l?.strength ?? 1.0, l?.clipStrength ?? l?.strength ?? 1.0); }
}
}
}
return results;