Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8b4a65881 |
@@ -1,5 +1,84 @@
|
||||
# DEVLOG - ComfyUI-Workflow-Studio
|
||||
|
||||
## 2026-05-17: v0.3.10 Information タブ キャンバスドラッグ対応 / ノードタイプ拡張 / バグ修正
|
||||
|
||||
### 概要
|
||||
|
||||
- サイドパネル I タブ(model / lora / Prompts)からキャンバスへのドラッグ&ドロップでノードを配置できるようにした
|
||||
- Multiple LORA セクションの追加(全 LoRA を Lora Loader (LoraManager) に一括配置)
|
||||
- `UnetLoaderGGUF` / `QuadrupleCLIPLoader` 対応(HiDream 等の GGUF / 4-CLIP ワークフロー)
|
||||
- `CLIPLoader` のウィジェット名誤りを修正
|
||||
- プレビューエリアの高さを固定し、モデル/プロンプトリストが潰れる問題を修正
|
||||
|
||||
### 変更内容
|
||||
|
||||
#### `web/comfyui/node_sets_menu.js`
|
||||
|
||||
**キャンバスドラッグ対応(新規)**
|
||||
|
||||
- `placeClipTextEncodeNode(text, pos)` 追加 — `CLIPTextEncode` ノードをテキスト入力済みで配置
|
||||
- `placeLoraMgrNode(loras, pos)` 追加 — `Lora Loader (LoraManager)` ノードを全 LoRA データ付きで配置
|
||||
- キャンバスドロップハンドラに新 MIME タイプを追加:
|
||||
- `application/x-wfm-lora-multi` → `placeLoraMgrNode`
|
||||
- `application/x-wfm-clip-text` → `placeClipTextEncodeNode`
|
||||
|
||||
**`renderInfoModels` 更新**
|
||||
|
||||
- 各セクションに `modelType`(`checkpoint` / `vae` / `unet` / `textencoder`)を追加
|
||||
- アイテムを `draggable = true` に設定、`dragstart` で `application/x-wfm-model` を送信
|
||||
- ダブルクリックで `placeModelNode` 呼び出し
|
||||
|
||||
**`renderInfoLoras` 更新**
|
||||
|
||||
- 各 LoRA アイテムを `draggable = true` に設定、`dragstart` で `application/x-wfm-model`(type: `"lora"`)を送信
|
||||
- ダブルクリックで `placeModelNode` 呼び出し
|
||||
- **Multiple LORA セクション追加** — LoRA が 1 件以上あれば下部に表示
|
||||
- `application/x-wfm-lora-multi` で全 LoRA データを転送
|
||||
- ダブルクリックで `placeLoraMgrNode` 呼び出し
|
||||
|
||||
**`renderInfoPrompts` 更新**
|
||||
|
||||
- 各プロンプトアイテムを `draggable = true` に設定、`dragstart` で `application/x-wfm-clip-text` を送信
|
||||
- ダブルクリックで `placeClipTextEncodeNode` 呼び出し
|
||||
|
||||
**`_extractDiffusionModels` 更新**
|
||||
|
||||
- `UNETLoader` のみ → `UNETLoader` / `UnetLoaderGGUF` / `UNETLoaderGGUF` に拡張(GGUF 形式対応)
|
||||
|
||||
**`_extractTextEncoders` 更新**
|
||||
|
||||
- `QuadrupleCLIPLoader`(`clip_name1`〜`clip_name4`)を追加(HiDream 等 4-CLIP モデル対応)
|
||||
- LiteGraph 形式・API 形式の両方に対応
|
||||
|
||||
**バグ修正: `MODEL_NODE_MAP` の `textencoder` ウィジェット名**
|
||||
|
||||
- `clip_name1`(DualCLIPLoader のウィジェット名)→ `clip_name`(CLIPLoader の正しいウィジェット名)に修正
|
||||
- これにより Text Encoder ドラッグ時に正しいモデルファイル名が設定される
|
||||
|
||||
**プレビューエリア高さ固定**
|
||||
|
||||
- `.wfm-nlp-info-drop` を `min-height: 54px`(可変)→ `height: 110px`(固定)に変更
|
||||
- 大きな画像ロード時にモデル/プロンプトリストが圧迫される問題を解消
|
||||
|
||||
**CSS 追加**
|
||||
|
||||
- `.wfm-nlp-info-item--draggable` — `cursor: grab`、ホバー背景、ドラッグ中 `opacity: 0.5`
|
||||
- `.wfm-nlp-info-prompt-item` — `cursor: pointer` → `cursor: grab` に変更、`user-select: none` 追加
|
||||
|
||||
**ヘルプ更新**
|
||||
|
||||
- `index.html`: `wfm-help-sidepanel-13` 更新、`wfm-help-sidepanel-14` / `15` 新規追加
|
||||
- `app.js`: i18n マッピングに `14` / `15` 追加
|
||||
- `i18n.js`: EN / JA / ZH 3 言語すべてに `helpSidepanel13` 更新と `helpSidepanel14` / `15` 追加
|
||||
|
||||
### 対応確認済みワークフロー
|
||||
|
||||
| ファイル | 検出内容 |
|
||||
|---|---|
|
||||
| `non-hidream_i1_full.png` | Diffusion Model: `hidream-i1-full-Q5_0.gguf`(UnetLoaderGGUF)、Text Encoder: 4 件(QuadrupleCLIPLoader)、VAE: 1 件 |
|
||||
|
||||
---
|
||||
|
||||
## 2026-05-16: v0.3.9 サイドパネル I タブ追加 / トップバーアイコン修正
|
||||
|
||||
### 概要
|
||||
|
||||
@@ -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.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -163,10 +163,10 @@ Requires the **[comfyui-image-feeder](https://github.com/ketle-man/comfyui-image
|
||||
- **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 directly in the side panel to view its metadata without leaving the ComfyUI canvas
|
||||
- **model sub-tab** — Checkpoint, VAE, Diffusion Model, and Text Encoder extracted from the workflow
|
||||
- **lora sub-tab** — LoRA names with `strength_model / strength_clip` values
|
||||
- **Prompts sub-tab** — POS / NEG badge list; click any entry to view full text + Copy button
|
||||
- **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
|
||||
- **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
|
||||
- **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
|
||||
- **Drag & drop prompts** — drag a preset onto the canvas to create a WFS_PromptText node with positive/negative prompts
|
||||
@@ -250,6 +250,15 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.3.10
|
||||
- **Information tab — drag to canvas** — model, lora, and Prompts sub-tabs in the side panel I tab now support drag & drop onto the ComfyUI canvas; double-click also places nodes at canvas center
|
||||
- model sub-tab: each item places the corresponding loader node (Checkpoint → `CheckpointLoaderSimple`, VAE → `VAELoader`, Diffusion Model → `UNETLoader`, Text Encoder → `CLIPLoader`)
|
||||
- lora sub-tab: drag individual LoRA to place `LoraLoader`; **Multiple LORA** section (shown for 1+ LoRAs) places all LoRAs in a single `Lora Loader (LoraManager)` node
|
||||
- Prompts sub-tab: drag a prompt to place `CLIPTextEncode` with the full text pre-filled
|
||||
- **Extended node type support** — `UnetLoaderGGUF` / `UNETLoaderGGUF` now detected as Diffusion Model; `QuadrupleCLIPLoader` (HiDream and similar 4-CLIP workflows) now detected as Text Encoder
|
||||
- **Bug fix: CLIPLoader widget name** — `textencoder` type in `MODEL_NODE_MAP` was incorrectly using `clip_name1` (DualCLIPLoader's widget) instead of `clip_name`; Text Encoder models now drop with the correct filename
|
||||
- **Preview area fixed height** — Information tab drop zone fixed at 110px so model/prompt lists are no longer compressed when a large image is loaded
|
||||
|
||||
### v0.3.9
|
||||
- **Side panel I tab** — new Information tab in the Workflow Studio Library side panel; drop a ComfyUI PNG/WebP/JSON directly in the panel to inspect models, LoRAs, and prompts without opening the Metadata tab; sub-tabs: model / lora / Prompts with full-text preview and Copy button
|
||||
- **Side panel tab redesign** — tabs shortened to single letters (W / N / P / M / I) with full name shown on hover
|
||||
|
||||
@@ -307,6 +307,7 @@ function applyI18nToHtml() {
|
||||
"wfm-help-sidepanel-9": "helpSidepanel9", "wfm-help-sidepanel-10": "helpSidepanel10",
|
||||
"wfm-help-sidepanel-11": "helpSidepanel11", "wfm-help-sidepanel-12": "helpSidepanel12",
|
||||
"wfm-help-sidepanel-13": "helpSidepanel13",
|
||||
"wfm-help-sidepanel-14": "helpSidepanel14", "wfm-help-sidepanel-15": "helpSidepanel15",
|
||||
"wfm-help-shortcuts-title": "helpShortcutsTitle",
|
||||
"wfm-help-shortcuts-1": "helpShortcuts1", "wfm-help-shortcuts-2": "helpShortcuts2",
|
||||
"wfm-help-shortcuts-3": "helpShortcuts3", "wfm-help-shortcuts-4": "helpShortcuts4",
|
||||
|
||||
+9
-3
@@ -421,7 +421,9 @@ const LANGUAGES = {
|
||||
helpSidepanel10: "Search within each sub-tab to quickly find items",
|
||||
helpSidepanel11: "Models tab: All / ★ Favorites / Groups / By Type sub-tabs",
|
||||
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 directly in the side panel — sub-tabs: model / lora / Prompts; click any prompt to view full text and copy",
|
||||
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",
|
||||
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",
|
||||
helpShortcutsTitle: "Keyboard Shortcuts",
|
||||
helpShortcuts1: "Escape: Close modal/panel",
|
||||
helpShortcuts2: "Enter: Confirm rename, send chat",
|
||||
@@ -992,7 +994,9 @@ const LANGUAGES = {
|
||||
helpSidepanel10: "各サブタブ内で検索してアイテムをすばやく検索",
|
||||
helpSidepanel11: "Modelsタブ:All / ★ Favorites / Groups / By Typeサブタブ",
|
||||
helpSidepanel12: "⚙ テーマボタン(ヘッダー):パネル背景・サブヘッダー背景・文字色・ボーダー・補助テキスト色をカスタマイズ可能、設定はlocalStorageに保存され次回起動時も反映",
|
||||
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;プロンプトをクリックで全文表示・Copyボタンでコピー",
|
||||
helpSidepanel13: "I タブ(Information):ComfyUI の PNG / WebP / JSON をドロップするとサイドパネル内でモデル・LoRA・プロンプトのメタデータを確認可能 — サブタブ: model / lora / Prompts;UnetLoaderGGUF・QuadrupleCLIPLoader ノードタイプに対応",
|
||||
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 ノードを配置;クリックで全文表示・コピー可能",
|
||||
helpShortcutsTitle: "キーボード操作",
|
||||
helpShortcuts1: "Escape:モーダル・パネルを閉じる",
|
||||
helpShortcuts2: "Enter:名前変更の確定、チャット送信",
|
||||
@@ -1559,7 +1563,9 @@ const LANGUAGES = {
|
||||
helpSidepanel10: "在各子标签内搜索快速查找项目",
|
||||
helpSidepanel11: "Models标签:All / ★ Favorites / Groups / By Type子标签",
|
||||
helpSidepanel12: "⚙ 主题按钮(标题栏):可自定义面板背景、子标题背景、文字颜色、边框及辅助文字颜色,设置保存至localStorage并在下次打开时生效",
|
||||
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;点击提示词可查看全文并复制",
|
||||
helpSidepanel13: "I 标签(Information):拖放 ComfyUI PNG/WebP/JSON 即可在侧面板内查看模型、LoRA 和提示词元数据 — 子标签:model / lora / Prompts;支持 UnetLoaderGGUF 和 QuadrupleCLIPLoader 节点类型",
|
||||
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 节点;点击可查看全文并复制",
|
||||
helpShortcutsTitle: "键盘操作",
|
||||
helpShortcuts1: "Escape:关闭弹窗/面板",
|
||||
helpShortcuts2: "Enter:确认重命名、发送聊天",
|
||||
|
||||
@@ -945,7 +945,9 @@
|
||||
<li id="wfm-help-sidepanel-9">Double-click items to load/place without dragging</li>
|
||||
<li id="wfm-help-sidepanel-10">Search within each sub-tab to quickly find items</li>
|
||||
<li id="wfm-help-sidepanel-12">⚙ Theme button (header): customize panel background, text, border colors — saved to localStorage</li>
|
||||
<li id="wfm-help-sidepanel-13">I tab (Information): drop a ComfyUI PNG/WebP/JSON to inspect model, LoRA, and prompt metadata directly in the side panel — sub-tabs: model / lora / Prompts; click any prompt to view full text and copy</li>
|
||||
<li id="wfm-help-sidepanel-13">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</li>
|
||||
<li id="wfm-help-sidepanel-14">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</li>
|
||||
<li id="wfm-help-sidepanel-15">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</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
+157
-16
@@ -365,6 +365,33 @@ const placePromptNode = (posText, negText, promptName, pos) => {
|
||||
showToast(`Placed: ${promptName || "Prompt"}`, "success");
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// CLIP Text Encode node placement
|
||||
// ============================================
|
||||
|
||||
const placeClipTextEncodeNode = (text, pos) => {
|
||||
const graph = app.graph;
|
||||
if (!graph) return;
|
||||
const node = LiteGraph.createNode("CLIPTextEncode");
|
||||
if (!node) {
|
||||
showToast("Node not found: CLIPTextEncode", "error");
|
||||
return;
|
||||
}
|
||||
const canvas = app.canvas;
|
||||
const centerPos = canvas
|
||||
? [-canvas.ds.offset[0] + canvas.canvas.width / 2 / canvas.ds.scale,
|
||||
-canvas.ds.offset[1] + canvas.canvas.height / 2 / canvas.ds.scale]
|
||||
: [100, 100];
|
||||
node.pos = pos || centerPos;
|
||||
graph.add(node);
|
||||
if (node.widgets) {
|
||||
const w = node.widgets.find(ww => ww.name === "text");
|
||||
if (w) { w.value = text; if (w.callback) w.callback(text); }
|
||||
}
|
||||
app.canvas.setDirty(true, true);
|
||||
showToast("Placed: CLIP Text Encode", "success");
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Model node placement
|
||||
// ============================================
|
||||
@@ -376,7 +403,7 @@ const MODEL_NODE_MAP = {
|
||||
vae: { classType: "VAELoader", widgetName: "vae_name" },
|
||||
controlnet: { classType: "ControlNetLoader", widgetName: "control_net_name" },
|
||||
unet: { classType: "UNETLoader", widgetName: "unet_name" },
|
||||
textencoder: { classType: "CLIPLoader", widgetName: "clip_name1" },
|
||||
textencoder: { classType: "CLIPLoader", widgetName: "clip_name" },
|
||||
hypernetwork: { classType: "HypernetworkLoader", widgetName: "hypernetwork_name" },
|
||||
// embedding has no loader node — copy-only
|
||||
};
|
||||
@@ -429,6 +456,34 @@ const placeModelNode = (modelName, modelType, pos) => {
|
||||
showToast(`Placed: ${filename}`, "success");
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Lora Loader (LoraManager) node placement
|
||||
// ============================================
|
||||
|
||||
const placeLoraMgrNode = (loras, pos) => {
|
||||
const graph = app.graph;
|
||||
if (!graph) return;
|
||||
const node = LiteGraph.createNode("Lora Loader (LoraManager)");
|
||||
if (!node) {
|
||||
showToast("Node not found: Lora Loader (LoraManager)", "error");
|
||||
return;
|
||||
}
|
||||
const canvas = app.canvas;
|
||||
const centerPos = canvas
|
||||
? [-canvas.ds.offset[0] + canvas.canvas.width / 2 / canvas.ds.scale,
|
||||
-canvas.ds.offset[1] + canvas.canvas.height / 2 / canvas.ds.scale]
|
||||
: [100, 100];
|
||||
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 w = node.widgets.find(ww => Array.isArray(ww.value) || ww.name === "loras");
|
||||
if (w) { w.value = loraList; if (w.callback) w.callback(loraList); }
|
||||
}
|
||||
app.canvas.setDirty(true, true);
|
||||
showToast(`Placed: Lora Loader (${loras.length} loras)`, "success");
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// Workflow canvas loading
|
||||
// ============================================
|
||||
@@ -466,7 +521,9 @@ const installCanvasDropHandler = () => {
|
||||
if (e.dataTransfer.types.includes("application/x-wfm-node") ||
|
||||
e.dataTransfer.types.includes("application/x-wfm-workflow") ||
|
||||
e.dataTransfer.types.includes("application/x-wfm-prompt") ||
|
||||
e.dataTransfer.types.includes("application/x-wfm-model")) {
|
||||
e.dataTransfer.types.includes("application/x-wfm-model") ||
|
||||
e.dataTransfer.types.includes("application/x-wfm-lora-multi") ||
|
||||
e.dataTransfer.types.includes("application/x-wfm-clip-text")) {
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = "copy";
|
||||
}
|
||||
@@ -483,6 +540,26 @@ const installCanvasDropHandler = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle Lora Loader (LoraManager) multi-lora drop
|
||||
const loraMultiRaw = e.dataTransfer.getData("application/x-wfm-lora-multi");
|
||||
if (loraMultiRaw) {
|
||||
e.preventDefault();
|
||||
const { loras } = JSON.parse(loraMultiRaw);
|
||||
const pos = getCanvasDropPos(e);
|
||||
placeLoraMgrNode(loras, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle CLIP Text Encode drop
|
||||
const clipTextRaw = e.dataTransfer.getData("application/x-wfm-clip-text");
|
||||
if (clipTextRaw) {
|
||||
e.preventDefault();
|
||||
const { text } = JSON.parse(clipTextRaw);
|
||||
const pos = getCanvasDropPos(e);
|
||||
placeClipTextEncodeNode(text, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle prompt drop
|
||||
const promptRaw = e.dataTransfer.getData("application/x-wfm-prompt");
|
||||
if (promptRaw) {
|
||||
@@ -2079,8 +2156,9 @@ function _extractVAEs(wf) {
|
||||
}
|
||||
function _extractDiffusionModels(wf) {
|
||||
if (!wf || typeof wf !== "object") return [];
|
||||
if (Array.isArray(wf.nodes)) return _collectUnique(_collectAllNodes(wf).filter(n => n.type === "UNETLoader").map(n => n.widgets_values?.[0]));
|
||||
return _collectUnique(Object.values(wf).filter(n => n?.class_type === "UNETLoader").map(n => n.inputs?.unet_name));
|
||||
const _UNET_TYPES = new Set(["UNETLoader", "UnetLoaderGGUF", "UNETLoaderGGUF"]);
|
||||
if (Array.isArray(wf.nodes)) return _collectUnique(_collectAllNodes(wf).filter(n => _UNET_TYPES.has(n.type)).map(n => n.widgets_values?.[0]));
|
||||
return _collectUnique(Object.values(wf).filter(n => _UNET_TYPES.has(n?.class_type)).map(n => n.inputs?.unet_name));
|
||||
}
|
||||
function _extractTextEncoders(wf) {
|
||||
if (!wf || typeof wf !== "object") return [];
|
||||
@@ -2090,6 +2168,7 @@ function _extractTextEncoders(wf) {
|
||||
if (n.type === "CLIPLoader") { if (n.widgets_values?.[0]) names.push(n.widgets_values[0]); }
|
||||
else if (n.type === "DualCLIPLoader") { [0,1].forEach(i => { if (n.widgets_values?.[i]) names.push(n.widgets_values[i]); }); }
|
||||
else if (n.type === "TripleCLIPLoader") { [0,1,2].forEach(i => { if (n.widgets_values?.[i]) names.push(n.widgets_values[i]); }); }
|
||||
else if (n.type === "QuadrupleCLIPLoader") { [0,1,2,3].forEach(i => { if (n.widgets_values?.[i]) names.push(n.widgets_values[i]); }); }
|
||||
}
|
||||
} else {
|
||||
for (const n of Object.values(wf)) {
|
||||
@@ -2098,6 +2177,7 @@ function _extractTextEncoders(wf) {
|
||||
if (ct === "CLIPLoader") { if (n.inputs?.clip_name) names.push(n.inputs.clip_name); }
|
||||
else if (ct === "DualCLIPLoader") { if (n.inputs?.clip_name1) names.push(n.inputs.clip_name1); if (n.inputs?.clip_name2) names.push(n.inputs.clip_name2); }
|
||||
else if (ct === "TripleCLIPLoader") { ["clip_name1","clip_name2","clip_name3"].forEach(k => { if (n.inputs?.[k]) names.push(n.inputs[k]); }); }
|
||||
else if (ct === "QuadrupleCLIPLoader") { ["clip_name1","clip_name2","clip_name3","clip_name4"].forEach(k => { if (n.inputs?.[k]) names.push(n.inputs[k]); }); }
|
||||
}
|
||||
}
|
||||
return _collectUnique(names);
|
||||
@@ -2480,13 +2560,13 @@ const renderInfoModels = (container, meta) => {
|
||||
return;
|
||||
}
|
||||
const sections = [
|
||||
{ label: "Checkpoint", items: meta.checkpoints },
|
||||
{ label: "VAE", items: meta.vaes },
|
||||
{ label: "Diffusion Model", items: meta.diffusionModels },
|
||||
{ label: "Text Encoder", items: meta.textEncoders },
|
||||
{ label: "Checkpoint", items: meta.checkpoints, modelType: "checkpoint" },
|
||||
{ label: "VAE", items: meta.vaes, modelType: "vae" },
|
||||
{ label: "Diffusion Model", items: meta.diffusionModels, modelType: "unet" },
|
||||
{ label: "Text Encoder", items: meta.textEncoders, modelType: "textencoder" },
|
||||
];
|
||||
let hasAny = false;
|
||||
for (const { label, items } of sections) {
|
||||
for (const { label, items, modelType } of sections) {
|
||||
if (!items || items.length === 0) continue;
|
||||
hasAny = true;
|
||||
const sec = document.createElement("div");
|
||||
@@ -2494,9 +2574,17 @@ const renderInfoModels = (container, meta) => {
|
||||
sec.innerHTML = `<div class="wfm-nlp-info-section-title">${esc(label)}</div>`;
|
||||
for (const name of items) {
|
||||
const item = document.createElement("div");
|
||||
item.className = "wfm-nlp-info-item";
|
||||
item.title = name;
|
||||
item.className = "wfm-nlp-info-item wfm-nlp-info-item--draggable";
|
||||
item.draggable = true;
|
||||
item.title = `${name}\nDrag to canvas to place node`;
|
||||
item.innerHTML = `<span class="wfm-nlp-info-item-name">${esc(name)}</span>`;
|
||||
item.addEventListener("dragstart", (e) => {
|
||||
e.dataTransfer.effectAllowed = "copy";
|
||||
e.dataTransfer.setData("application/x-wfm-model", JSON.stringify({ modelName: name, modelType }));
|
||||
item.classList.add("dragging");
|
||||
});
|
||||
item.addEventListener("dragend", () => item.classList.remove("dragging"));
|
||||
item.addEventListener("dblclick", () => placeModelNode(name, modelType));
|
||||
sec.appendChild(item);
|
||||
}
|
||||
container.appendChild(sec);
|
||||
@@ -2512,13 +2600,43 @@ const renderInfoLoras = (container, meta) => {
|
||||
}
|
||||
for (const lora of meta.loras) {
|
||||
const item = document.createElement("div");
|
||||
item.className = "wfm-nlp-info-item";
|
||||
item.title = lora.name;
|
||||
item.className = "wfm-nlp-info-item wfm-nlp-info-item--draggable";
|
||||
item.draggable = true;
|
||||
item.title = `${lora.name}\nDrag to canvas to place LoRA node`;
|
||||
const sm = typeof lora.strength_model === "number" ? lora.strength_model.toFixed(2) : "—";
|
||||
const sc = typeof lora.strength_clip === "number" ? lora.strength_clip.toFixed(2) : "—";
|
||||
item.innerHTML = `<span class="wfm-nlp-info-item-name">${esc(lora.name)}</span><span class="wfm-nlp-info-item-badge">${sm}/${sc}</span>`;
|
||||
item.addEventListener("dragstart", (e) => {
|
||||
e.dataTransfer.effectAllowed = "copy";
|
||||
e.dataTransfer.setData("application/x-wfm-model", JSON.stringify({ modelName: lora.name, modelType: "lora" }));
|
||||
item.classList.add("dragging");
|
||||
});
|
||||
item.addEventListener("dragend", () => item.classList.remove("dragging"));
|
||||
item.addEventListener("dblclick", () => placeModelNode(lora.name, "lora"));
|
||||
container.appendChild(item);
|
||||
}
|
||||
|
||||
if (meta.loras.length >= 1) {
|
||||
const sep = document.createElement("div");
|
||||
sep.className = "wfm-nlp-info-section-title";
|
||||
sep.style.marginTop = "8px";
|
||||
sep.textContent = "Multiple LORA";
|
||||
container.appendChild(sep);
|
||||
|
||||
const multiItem = document.createElement("div");
|
||||
multiItem.className = "wfm-nlp-info-item wfm-nlp-info-item--draggable";
|
||||
multiItem.draggable = true;
|
||||
multiItem.title = `Drag to canvas to place Lora Loader (LoraManager) with all ${meta.loras.length} loras`;
|
||||
multiItem.innerHTML = `<span class="wfm-nlp-info-item-name">All ${meta.loras.length} LoRAs</span><span class="wfm-nlp-info-item-badge">LoraManager</span>`;
|
||||
multiItem.addEventListener("dragstart", (e) => {
|
||||
e.dataTransfer.effectAllowed = "copy";
|
||||
e.dataTransfer.setData("application/x-wfm-lora-multi", JSON.stringify({ loras: meta.loras }));
|
||||
multiItem.classList.add("dragging");
|
||||
});
|
||||
multiItem.addEventListener("dragend", () => multiItem.classList.remove("dragging"));
|
||||
multiItem.addEventListener("dblclick", () => placeLoraMgrNode(meta.loras));
|
||||
container.appendChild(multiItem);
|
||||
}
|
||||
};
|
||||
|
||||
const renderInfoPrompts = (container, meta) => {
|
||||
@@ -2541,6 +2659,8 @@ const renderInfoPrompts = (container, meta) => {
|
||||
for (const { type, text } of allPrompts) {
|
||||
const item = document.createElement("div");
|
||||
item.className = "wfm-nlp-info-prompt-item";
|
||||
item.draggable = true;
|
||||
item.title = `Drag to canvas to place CLIP Text Encode node`;
|
||||
const snippet = text.length > 55 ? text.slice(0, 55) + "…" : text;
|
||||
const badge = type === "positive"
|
||||
? `<span class="wfm-nlp-info-badge-pos">POS</span>`
|
||||
@@ -2554,6 +2674,13 @@ const renderInfoPrompts = (container, meta) => {
|
||||
if (promptFull) promptFull.value = text;
|
||||
if (promptFullLabel) promptFullLabel.textContent = type === "positive" ? "Positive" : type === "negative" ? "Negative" : "Text";
|
||||
});
|
||||
item.addEventListener("dragstart", (e) => {
|
||||
e.dataTransfer.effectAllowed = "copy";
|
||||
e.dataTransfer.setData("application/x-wfm-clip-text", JSON.stringify({ text }));
|
||||
item.classList.add("dragging");
|
||||
});
|
||||
item.addEventListener("dragend", () => item.classList.remove("dragging"));
|
||||
item.addEventListener("dblclick", () => placeClipTextEncodeNode(text));
|
||||
container.appendChild(item);
|
||||
}
|
||||
const first = container.querySelector(".wfm-nlp-info-prompt-item");
|
||||
@@ -2794,13 +2921,13 @@ const injectStyles = () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 54px;
|
||||
height: 110px;
|
||||
flex-shrink: 0;
|
||||
border: 2px dashed var(--border-color, #4e4e4e);
|
||||
border-radius: 6px;
|
||||
margin: 8px 8px 0;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
transition: border-color 0.15s;
|
||||
position: relative;
|
||||
}
|
||||
@@ -2844,6 +2971,19 @@ const injectStyles = () => {
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
}
|
||||
.wfm-nlp-info-item--draggable {
|
||||
cursor: grab;
|
||||
transition: background 0.12s;
|
||||
user-select: none;
|
||||
}
|
||||
.wfm-nlp-info-item--draggable:hover {
|
||||
background: var(--comfy-input-bg, #333);
|
||||
}
|
||||
.wfm-nlp-info-item--draggable.dragging,
|
||||
.wfm-nlp-info-prompt-item.dragging {
|
||||
opacity: 0.5;
|
||||
background: var(--comfy-input-bg, #333);
|
||||
}
|
||||
.wfm-nlp-info-item-name {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
@@ -2867,11 +3007,12 @@ const injectStyles = () => {
|
||||
padding: 5px 10px;
|
||||
font-size: 11px;
|
||||
border-bottom: 1px solid var(--border-color, #3a3a3a);
|
||||
cursor: pointer;
|
||||
cursor: grab;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
transition: background 0.12s;
|
||||
user-select: none;
|
||||
}
|
||||
.wfm-nlp-info-prompt-item:hover {
|
||||
background: var(--comfy-input-bg, #333);
|
||||
|
||||
Reference in New Issue
Block a user