Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85ce2e05df |
@@ -1,5 +1,49 @@
|
||||
# DEVLOG - ComfyUI-Workflow-Studio
|
||||
|
||||
## 2026-06-10: v0.3.36 — コードレビュー修正+リファクタリング+README刷新
|
||||
|
||||
### コードレビュー修正(v0.3.35の不具合10件)
|
||||
|
||||
#### ヘルプi18n配線の修正(`static/js/i18n.js`, `static/js/app.js`, `templates/index.html`)
|
||||
- **バグ**: `applyI18nToHtml()` が起動時に全言語でヘルプ文を上書きするため、v0.3.35でindex.htmlに追記したヘルプ更新(Saveボタン・ソート・JSONタブ改名)が一切表示されなかった
|
||||
- `helpGen2` / `helpModels2` / `helpGallery8` / `helpGallery10` を3言語ともindex.htmlの新文言に同期
|
||||
- `helpGallery12` / `helpGallery13` キーを3言語で新規追加(Metadata / Load GenUI ボタン説明)
|
||||
- `helpIdMap` に `wfm-help-models-12` / `wfm-help-trouble-6` / `wfm-help-gallery-12` / `wfm-help-gallery-13` を登録
|
||||
- index.html の「Thumbnail, Card, and Table」誤記を修正(カードビューはv0.3.22で廃止済み)
|
||||
|
||||
#### GenerateUI Save の安全化(`static/js/generate-tab.js`)
|
||||
- **上書き確認**: 保存前に `GET /api/wfm/workflows` で既存ファイルを照会し、同名があれば confirm 表示。保存先が **UI形式**(`analysis.format === "ui"`)の場合はAPI形式上書きでノード配置が失われる旨の専用警告
|
||||
- **Raw JSON同期**: Raw JSONテキストエリアに未Applyの編集があればパースして保存対象に反映し、保存後エディタへ同期。不正JSONはエラーで中断(従来は古い内容を黙って保存していた)
|
||||
- **HTML注入防止**: ファイル名を `value="${...}"` 属性埋め込みからDOM経由の `input.value` 設定に変更
|
||||
- **デフォルト名**: 拡張子除去を `.json` のみ→画像拡張子(.png/.jpg/.jpeg/.webp/.gif)にも拡大
|
||||
- **二重送信ガード**: `saving` フラグでEnter連打・多重POSTを防止
|
||||
|
||||
#### その他
|
||||
- `sortModels` を decorate-sort-undecorate 方式に変更(`sortKeyOf()` で1モデル1回だけキー計算。比較ごとの `parseModelPath` 再計算を解消)(`static/js/models-tab.js`)
|
||||
- ギャラリーの Metadata / Load GenUI ボタンを `.wfm-gallery-detail-tab-btn` から専用の `.wfm-gallery-action-btn` に分離し、CSSの `!important` 16箇所を全廃(`templates/index.html`, `static/css/gallery-tab.css`)
|
||||
- Save関連・ギャラリーの新規文字列をi18n化(`saveWorkflowTitle` / `savedAs` / `overwriteConfirm` / `gallerySelectImageFirst` 等を3言語追加)
|
||||
|
||||
### リファクタリング
|
||||
|
||||
#### util.js 新設(`static/js/util.js` 新規)
|
||||
- `escapeHtml()`: 5ファイル(gallery / metadata / models / nodes / workflow)の重複定義を統一。metadata-tab版は `"` エスケープが抜けており属性値でHTML注入の恐れがあった(修正済み)
|
||||
- `readJsonStorage(key, fallback)` / `getSettings()`: `JSON.parse(localStorage.getItem(...))` の直書き15箇所(8ファイル)を置換。try/catchの重複も削減
|
||||
|
||||
#### トーストi18n化(全タブJS, `static/js/i18n.js`)
|
||||
- ハードコード英語トースト約115箇所をすべて `t()` 化(残り0件)
|
||||
- 共通キー約60個を3言語(EN/JA/ZH)で追加: `errorWithMsg` / `groupCreated` / `presetSavedName` / `batchNoneSelected` / `generationComplete` など
|
||||
- 既存キーとの衝突回避: 文字列型の既存 `importError` / `presetSaved` と重複したため、新関数型キーは `importErrorMsg` / `presetSavedName` に命名
|
||||
- 既存バグ修正: Settings画面の `textSizeLabel` / `jsonColor*` 系11キーが未定義で生キー名が表示されていた(v0.3.14由来。`t() || "fallback"` はt()がキー名を返すため機能しない)→ 3言語で定義追加
|
||||
- ZHブロックに欠落していた `copyPositivePrompt` / `copyNegativePrompt` / `copiedToClipboard` / `noTextToCopy` を追加
|
||||
- 検証: 全 `t()` 呼び出しキーの定義確認・3言語のキー完全一致・重複キーなし・全JS構文チェック通過
|
||||
|
||||
### README刷新(`README.md`, `pyproject.toml`, `docs/`)
|
||||
- 冒頭説明文を3本柱構成に書き換え: 📁 Management(ワークフロー/モデル/画像/プロンプト管理、AIプロンプト支援・翻訳・タグ生成、ファイルドロップ&ギャラリー連携メタデータ)/ ⚡ GenerateUI(全タブ連携、モデル・サンプラー等バッチ生成、Image Feeder)/ 📚 Workflow Studio Library(キャンバスドロップ、画像/JSONメタデータ表示&ドロップ、AIツール)
|
||||
- スクリーンショット差し替え・追加: `6_ws_library.png` 差し替え、`9_GenUI_LoraStack.png`(GenUI LoRA Stack)・`10_GenUI_Batch.png`(GenUI Batch)・`11_multiple_select_menu.png`(Models Multi-select Menu)を新規追加し、生成UI系3枚が連続するよう表を再配置
|
||||
- `pyproject.toml` の `description` をREADME新説明文と整合する内容に更新
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-10: v0.3.35 — テーブルソート・Load GenUI・ワークフロー保存
|
||||
|
||||
### 変更内容
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
# ComfyUI-Workflow-Studio
|
||||
|
||||
A comprehensive workflow management and generation UI plugin for [ComfyUI](https://github.com/comfyanonymous/ComfyUI).
|
||||
A comprehensive workflow, asset management, and generation UI plugin for [ComfyUI](https://github.com/comfyanonymous/ComfyUI).
|
||||
|
||||
Browse, organize, and execute workflows directly from a dedicated studio interface — without switching between windows or manually editing JSON.
|
||||
**📁 Management** — organize all your assets in one studio
|
||||
- Workflow, model, image, and prompt management
|
||||
- AI-powered prompt writing assistance, translation, and tag generation
|
||||
- File drop & Gallery-linked metadata viewing — inspect and reuse generation settings instantly
|
||||
|
||||
**⚡ GenerateUI** — a productivity-focused generation tab connected to every other tab
|
||||
- Batch generation across models, samplers, prompts, and workflows
|
||||
- Image Feeder for continuous folder-based generation
|
||||
|
||||
**📚 Workflow Studio Library** — a multi-function side panel for smooth ComfyUI integration
|
||||
- Drag & drop models, nodes, prompts, and workflows straight onto the canvas
|
||||
- View metadata from images / JSON, then drop the detected models and prompts onto the canvas
|
||||
- Built-in AI tools (translation and more)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -17,13 +29,21 @@ Browse, organize, and execute workflows directly from a dedicated studio interfa
|
||||
|:---:|:---:|
|
||||
|  |  |
|
||||
|
||||
| Top Bar | WS Library |
|
||||
| GenUI LoRA Stack | GenUI Batch |
|
||||
|:---:|:---:|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
| Library Information | Customize |
|
||||
| Models Multi-select Menu | Top Bar |
|
||||
|:---:|:---:|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
| WS Library | Library Information |
|
||||
|:---:|:---:|
|
||||
|  |  |
|
||||
|
||||
| Customize | |
|
||||
|:---:|:---:|
|
||||
|  | |
|
||||
|
||||
---
|
||||
|
||||
@@ -286,6 +306,15 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
|
||||
|
||||
## Changelog
|
||||
|
||||
### v0.3.36
|
||||
- **GenerateUI Save — overwrite protection** — saving now checks for an existing file and asks for confirmation before overwriting; if the target file is in UI format, a dedicated warning explains that saving in API format will lose the node layout
|
||||
- **GenerateUI Save — Raw JSON sync** — unapplied Raw JSON edits are now included in the save (parsed and synced back to the editor); invalid JSON aborts the save with an error instead of silently saving stale content
|
||||
- **GenerateUI Save — hardening** — filename is set via DOM (no HTML-attribute injection), image extensions (`.png` etc.) are stripped from the default name, and a double-submit guard prevents duplicate POSTs
|
||||
- **Help i18n fixed** — v0.3.35 help text updates (Save button, table sort, JSON tab rename) were being overwritten at startup by stale i18n strings and never displayed; all help keys synced in EN / JA / ZH and new entries registered in the help ID map
|
||||
- **Toast i18n** — ~115 hard-coded English toasts replaced with translated messages (~60 new shared keys in EN / JA / ZH); Settings labels for Text Size / RAW JSON Colors that displayed raw key names are now properly defined
|
||||
- **Refactoring** — new shared `util.js` (`escapeHtml` unified across 5 files — the Metadata tab copy was missing `"` escaping; `readJsonStorage` / `getSettings` replace 15 direct `localStorage` parses); Models table sort now precomputes sort keys (faster on large libraries); Gallery action buttons moved off the tab-button class, removing all `!important` CSS overrides
|
||||
- **README refreshed** — intro rewritten around the three pillars (Management / GenerateUI / Library side panel); new screenshots: GenUI LoRA Stack, GenUI Batch, Models Multi-select Menu; WS Library image updated
|
||||
|
||||
### v0.3.35
|
||||
- **Models tab — Table column sort** — click any column header to sort ascending (▲), click again for descending (▼), click a third time to clear; active column name highlighted in accent color; Enable/Disable column header now labeled **E/D**
|
||||
- **Gallery tab — Load GenUI button** — new button to the right of the Metadata button in the detail panel; loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab; warning toast shown if no workflow is embedded or the format is unsupported; Metadata button restyled green, Load GenUI uses primary accent color
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 193 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 64 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
+2
-2
@@ -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.35"
|
||||
description = "A comprehensive workflow, asset management, and generation UI plugin for ComfyUI. Manage workflows, models, images, and prompts; batch generation and Image Feeder in the GenerateUI tab; library side panel with canvas drag & drop and AI tools."
|
||||
version = "0.3.36"
|
||||
license = "MIT"
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
+15
-18
@@ -604,37 +604,34 @@
|
||||
|
||||
/* ── 詳細パネル アクションボタン (タブナビ内) ────────────────── */
|
||||
|
||||
.wfm-gallery-action-btn-green,
|
||||
.wfm-gallery-action-btn-primary {
|
||||
padding: 4px 10px !important;
|
||||
border-radius: 4px !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
cursor: pointer !important;
|
||||
font-size: 12px !important;
|
||||
.wfm-gallery-action-btn {
|
||||
padding: 4px 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
align-self: center;
|
||||
margin: 2px 3px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.wfm-gallery-action-btn-green {
|
||||
background: var(--wfm-success, #22c55e) !important;
|
||||
color: #fff !important;
|
||||
border-color: var(--wfm-success, #22c55e) !important;
|
||||
background: var(--wfm-success, #22c55e);
|
||||
border-color: var(--wfm-success, #22c55e);
|
||||
}
|
||||
.wfm-gallery-action-btn-green:hover {
|
||||
background: #16a34a !important;
|
||||
border-color: #16a34a !important;
|
||||
background: #16a34a;
|
||||
border-color: #16a34a;
|
||||
}
|
||||
|
||||
.wfm-gallery-action-btn-primary {
|
||||
background: var(--wfm-primary) !important;
|
||||
color: #fff !important;
|
||||
border-color: var(--wfm-primary) !important;
|
||||
background: var(--wfm-primary);
|
||||
border-color: var(--wfm-primary);
|
||||
}
|
||||
.wfm-gallery-action-btn-primary:hover {
|
||||
background: var(--wfm-primary-hover) !important;
|
||||
border-color: var(--wfm-primary-hover) !important;
|
||||
background: var(--wfm-primary-hover);
|
||||
border-color: var(--wfm-primary-hover);
|
||||
}
|
||||
|
||||
/* ── ファイル操作ボタン (詳細パネル) ─────────────────────────── */
|
||||
|
||||
+2
-5
@@ -5,6 +5,7 @@
|
||||
|
||||
import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { readJsonStorage } from "./util.js";
|
||||
|
||||
const SETTINGS_KEY = "wfm_ai_settings";
|
||||
|
||||
@@ -19,11 +20,7 @@ const LANG_NAMES = {
|
||||
// ============================================
|
||||
|
||||
function loadAiSettings() {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(SETTINGS_KEY) || "{}");
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
return readJsonStorage(SETTINGS_KEY);
|
||||
}
|
||||
|
||||
function saveAiSettings(patch) {
|
||||
|
||||
+7
-10
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import { initI18n, t } from "./i18n.js";
|
||||
import { getSettings } from "./util.js";
|
||||
|
||||
// Initialize i18n before anything else
|
||||
initI18n();
|
||||
@@ -356,14 +357,15 @@ function applyI18nToHtml() {
|
||||
"wfm-help-models-5": "helpModels5", "wfm-help-models-6": "helpModels6",
|
||||
"wfm-help-models-7": "helpModels7", "wfm-help-models-8": "helpModels8",
|
||||
"wfm-help-models-9": "helpModels9", "wfm-help-models-10": "helpModels10",
|
||||
"wfm-help-models-11": "helpModels11",
|
||||
"wfm-help-models-11": "helpModels11", "wfm-help-models-12": "helpModels12",
|
||||
"wfm-help-gallery-title": "helpGalleryTitle",
|
||||
"wfm-help-gallery-1": "helpGallery1", "wfm-help-gallery-2": "helpGallery2",
|
||||
"wfm-help-gallery-3": "helpGallery3", "wfm-help-gallery-4": "helpGallery4",
|
||||
"wfm-help-gallery-5": "helpGallery5", "wfm-help-gallery-6": "helpGallery6",
|
||||
"wfm-help-gallery-7": "helpGallery7", "wfm-help-gallery-8": "helpGallery8",
|
||||
"wfm-help-gallery-9": "helpGallery9", "wfm-help-gallery-10": "helpGallery10",
|
||||
"wfm-help-gallery-11": "helpGallery11",
|
||||
"wfm-help-gallery-11": "helpGallery11", "wfm-help-gallery-12": "helpGallery12",
|
||||
"wfm-help-gallery-13": "helpGallery13",
|
||||
"wfm-help-sidepanel-title": "helpSidepanelTitle",
|
||||
"wfm-help-sidepanel-1": "helpSidepanel1", "wfm-help-sidepanel-2": "helpSidepanel2",
|
||||
"wfm-help-sidepanel-3": "helpSidepanel3", "wfm-help-sidepanel-4": "helpSidepanel4",
|
||||
@@ -383,7 +385,7 @@ function applyI18nToHtml() {
|
||||
"wfm-help-trouble-title": "helpTroubleTitle",
|
||||
"wfm-help-trouble-1": "helpTrouble1", "wfm-help-trouble-2": "helpTrouble2",
|
||||
"wfm-help-trouble-3": "helpTrouble3", "wfm-help-trouble-4": "helpTrouble4",
|
||||
"wfm-help-trouble-5": "helpTrouble5",
|
||||
"wfm-help-trouble-5": "helpTrouble5", "wfm-help-trouble-6": "helpTrouble6",
|
||||
"wfm-help-support-title": "helpSupportTitle",
|
||||
"wfm-help-support-desc": "helpSupportDesc",
|
||||
"wfm-help-github-desc": "helpGithubDesc",
|
||||
@@ -440,15 +442,10 @@ import { initAiTab } from "./ai-tab.js";
|
||||
// Apply saved theme immediately to prevent flash of default theme
|
||||
applyTheme(getSavedTheme());
|
||||
|
||||
// Apply saved textarea font size
|
||||
// Apply saved textarea font size & JSON highlight colors
|
||||
try {
|
||||
const _s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
const _s = getSettings();
|
||||
if (_s.textareaFontSize) applyTextareaFontSize(_s.textareaFontSize);
|
||||
} catch {}
|
||||
|
||||
// Apply saved JSON highlight colors
|
||||
try {
|
||||
const _s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
applyJsonColors(_s.jsonColors);
|
||||
} catch {}
|
||||
|
||||
|
||||
+18
-17
@@ -4,6 +4,7 @@
|
||||
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
|
||||
// ── Module State ──────────────────────────────────────────────────
|
||||
const _s = {
|
||||
@@ -76,11 +77,11 @@ function _applyToWorkflow() {
|
||||
const nodeId = document.getElementById("wfm-feeder-node-sel")?.value;
|
||||
const wf = comfyUI.currentWorkflow;
|
||||
if (!nodeId || !wf?.[nodeId]) {
|
||||
showToast("No ImageFeeder node selected", "error");
|
||||
showToast(t("feederNoNode"), "error");
|
||||
return;
|
||||
}
|
||||
_applyToNode(nodeId);
|
||||
showToast("Applied to workflow", "success");
|
||||
showToast(t("appliedToWorkflow"), "success");
|
||||
}
|
||||
|
||||
// ── Run Loop ──────────────────────────────────────────────────────
|
||||
@@ -108,18 +109,18 @@ function _applyToNode(nodeId) {
|
||||
|
||||
async function _startRun() {
|
||||
if (_s.running) return;
|
||||
if (!comfyUI.currentWorkflow) { showToast("No workflow loaded", "error"); return; }
|
||||
if (!comfyUI.connected) { showToast("Not connected to ComfyUI", "error"); return; }
|
||||
if (!comfyUI.currentWorkflow) { showToast(t("noWorkflowLoaded"), "error"); return; }
|
||||
if (!comfyUI.connected) { showToast(t("notConnectedToComfyUI"), "error"); return; }
|
||||
|
||||
const nodeId = document.getElementById("wfm-feeder-node-sel")?.value;
|
||||
if (!nodeId || !comfyUI.currentWorkflow[nodeId]) {
|
||||
showToast("No ImageFeeder node selected", "error");
|
||||
showToast(t("feederNoNode"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
// WebSocket を先に接続してノード sync メッセージを受け取れるようにする
|
||||
const wsOk = await comfyUI.connectWebSocket();
|
||||
if (!wsOk) { showToast("WebSocket connection failed", "error"); return; }
|
||||
if (!wsOk) { showToast(t("wsConnectionFailed"), "error"); return; }
|
||||
|
||||
_s.running = true;
|
||||
_setRunUI(true);
|
||||
@@ -195,14 +196,14 @@ async function _startRun() {
|
||||
if (indexEl) indexEl.value = _lastSync.next_index;
|
||||
if (control === "increment" && !_lastSync.has_next) {
|
||||
_s.running = false;
|
||||
showToast(`Feeder complete (${count} generated)`, "success");
|
||||
showToast(t("feederComplete", count), "success");
|
||||
break;
|
||||
}
|
||||
// loop: has_next=false でも次は index=0 からなので続行
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (_s.running) showToast("Feeder run error: " + err.message, "error");
|
||||
if (_s.running) showToast(t("feederRunError", err.message), "error");
|
||||
} finally {
|
||||
comfyUI.socket?.removeEventListener("message", _syncHandler);
|
||||
_s.running = false;
|
||||
@@ -215,7 +216,7 @@ async function _stopRun() {
|
||||
_s.running = false;
|
||||
try { await comfyUI.interrupt(); } catch {}
|
||||
_setRunUI(false);
|
||||
showToast("Feeder stopped", "info");
|
||||
showToast(t("feederStopped"), "info");
|
||||
}
|
||||
|
||||
// ── Folder Tree ───────────────────────────────────────────────────
|
||||
@@ -420,7 +421,7 @@ function _renderPresets() {
|
||||
|
||||
async function _savePreset() {
|
||||
const name = document.getElementById("wfm-feeder-preset-name")?.value.trim();
|
||||
if (!name) { showToast("Enter a preset name", "error"); return; }
|
||||
if (!name) { showToast(t("enterPresetName"), "error"); return; }
|
||||
const sel = _s.images.filter(f => _s.selected.has(f));
|
||||
try {
|
||||
const res = await fetch("/image_feeder/presets", {
|
||||
@@ -429,20 +430,20 @@ async function _savePreset() {
|
||||
body: JSON.stringify({ name, directory: _s.dir, selected_files: sel }),
|
||||
});
|
||||
if (res.ok) {
|
||||
showToast(`Preset saved: ${name}`, "success");
|
||||
showToast(t("presetSavedName", name), "success");
|
||||
const nameInput = document.getElementById("wfm-feeder-preset-name");
|
||||
if (nameInput) nameInput.value = "";
|
||||
await _loadPresets();
|
||||
const selEl = document.getElementById("wfm-feeder-preset-sel");
|
||||
if (selEl) selEl.value = name;
|
||||
} else { showToast("Save failed", "error"); }
|
||||
} catch (err) { showToast("Save error: " + err.message, "error"); }
|
||||
} else { showToast(t("saveFailed"), "error"); }
|
||||
} catch (err) { showToast(t("saveFailed", err.message), "error"); }
|
||||
}
|
||||
|
||||
async function _applyPreset() {
|
||||
const selEl = document.getElementById("wfm-feeder-preset-sel");
|
||||
const name = selEl?.value;
|
||||
if (!name || !_s.presets[name]) { showToast("Select a preset first", "error"); return; }
|
||||
if (!name || !_s.presets[name]) { showToast(t("selectPresetFirst"), "error"); return; }
|
||||
const preset = _s.presets[name];
|
||||
const dir = preset.directory || "";
|
||||
|
||||
@@ -457,7 +458,7 @@ async function _applyPreset() {
|
||||
}
|
||||
_refreshGridCbs();
|
||||
_updateStatus();
|
||||
showToast(`Preset loaded: ${name}`, "success");
|
||||
showToast(t("presetLoaded", name), "success");
|
||||
}
|
||||
|
||||
async function _deletePreset() {
|
||||
@@ -465,9 +466,9 @@ async function _deletePreset() {
|
||||
if (!name) return;
|
||||
try {
|
||||
await fetch(`/image_feeder/presets/${encodeURIComponent(name)}`, { method: "DELETE" });
|
||||
showToast(`Preset deleted: ${name}`, "info");
|
||||
showToast(t("presetDeleted", name), "info");
|
||||
await _loadPresets();
|
||||
} catch (err) { showToast("Delete error", "error"); }
|
||||
} catch (err) { showToast(t("deleteFailed"), "error"); }
|
||||
}
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────
|
||||
|
||||
+42
-48
@@ -7,6 +7,7 @@ import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { loadFileIntoMetadataTab } from "./metadata-tab.js";
|
||||
import { loadWorkflowIntoEditor } from "./generate-tab.js";
|
||||
import { escapeHtml } from "./util.js";
|
||||
|
||||
// ── 定数 ─────────────────────────────────────────────────────
|
||||
|
||||
@@ -75,7 +76,7 @@ async function openImageInMetadataTab(img) {
|
||||
const file = new File([blob], img.filename, { type: blob.type || "image/png" });
|
||||
await loadFileIntoMetadataTab(file);
|
||||
} catch (e) {
|
||||
showToast(`Metadata error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +481,7 @@ async function toggleFavoriteInPlace(img, btn) {
|
||||
state.selectedImage.favorite = data.favorite;
|
||||
}
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,7 +607,7 @@ async function saveMetaField(fields) {
|
||||
const idx = state.images.findIndex(i => i.path === state.selectedImage.path);
|
||||
if (idx >= 0) Object.assign(state.images[idx], fields);
|
||||
} catch (e) {
|
||||
showToast(`Save failed: ${e.message}`, "error");
|
||||
showToast(t("saveFailed", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,9 +730,9 @@ function renderDetailGroup(img) {
|
||||
const cached = state.images.find(i => i.path === img.path);
|
||||
if (cached) cached.groups = img.groups;
|
||||
renderDetailGroup(img);
|
||||
showToast(`Removed from "${g}"`, "success");
|
||||
showToast(t("removedFromGroupName", g), "success");
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -751,9 +752,9 @@ function renderDetailGroup(img) {
|
||||
const cached = state.images.find(i => i.path === img.path);
|
||||
if (cached) cached.groups = img.groups;
|
||||
renderDetailGroup(img);
|
||||
showToast(`Added to "${g}"`, "success");
|
||||
showToast(t("addedToGroupName", g), "success");
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -763,7 +764,7 @@ function renderDetailGroup(img) {
|
||||
const name = input?.value.trim();
|
||||
if (!name) return;
|
||||
if (state.groups.some(g => g.name === name)) {
|
||||
showToast("Group already exists", "warning");
|
||||
showToast(t("groupExists"), "warning");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -783,9 +784,9 @@ function renderDetailGroup(img) {
|
||||
if (cached) cached.groups = img.groups;
|
||||
input.value = "";
|
||||
await loadGroups(); // セレクト類を更新
|
||||
showToast(`Group "${name}" created`, "success");
|
||||
showToast(t("groupCreated", name), "success");
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -797,7 +798,7 @@ function renderDetailGroup(img) {
|
||||
const newName = prompt(`Rename group "${oldName}" to:`, oldName);
|
||||
if (!newName || newName === oldName) return;
|
||||
if (state.groups.some(g => g.name === newName)) {
|
||||
showToast("Group name already exists", "warning");
|
||||
showToast(t("groupNameExists"), "warning");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -820,9 +821,9 @@ function renderDetailGroup(img) {
|
||||
state.groupFilter = newName;
|
||||
}
|
||||
await loadGroups();
|
||||
showToast(`Renamed to "${newName}"`, "success");
|
||||
showToast(t("renamedTo", newName), "success");
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -843,26 +844,19 @@ function renderDetailGroup(img) {
|
||||
if (filterSel) filterSel.value = "";
|
||||
}
|
||||
await loadGroups();
|
||||
showToast(`Group "${name}" deleted`, "success");
|
||||
showToast(t("groupDeleted", name), "success");
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
return String(str)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
// ── フォルダ作成・削除 ────────────────────────────────────────
|
||||
|
||||
async function createFolder() {
|
||||
if (!state.currentFolder) {
|
||||
showToast("Please select a parent folder first", "error");
|
||||
showToast(t("selectParentFolderFirst"), "error");
|
||||
return;
|
||||
}
|
||||
const name = prompt("New folder name:");
|
||||
@@ -875,13 +869,13 @@ async function createFolder() {
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!data.ok) {
|
||||
showToast(`Error: ${data.error}`, "error");
|
||||
showToast(t("errorWithMsg", data.error), "error");
|
||||
return;
|
||||
}
|
||||
showToast(`Folder "${name.trim()}" created`, "success");
|
||||
showToast(t("folderCreated", name.trim()), "success");
|
||||
await loadFolderTree();
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,16 +890,16 @@ async function deleteFolder() {
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!data.ok) {
|
||||
showToast(`Error: ${data.error}`, "error");
|
||||
showToast(t("errorWithMsg", data.error), "error");
|
||||
return;
|
||||
}
|
||||
showToast("Folder deleted", "success");
|
||||
showToast(t("folderDeleted"), "success");
|
||||
state.currentFolder = "";
|
||||
state.images = [];
|
||||
document.getElementById("wfm-gallery-grid").innerHTML = `<p class="wfm-placeholder">Select a folder to browse images.</p>`;
|
||||
await loadFolderTree();
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -920,7 +914,7 @@ async function performDeleteImages(paths) {
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.deleted && data.deleted.length > 0) {
|
||||
showToast(`Deleted ${data.deleted.length} image(s)`, "success");
|
||||
showToast(t("deletedNImages", data.deleted.length), "success");
|
||||
// 削除された画像をstateから除去
|
||||
const deletedSet = new Set(data.deleted);
|
||||
state.images = state.images.filter(img => !deletedSet.has(img.path));
|
||||
@@ -940,10 +934,10 @@ async function performDeleteImages(paths) {
|
||||
loadFolderTree();
|
||||
}
|
||||
if (data.errors && data.errors.length > 0) {
|
||||
showToast(`Errors: ${data.errors.join(", ")}`, "error");
|
||||
showToast(t("errorsList", data.errors.join(", ")), "error");
|
||||
}
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -956,7 +950,7 @@ async function performMoveImages(paths, destFolder) {
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.moved && data.moved.length > 0) {
|
||||
showToast(`Moved ${data.moved.length} image(s)`, "success");
|
||||
showToast(t("movedNImages", data.moved.length), "success");
|
||||
const movedSet = new Set(data.moved.map(m => m.from));
|
||||
state.images = state.images.filter(img => !movedSet.has(img.path));
|
||||
state.selectedImages = new Set([...state.selectedImages].filter(p => !movedSet.has(p)));
|
||||
@@ -974,13 +968,13 @@ async function performMoveImages(paths, destFolder) {
|
||||
loadFolderTree();
|
||||
}
|
||||
if (data.errors && data.errors.length > 0) {
|
||||
showToast(`Errors: ${data.errors.join(", ")}`, "error");
|
||||
showToast(t("errorsList", data.errors.join(", ")), "error");
|
||||
}
|
||||
if (data.error) {
|
||||
showToast(`Error: ${data.error}`, "error");
|
||||
showToast(t("errorWithMsg", data.error), "error");
|
||||
}
|
||||
} catch (e) {
|
||||
showToast(`Error: ${e.message}`, "error");
|
||||
showToast(t("errorWithMsg", e.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1002,7 +996,7 @@ function openMoveModal(paths) {
|
||||
const destinations = allFolders.filter(f => f.abs_path !== state.currentFolder);
|
||||
|
||||
if (destinations.length === 0) {
|
||||
showToast("No other folders available. Create a subfolder first.", "error");
|
||||
showToast(t("noOtherFolders"), "error");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1055,7 +1049,7 @@ async function bulkAddToGroup(groupName) {
|
||||
success++;
|
||||
} catch (e) { /* continue */ }
|
||||
}
|
||||
showToast(`Added ${success} image(s) to "${groupName}"`, "success");
|
||||
showToast(t("addedNImagesToGroup", success, groupName), "success");
|
||||
}
|
||||
|
||||
async function bulkSetFavorite(favoriteValue) {
|
||||
@@ -1076,7 +1070,7 @@ async function bulkSetFavorite(favoriteValue) {
|
||||
} catch (e) { /* continue */ }
|
||||
}
|
||||
if (success > 0) {
|
||||
showToast(`${favoriteValue ? "Favorited" : "Unfavorited"} ${success} image(s)`, "success");
|
||||
showToast(favoriteValue ? t("favoritedNImages", success) : t("unfavoritedNImages", success), "success");
|
||||
renderImages(); // お気に入り状態が変わったのでビュー更新
|
||||
}
|
||||
}
|
||||
@@ -1220,18 +1214,18 @@ function bindEvents() {
|
||||
// メモ保存
|
||||
document.getElementById("wfm-gallery-memo-save-btn")?.addEventListener("click", () => {
|
||||
const memo = document.getElementById("wfm-gallery-memo").value;
|
||||
saveMetaField({ memo }).then(() => showToast("Memo saved", "success"));
|
||||
saveMetaField({ memo }).then(() => showToast(t("memoSaved"), "success"));
|
||||
});
|
||||
|
||||
// ワークフローコピー
|
||||
document.getElementById("wfm-gallery-copy-workflow-btn")?.addEventListener("click", () => {
|
||||
if (!state.embeddedWorkflow) {
|
||||
showToast("No embedded workflow found.", "error");
|
||||
showToast(t("galleryNoEmbeddedWorkflow"), "error");
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(JSON.stringify(state.embeddedWorkflow, null, 2))
|
||||
.then(() => showToast("Workflow copied to clipboard!", "success"))
|
||||
.catch(() => showToast("Copy failed", "error"));
|
||||
.then(() => showToast(t("workflowCopied"), "success"))
|
||||
.catch(() => showToast(t("copyFailed"), "error"));
|
||||
});
|
||||
|
||||
// 一括操作バー
|
||||
@@ -1247,7 +1241,7 @@ function bindEvents() {
|
||||
if (sel && sel.value) {
|
||||
bulkAddToGroup(sel.value);
|
||||
} else {
|
||||
showToast("Please select a group", "error");
|
||||
showToast(t("selectGroupFirst"), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1294,7 +1288,7 @@ function bindEvents() {
|
||||
// Metadataボタン: 選択画像をMetadataタブで開く
|
||||
document.getElementById("wfm-gallery-open-metadata-btn")?.addEventListener("click", () => {
|
||||
if (!state.selectedImage) {
|
||||
showToast("Please select an image first", "error");
|
||||
showToast(t("gallerySelectImageFirst"), "error");
|
||||
return;
|
||||
}
|
||||
openImageInMetadataTab(state.selectedImage);
|
||||
@@ -1303,11 +1297,11 @@ function bindEvents() {
|
||||
// Load in GenerateUI ボタン: 埋め込みワークフローをGenerateUIタブに読み込む
|
||||
document.getElementById("wfm-gallery-load-genui-btn")?.addEventListener("click", async () => {
|
||||
if (!state.selectedImage) {
|
||||
showToast("Please select an image first", "error");
|
||||
showToast(t("gallerySelectImageFirst"), "error");
|
||||
return;
|
||||
}
|
||||
if (!state.embeddedWorkflow) {
|
||||
showToast("No ComfyUI workflow embedded in this image.", "warning");
|
||||
showToast(t("galleryNoEmbeddedWorkflow"), "warning");
|
||||
return;
|
||||
}
|
||||
const loaded = await loadWorkflowIntoEditor(state.embeddedWorkflow, state.selectedImage.filename);
|
||||
@@ -1316,7 +1310,7 @@ function bindEvents() {
|
||||
}
|
||||
});
|
||||
|
||||
// 詳細タブ切り替え(Metadataボタンはタブではないので除外)
|
||||
// 詳細タブ切り替え(data-detail-tab を持つボタンのみ対象。Metadata / Load GenUI はアクションボタン)
|
||||
document.querySelectorAll(".wfm-gallery-detail-tab-btn[data-detail-tab]").forEach(btn => {
|
||||
btn.addEventListener("click", () => {
|
||||
document.querySelectorAll(".wfm-gallery-detail-tab-btn[data-detail-tab]").forEach(b => b.classList.remove("active"));
|
||||
|
||||
+89
-60
@@ -9,21 +9,18 @@ import { comfyEditor } from "./comfyui-editor.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { syncJsonHighlight, syncScroll } from "./json-highlight.js";
|
||||
import { initFeederTab, refreshFeederNodeList } from "./feeder-tab.js";
|
||||
import { getSettings, readJsonStorage } from "./util.js";
|
||||
|
||||
// ============================================
|
||||
// Eagle Auto-Save
|
||||
// ============================================
|
||||
|
||||
function getEagleSettings() {
|
||||
try {
|
||||
const s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
return {
|
||||
url: s.eagleUrl || "http://localhost:41595",
|
||||
autoSave: !!s.eagleAutoSave,
|
||||
};
|
||||
} catch {
|
||||
return { url: "http://localhost:41595", autoSave: false };
|
||||
}
|
||||
const s = getSettings();
|
||||
return {
|
||||
url: s.eagleUrl || "http://localhost:41595",
|
||||
autoSave: !!s.eagleAutoSave,
|
||||
};
|
||||
}
|
||||
|
||||
async function saveToEagle(imageUrl, name, tags = []) {
|
||||
@@ -109,48 +106,77 @@ function updateStatus(connected) {
|
||||
|
||||
async function saveCurrentWorkflow() {
|
||||
if (!comfyUI.currentWorkflow) {
|
||||
showToast("No workflow loaded", "warning");
|
||||
showToast(t("noWorkflowLoaded"), "warning");
|
||||
return;
|
||||
}
|
||||
|
||||
const currentFilename = document.getElementById("wfm-gen-wf-name")?.dataset?.filename || "";
|
||||
const defaultStem = currentFilename.replace(/\.json$/, "") || "workflow";
|
||||
const defaultStem = currentFilename.replace(/\.(json|png|jpg|jpeg|webp|gif)$/i, "") || "workflow";
|
||||
|
||||
const html = `
|
||||
<div style="display:flex;flex-direction:column;gap:14px;min-width:300px;">
|
||||
<div>
|
||||
<label style="font-size:12px;color:var(--wfm-text-secondary);display:block;margin-bottom:4px;">Filename</label>
|
||||
<label style="font-size:12px;color:var(--wfm-text-secondary);display:block;margin-bottom:4px;">${t("filenameLabel")}</label>
|
||||
<div style="display:flex;align-items:center;gap:6px;">
|
||||
<input type="text" id="wfm-save-wf-name" class="wfm-input" value="${defaultStem}" style="flex:1;" placeholder="workflow name">
|
||||
<input type="text" id="wfm-save-wf-name" class="wfm-input" style="flex:1;" placeholder="workflow name">
|
||||
<span style="color:var(--wfm-text-secondary);font-size:13px;">.json</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;justify-content:flex-end;">
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-save-wf-cancel-btn">Cancel</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-save-wf-confirm-btn">Save</button>
|
||||
<button class="wfm-btn wfm-btn-sm" id="wfm-save-wf-cancel-btn">${t("cancel")}</button>
|
||||
<button class="wfm-btn wfm-btn-sm wfm-btn-primary" id="wfm-save-wf-confirm-btn">${t("save")}</button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
openModal("Save Workflow", html);
|
||||
openModal(t("saveWorkflowTitle"), html);
|
||||
|
||||
// 属性値に埋め込まず DOM 経由で初期値を設定(ファイル名中の引用符等によるHTML注入防止)
|
||||
const input = document.getElementById("wfm-save-wf-name");
|
||||
if (input) input.value = defaultStem;
|
||||
setTimeout(() => {
|
||||
const input = document.getElementById("wfm-save-wf-name");
|
||||
if (input) { input.focus(); input.select(); }
|
||||
}, 50);
|
||||
|
||||
document.getElementById("wfm-save-wf-cancel-btn")?.addEventListener("click", () => closeModal());
|
||||
|
||||
let saving = false;
|
||||
const doSave = async () => {
|
||||
const input = document.getElementById("wfm-save-wf-name");
|
||||
if (saving) return;
|
||||
const stem = input?.value?.trim();
|
||||
if (!stem) {
|
||||
showToast("Please enter a filename", "warning");
|
||||
showToast(t("pleaseEnterFilename"), "warning");
|
||||
return;
|
||||
}
|
||||
const filename = stem.endsWith(".json") ? stem : `${stem}.json`;
|
||||
saving = true;
|
||||
try {
|
||||
// Raw JSON に未適用の編集があれば保存対象に反映する
|
||||
let workflow = comfyUI.currentWorkflow;
|
||||
const rawText = document.getElementById("wfm-gen-raw-json")?.value ?? "";
|
||||
if (rawText.trim() && rawText !== JSON.stringify(workflow, null, 2)) {
|
||||
try {
|
||||
workflow = JSON.parse(rawText);
|
||||
} catch {
|
||||
showToast(t("rawJsonUnappliedInvalid"), "error");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 上書き確認(保存先がUI形式ならAPI形式化でレイアウトが失われる旨を警告)
|
||||
try {
|
||||
const listRes = await fetch("/api/wfm/workflows");
|
||||
const listData = await listRes.json();
|
||||
const existing = (Array.isArray(listData) ? listData : []).find(w => w.filename === filename);
|
||||
if (existing) {
|
||||
const msg = existing.analysis?.format === "ui"
|
||||
? t("uiFormatOverwriteWarn")
|
||||
: t("overwriteConfirm", filename);
|
||||
if (!confirm(msg)) return;
|
||||
}
|
||||
} catch { /* 一覧取得失敗時は確認をスキップして保存を続行 */ }
|
||||
|
||||
const blob = new Blob(
|
||||
[JSON.stringify(comfyUI.currentWorkflow, null, 2)],
|
||||
[JSON.stringify(workflow, null, 2)],
|
||||
{ type: "application/json" }
|
||||
);
|
||||
const file = new File([blob], filename, { type: "application/json" });
|
||||
@@ -160,23 +186,30 @@ async function saveCurrentWorkflow() {
|
||||
const data = await res.json();
|
||||
const ng = (data.results || []).filter(r => r.status === "error");
|
||||
if (ng.length) {
|
||||
showToast(`Save failed: ${ng[0].message || "unknown error"}`, "error");
|
||||
showToast(t("saveFailed", ng[0].message || "unknown error"), "error");
|
||||
return;
|
||||
}
|
||||
closeModal();
|
||||
const nameEl = document.getElementById("wfm-gen-wf-name");
|
||||
if (nameEl) {
|
||||
nameEl.textContent = filename;
|
||||
nameEl.dataset.filename = filename;
|
||||
if (workflow !== comfyUI.currentWorkflow) {
|
||||
// Raw JSON の編集を保存した場合はエディタにも反映して同期する
|
||||
await loadWorkflowIntoEditor(workflow, filename);
|
||||
} else {
|
||||
const nameEl = document.getElementById("wfm-gen-wf-name");
|
||||
if (nameEl) {
|
||||
nameEl.textContent = filename;
|
||||
nameEl.dataset.filename = filename;
|
||||
}
|
||||
}
|
||||
showToast(`Saved: ${filename}`, "success");
|
||||
showToast(t("savedAs", filename), "success");
|
||||
} catch (err) {
|
||||
showToast(`Save error: ${err.message}`, "error");
|
||||
showToast(t("saveFailed", err.message), "error");
|
||||
} finally {
|
||||
saving = false;
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById("wfm-save-wf-confirm-btn")?.addEventListener("click", doSave);
|
||||
document.getElementById("wfm-save-wf-name")?.addEventListener("keydown", (e) => {
|
||||
input?.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") doSave();
|
||||
});
|
||||
}
|
||||
@@ -195,7 +228,7 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
|
||||
} else if (format === "ui") {
|
||||
apiWorkflow = await comfyWorkflow.convertUiToApi(workflow);
|
||||
} else if (format === "unknown") {
|
||||
showToast("Unknown workflow format", "error");
|
||||
showToast(t("unknownWorkflowFormat"), "error");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -227,7 +260,7 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
|
||||
|
||||
refreshFeederNodeList();
|
||||
|
||||
showToast(`Workflow loaded: ${filename || ""}`, "success");
|
||||
showToast(t("workflowLoadedName", filename || ""), "success");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -884,9 +917,7 @@ async function _loadPromptGroupsForBatch() {
|
||||
const res = await fetch("/api/wfm/prompts");
|
||||
_batchGroupState.promptPresets = res.ok ? await res.json() : [];
|
||||
} catch { _batchGroupState.promptPresets = []; }
|
||||
try {
|
||||
_batchGroupState.promptGroups = JSON.parse(localStorage.getItem("wfm_prompt_preset_groups") || "{}");
|
||||
} catch { _batchGroupState.promptGroups = {}; }
|
||||
_batchGroupState.promptGroups = readJsonStorage("wfm_prompt_preset_groups");
|
||||
|
||||
const validIds = new Set(_batchGroupState.promptPresets.map((p) => p.id));
|
||||
for (const g of Object.keys(_batchGroupState.promptGroups)) {
|
||||
@@ -922,9 +953,7 @@ function _renderBatchPromptGroupList() {
|
||||
// Workflow グループ
|
||||
// ============================================
|
||||
function _loadWorkflowGroupsForBatch() {
|
||||
try {
|
||||
_batchGroupState.wfGroups = JSON.parse(localStorage.getItem("wfm_groups") || "{}");
|
||||
} catch { _batchGroupState.wfGroups = {}; }
|
||||
_batchGroupState.wfGroups = readJsonStorage("wfm_groups");
|
||||
|
||||
const currentNames = new Set(Object.keys(_batchGroupState.wfGroups));
|
||||
for (const name of _batchGroupState.wfSelectedGroups) {
|
||||
@@ -1235,7 +1264,7 @@ async function _coreGenerate(silent = false) {
|
||||
saveGeneratedImagesMeta(images, { ...comfyUI.currentWorkflow }).catch(() => {});
|
||||
}
|
||||
|
||||
if (!silent) showToast("Generation complete", "success");
|
||||
if (!silent) showToast(t("generationComplete"), "success");
|
||||
}
|
||||
|
||||
// ============================================
|
||||
@@ -1283,7 +1312,7 @@ async function _runBatchLoop(items, applyFn, labelFn = (x) => String(x)) {
|
||||
} catch (err) {
|
||||
if (_ckptBatch.aborted) break;
|
||||
failed++;
|
||||
showToast(`[${i + 1}/${items.length}] Failed: ${err.message}`, "error");
|
||||
showToast(t("batchItemFailed", i + 1, items.length, err.message), "error");
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -1301,7 +1330,7 @@ async function _runBatchLoop(items, applyFn, labelFn = (x) => String(x)) {
|
||||
if (batchCurrentName) batchCurrentName.textContent = _ckptBatch.aborted ? "Stopped" : "Done";
|
||||
|
||||
if (_ckptBatch.aborted) {
|
||||
showToast(`Batch stopped — ${completed} completed, ${failed} failed`, "info");
|
||||
showToast(t("batchStopped", completed, failed), "info");
|
||||
} else {
|
||||
showToast(
|
||||
`Batch complete: ${completed}/${items.length}${failed > 0 ? ` (${failed} failed)` : ""}`,
|
||||
@@ -1315,9 +1344,9 @@ async function _runBatchGenerate() {
|
||||
switch (_activeBatchType) {
|
||||
case "checkpoint": {
|
||||
const ckptNodes = comfyUI.currentAnalysis?.checkpoint_nodes || [];
|
||||
if (ckptNodes.length === 0) { showToast("No checkpoint node found in workflow", "error"); return; }
|
||||
if (ckptNodes.length === 0) { showToast(t("modelsGenUINoNode", "checkpoint"), "error"); return; }
|
||||
const list = _getSelectedCheckpoints();
|
||||
if (list.length === 0) { showToast("No checkpoints selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "checkpoints"), "error"); return; }
|
||||
await _runBatchLoop(list, (model) => {
|
||||
for (const node of ckptNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
@@ -1328,9 +1357,9 @@ async function _runBatchGenerate() {
|
||||
}
|
||||
case "lora": {
|
||||
const loraNodes = comfyUI.currentAnalysis?.lora_nodes || [];
|
||||
if (loraNodes.length === 0) { showToast("No LoRA node found in workflow", "error"); return; }
|
||||
if (loraNodes.length === 0) { showToast(t("modelsGenUINoNode", "LoRA"), "error"); return; }
|
||||
const list = [..._getSelectedLoraGroupItems()];
|
||||
if (list.length === 0) { showToast("No LoRAs selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "LoRAs"), "error"); return; }
|
||||
await _runBatchLoop(list, (loraName) => {
|
||||
for (const node of loraNodes) {
|
||||
if (!comfyUI.currentWorkflow?.[node.id]) continue;
|
||||
@@ -1351,11 +1380,11 @@ async function _runBatchGenerate() {
|
||||
const positiveNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "positive");
|
||||
const negativeNodes = (comfyUI.currentAnalysis?.prompt_nodes || []).filter((n) => n.role === "negative");
|
||||
if (positiveNodes.length === 0 && negativeNodes.length === 0) {
|
||||
showToast("No prompt node found in workflow", "error"); return;
|
||||
showToast(t("modelsGenUINoNode", "prompt"), "error"); return;
|
||||
}
|
||||
// _getSelectedPromptGroupItems() はすでにプリセットオブジェクトの配列を返す
|
||||
const list = _getSelectedPromptGroupItems();
|
||||
if (list.length === 0) { showToast("No prompts selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "prompts"), "error"); return; }
|
||||
await _runBatchLoop(list, (preset) => {
|
||||
for (const node of positiveNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
@@ -1370,7 +1399,7 @@ async function _runBatchGenerate() {
|
||||
}
|
||||
case "workflow": {
|
||||
const list = [..._getSelectedWfGroupItems()];
|
||||
if (list.length === 0) { showToast("No workflows selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "workflows"), "error"); return; }
|
||||
const savedWorkflow = comfyUI.currentWorkflow ? JSON.stringify(comfyUI.currentWorkflow) : null;
|
||||
const savedFilename = document.getElementById("wfm-gen-workflow-name")?.textContent || "";
|
||||
try {
|
||||
@@ -1389,9 +1418,9 @@ async function _runBatchGenerate() {
|
||||
}
|
||||
case "sampler": {
|
||||
const samplerNodes = comfyUI.currentAnalysis?.sampler_nodes || [];
|
||||
if (samplerNodes.length === 0) { showToast("No KSampler node found in workflow", "error"); return; }
|
||||
if (samplerNodes.length === 0) { showToast(t("modelsGenUINoNode", "KSampler"), "error"); return; }
|
||||
const list = [..._samplerSelected].sort();
|
||||
if (list.length === 0) { showToast("No samplers selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "samplers"), "error"); return; }
|
||||
await _runBatchLoop(list, (samplerName) => {
|
||||
for (const node of samplerNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
@@ -1402,9 +1431,9 @@ async function _runBatchGenerate() {
|
||||
}
|
||||
case "scheduler": {
|
||||
const samplerNodes = comfyUI.currentAnalysis?.sampler_nodes || [];
|
||||
if (samplerNodes.length === 0) { showToast("No KSampler node found in workflow", "error"); return; }
|
||||
if (samplerNodes.length === 0) { showToast(t("modelsGenUINoNode", "KSampler"), "error"); return; }
|
||||
const list = [..._schedulerSelected].sort();
|
||||
if (list.length === 0) { showToast("No schedulers selected", "error"); return; }
|
||||
if (list.length === 0) { showToast(t("batchNoneSelected", "schedulers"), "error"); return; }
|
||||
await _runBatchLoop(list, (schedulerName) => {
|
||||
for (const node of samplerNodes) {
|
||||
if (comfyUI.currentWorkflow?.[node.id])
|
||||
@@ -1422,7 +1451,7 @@ async function _runBatchGenerate() {
|
||||
|
||||
async function handleGenerate() {
|
||||
if (!comfyUI.currentWorkflow) {
|
||||
showToast("No workflow loaded", "error");
|
||||
showToast(t("noWorkflowLoaded"), "error");
|
||||
return;
|
||||
}
|
||||
if (comfyUI.generating) return;
|
||||
@@ -1449,7 +1478,7 @@ async function handleGenerate() {
|
||||
} catch (err) {
|
||||
const progressText = document.getElementById("wfm-gen-progress-text");
|
||||
if (progressText) progressText.textContent = "Error";
|
||||
showToast("Generation error: " + err.message, "error");
|
||||
showToast(t("generationError", err.message), "error");
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -1472,9 +1501,9 @@ export async function initGenerateTab() {
|
||||
updateStatus(connected);
|
||||
if (connected) {
|
||||
await comfyEditor.loadModelLists();
|
||||
showToast("Connected to ComfyUI", "success");
|
||||
showToast(t("connectedToComfyUI"), "success");
|
||||
} else {
|
||||
showToast("Failed to connect", "error");
|
||||
showToast(t("failedToConnect"), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1484,7 +1513,7 @@ export async function initGenerateTab() {
|
||||
if (comfyUI.currentAnalysis) {
|
||||
comfyEditor.renderAll(comfyUI.currentAnalysis, comfyUI.currentWorkflow);
|
||||
}
|
||||
showToast("Model lists refreshed", "success");
|
||||
showToast(t("modelListsRefreshed"), "success");
|
||||
_rebuildSamplerList();
|
||||
_rebuildSchedulerList();
|
||||
_renderBatchPreview();
|
||||
@@ -1496,7 +1525,7 @@ export async function initGenerateTab() {
|
||||
document.getElementById("wfm-gen-reset-workflow-btn")?.addEventListener("click", async () => {
|
||||
const filename = document.getElementById("wfm-gen-wf-name")?.dataset?.filename;
|
||||
if (!filename || !filename.endsWith(".json")) {
|
||||
showToast("No file-based workflow loaded", "warning");
|
||||
showToast(t("noFileWorkflowLoaded"), "warning");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -1505,7 +1534,7 @@ export async function initGenerateTab() {
|
||||
const data = await resp.json();
|
||||
await loadWorkflowIntoEditor(data, filename);
|
||||
} catch (err) {
|
||||
showToast("Reset failed: " + err.message, "error");
|
||||
showToast(t("resetFailed", err.message), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1522,7 +1551,7 @@ export async function initGenerateTab() {
|
||||
_ckptBatch._resumeResolve = null;
|
||||
}
|
||||
await comfyUI.interrupt();
|
||||
showToast("Interrupted", "info");
|
||||
showToast(t("interrupted"), "info");
|
||||
});
|
||||
|
||||
// Move shared Raw JSON widget into the active tab's rawjson-col
|
||||
@@ -1585,7 +1614,7 @@ export async function initGenerateTab() {
|
||||
const wf = JSON.parse(textarea.value);
|
||||
await loadWorkflowIntoEditor(wf, "Raw JSON");
|
||||
} catch (err) {
|
||||
showToast("Invalid JSON: " + err.message, "error");
|
||||
showToast(t("invalidJsonMsg", err.message), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1740,7 +1769,7 @@ export async function initGenerateTab() {
|
||||
// Auto-load default workflow (doesn't require ComfyUI connection)
|
||||
if (!comfyUI.currentWorkflow) {
|
||||
try {
|
||||
const settings = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
const settings = getSettings();
|
||||
if (settings.defaultWorkflow && settings.defaultWorkflowData) {
|
||||
await loadWorkflowIntoEditor(settings.defaultWorkflowData, settings.defaultWorkflow);
|
||||
console.log("Workflow Studio: Auto-loaded default workflow:", settings.defaultWorkflow);
|
||||
|
||||
+294
-20
@@ -3,6 +3,8 @@
|
||||
* Provides UI text translations and summary prompt templates.
|
||||
*/
|
||||
|
||||
import { getSettings } from "./util.js";
|
||||
|
||||
const LANGUAGES = {
|
||||
en: {
|
||||
// -- General --
|
||||
@@ -135,6 +137,93 @@ const LANGUAGES = {
|
||||
increment: "Increment",
|
||||
decrement: "Decrement",
|
||||
|
||||
// -- GenerateUI: workflow save --
|
||||
saveWorkflowTitle: "Save Workflow",
|
||||
filenameLabel: "Filename",
|
||||
pleaseEnterFilename: "Please enter a filename",
|
||||
saveFailed: (msg) => msg ? `Save failed: ${msg}` : "Save failed",
|
||||
savedAs: (f) => `Saved: ${f}`,
|
||||
overwriteConfirm: (f) => `"${f}" already exists. Overwrite?`,
|
||||
uiFormatOverwriteWarn: "The original file is in UI format. Saving will overwrite it in API format, and the node layout will be lost. Continue?",
|
||||
rawJsonUnappliedInvalid: "Raw JSON has unapplied edits but is not valid JSON. Apply or fix it before saving.",
|
||||
|
||||
// -- Toast messages (shared) --
|
||||
errorWithMsg: (msg) => `Error: ${msg}`,
|
||||
errorsList: (msgs) => `Errors: ${msgs}`,
|
||||
copyFailed: "Copy failed",
|
||||
workflowCopied: "Workflow copied to clipboard!",
|
||||
memoSaved: "Memo saved",
|
||||
refreshed: "Refreshed",
|
||||
deleteFailed: (msg) => msg ? `Delete failed: ${msg}` : "Delete failed",
|
||||
deletedName: (name) => `Deleted: ${name}`,
|
||||
renameFailed: "Rename failed",
|
||||
renamedTo: (name) => `Renamed to "${name}"`,
|
||||
importErrorMsg: (msg) => `Import error: ${msg}`,
|
||||
importedViaDrop: (n) => `${n} file(s) imported via drag & drop`,
|
||||
nameAlreadyExists: (name) => `"${name}" already exists`,
|
||||
languageChanged: "Language changed. Reloading...",
|
||||
groupExists: "Group already exists",
|
||||
groupNameExists: "Group name already exists",
|
||||
groupCreated: (name) => `Group "${name}" created`,
|
||||
groupDeleted: (name) => `Group "${name}" deleted`,
|
||||
addedToGroup: "Added to group",
|
||||
addedToGroupName: (g) => `Added to "${g}"`,
|
||||
removedFromGroupName: (g) => `Removed from "${g}"`,
|
||||
alreadyInGroup: "Already in this group",
|
||||
selectGroupFirst: "Select a group first",
|
||||
selectPresetFirst: "Select a preset first",
|
||||
feederNoNode: "No ImageFeeder node selected",
|
||||
appliedToWorkflow: "Applied to workflow",
|
||||
notConnectedToComfyUI: "Not connected to ComfyUI",
|
||||
wsConnectionFailed: "WebSocket connection failed",
|
||||
feederRunError: (msg) => `Feeder run error: ${msg}`,
|
||||
feederStopped: "Feeder stopped",
|
||||
feederComplete: (n) => `Feeder complete (${n} generated)`,
|
||||
presetSavedName: (name) => `Preset saved: ${name}`,
|
||||
presetLoaded: (name) => `Preset loaded: ${name}`,
|
||||
presetDeleted: (name) => `Preset deleted: ${name}`,
|
||||
selectParentFolderFirst: "Please select a parent folder first",
|
||||
folderDeleted: "Folder deleted",
|
||||
folderCreated: (name) => `Folder "${name}" created`,
|
||||
noOtherFolders: "No other folders available. Create a subfolder first.",
|
||||
deletedNImages: (n) => `Deleted ${n} image(s)`,
|
||||
movedNImages: (n) => `Moved ${n} image(s)`,
|
||||
addedNImagesToGroup: (n, g) => `Added ${n} image(s) to "${g}"`,
|
||||
favoritedNImages: (n) => `Favorited ${n} image(s)`,
|
||||
unfavoritedNImages: (n) => `Unfavorited ${n} image(s)`,
|
||||
unknownWorkflowFormat: "Unknown workflow format",
|
||||
generationComplete: "Generation complete",
|
||||
generationError: (msg) => `Generation error: ${msg}`,
|
||||
batchNoneSelected: (what) => `No ${what} selected`,
|
||||
batchItemFailed: (i, total, msg) => `[${i}/${total}] Failed: ${msg}`,
|
||||
batchStopped: (completed, failed) => `Batch stopped — ${completed} completed, ${failed} failed`,
|
||||
connectedToComfyUI: "Connected to ComfyUI",
|
||||
failedToConnect: "Failed to connect",
|
||||
modelListsRefreshed: "Model lists refreshed",
|
||||
noFileWorkflowLoaded: "No file-based workflow loaded",
|
||||
resetFailed: (msg) => `Reset failed: ${msg}`,
|
||||
interrupted: "Interrupted",
|
||||
invalidJsonMsg: (msg) => `Invalid JSON: ${msg}`,
|
||||
workflowLoadedName: (name) => `Workflow loaded: ${name}`,
|
||||
stackCleared: "Stack cleared",
|
||||
enterPositiveInt: "Enter a positive integer",
|
||||
sentToPositive: "Sent to Positive Prompt",
|
||||
sentToNegative: "Sent to Negative Prompt",
|
||||
invalidPathFormat: "Invalid path. Use folder/name format, each part: letters, numbers, -, _, . only",
|
||||
|
||||
// -- Settings: text size & JSON colors --
|
||||
textSizeLabel: "Text Size",
|
||||
textSizeTextarea: "Prompt / Chat Textarea",
|
||||
textSizeHint: "Applies to: Generate UI prompts, AI Assistant chat, Preset prompts, Wildcard textarea, Metadata prompt preview",
|
||||
jsonColorsSection: "RAW JSON Colors",
|
||||
jsonColorBase: "Base text",
|
||||
jsonColorYellow: "Names / Scheduler",
|
||||
jsonColorPink: "Titles",
|
||||
jsonColorGreen: "Width / Height",
|
||||
jsonColorCyan: "Prompts / Text",
|
||||
jsonColorRed: "Images / Files",
|
||||
jsonColorReset: "Reset to defaults",
|
||||
|
||||
// -- Prompt tab --
|
||||
tabPrompt: "Prompt",
|
||||
you: "You",
|
||||
@@ -365,6 +454,8 @@ const LANGUAGES = {
|
||||
galleryOutputDir: "Gallery Output Folder",
|
||||
galleryOutputDirLabel: "Output Folder Path",
|
||||
galleryOutputDirHint: "Set the ComfyUI output folder to browse in the Gallery tab. Leave blank to use ComfyUI's default output directory.",
|
||||
gallerySelectImageFirst: "Please select an image first",
|
||||
galleryNoEmbeddedWorkflow: "No ComfyUI workflow embedded in this image.",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
@@ -427,7 +518,7 @@ const LANGUAGES = {
|
||||
helpWf6: "Detail modal: rename, favorite, thumbnail change, badge assignment, tags, memo, AI summary, open in ComfyUI, load in GenerateUI, set as default, delete",
|
||||
helpWf7: "Badge management: add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)",
|
||||
helpGen1: "Connect/disconnect ComfyUI and check connection status",
|
||||
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported)",
|
||||
helpGen2: "Load workflows from Workflow tab (App format .app.json not supported); Reset Workflow button re-reads the current workflow file from disk and reloads the editor; Save button (right end of the tab bar) saves the current workflow — including any edits made in the editor — as a new .json file to the Workflow tab; a filename dialog appears with the current workflow name as the default",
|
||||
helpGen3: "5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
|
||||
helpGen4: "Input tab: Prompt (top) and Image drag-and-drop (bottom) in the left column",
|
||||
helpGen5: "Model tab: Checkpoint, VAE, LoRA (Single/Stack tabs), ControlNet, UNET, TextEncoder selectors with filter",
|
||||
@@ -481,7 +572,7 @@ const LANGUAGES = {
|
||||
helpNodes5: "Side panel: Details (class name, package, category, description, flags), I/O Spec (inputs/outputs with types and defaults), Groups management",
|
||||
helpNodes6: "Node Sets: create reusable node collections with descriptions, tags, and link definitions between nodes",
|
||||
helpModels1: "Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching",
|
||||
helpModels2: "Thumbnail and Table view modes with pagination",
|
||||
helpModels2: "Thumbnail and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension; column headers are clickable to sort — click once for ascending (▲), again for descending (▼), a third time to clear the sort; the E/D column sorts by enable/disable status",
|
||||
helpModels3: "Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)",
|
||||
helpModels4: "Side panel: Info (file path, tags, memo), Groups management, CivitAI integration",
|
||||
helpModels5: "CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type; preview image is automatically downloaded and saved if none exists",
|
||||
@@ -500,10 +591,12 @@ const LANGUAGES = {
|
||||
helpGallery5: "Folder tree: click to load images, expand with ▶; '+ New' creates a subfolder inside the selected folder, 'Del' deletes it with all contents",
|
||||
helpGallery6: "Multi-select with Ctrl+click — bulk operations: Add to Group, Favorite All, Unfavorite All, Move To..., Delete",
|
||||
helpGallery7: "Detail panel — Info tab: filename, size, date, tags (add/remove), memo; 'Move To...' moves the image to another folder, 'Delete' removes it permanently",
|
||||
helpGallery8: "Detail panel — Metadata tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy",
|
||||
helpGallery8: "Detail panel — JSON tab: displays workflow JSON from PNG embedded data (prompt / workflow keys) or from metadata saved by the Generate UI tab; one-click clipboard copy",
|
||||
helpGallery9: "Detail panel — Groups tab: create, assign, remove, rename, and delete groups per image",
|
||||
helpGallery10: "Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the Metadata tab",
|
||||
helpGallery10: "Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the JSON tab",
|
||||
helpGallery11: "Supports PNG (tEXt/iTXt), JPEG, WebP, GIF; workflow extraction reads ComfyUI prompt and workflow keys embedded in PNG metadata",
|
||||
helpGallery12: "Metadata button (green, in the detail panel tab bar): opens the selected image in the Metadata tab for full embedded-data inspection; Alt+click on any image thumbnail has the same effect",
|
||||
helpGallery13: "Load GenUI button (blue, in the detail panel tab bar): loads the embedded ComfyUI workflow from the selected image directly into the GenerateUI tab and switches to it; shows a warning toast if no workflow is embedded or the format is not supported",
|
||||
helpSidepanelTitle: "Workflow Studio Library (ComfyUI Side Panel)",
|
||||
helpSidepanel1: "Open from the Workflow Studio Library button in the ComfyUI toolbar",
|
||||
helpSidepanel2: "Workflows tab: All / ★ Favorites / Groups sub-tabs; ★ shown for favorites in All view",
|
||||
@@ -814,6 +907,93 @@ const LANGUAGES = {
|
||||
increment: "増加",
|
||||
decrement: "減少",
|
||||
|
||||
// -- GenerateUI: workflow save --
|
||||
saveWorkflowTitle: "ワークフローを保存",
|
||||
filenameLabel: "ファイル名",
|
||||
pleaseEnterFilename: "ファイル名を入力してください",
|
||||
saveFailed: (msg) => msg ? `保存に失敗しました: ${msg}` : "保存に失敗しました",
|
||||
savedAs: (f) => `保存しました: ${f}`,
|
||||
overwriteConfirm: (f) => `「${f}」は既に存在します。上書きしますか?`,
|
||||
uiFormatOverwriteWarn: "元のファイルはUI形式です。API形式で上書きするとノード配置などのグラフ情報が失われます。続行しますか?",
|
||||
rawJsonUnappliedInvalid: "Raw JSONに未適用の編集がありますが、JSONとして不正です。適用または修正してから保存してください。",
|
||||
|
||||
// -- Toast messages (shared) --
|
||||
errorWithMsg: (msg) => `エラー: ${msg}`,
|
||||
errorsList: (msgs) => `エラー: ${msgs}`,
|
||||
copyFailed: "コピーに失敗しました",
|
||||
workflowCopied: "ワークフローをクリップボードにコピーしました",
|
||||
memoSaved: "メモを保存しました",
|
||||
refreshed: "更新しました",
|
||||
deleteFailed: (msg) => msg ? `削除に失敗しました: ${msg}` : "削除に失敗しました",
|
||||
deletedName: (name) => `削除しました: ${name}`,
|
||||
renameFailed: "リネームに失敗しました",
|
||||
renamedTo: (name) => `「${name}」にリネームしました`,
|
||||
importErrorMsg: (msg) => `インポートエラー: ${msg}`,
|
||||
importedViaDrop: (n) => `ドラッグ&ドロップで${n}件のファイルをインポートしました`,
|
||||
nameAlreadyExists: (name) => `「${name}」は既に存在します`,
|
||||
languageChanged: "言語を変更しました。再読み込みします...",
|
||||
groupExists: "グループは既に存在します",
|
||||
groupNameExists: "同名のグループが既に存在します",
|
||||
groupCreated: (name) => `グループ「${name}」を作成しました`,
|
||||
groupDeleted: (name) => `グループ「${name}」を削除しました`,
|
||||
addedToGroup: "グループに追加しました",
|
||||
addedToGroupName: (g) => `「${g}」に追加しました`,
|
||||
removedFromGroupName: (g) => `「${g}」から削除しました`,
|
||||
alreadyInGroup: "既にこのグループに含まれています",
|
||||
selectGroupFirst: "先にグループを選択してください",
|
||||
selectPresetFirst: "先にプリセットを選択してください",
|
||||
feederNoNode: "ImageFeederノードが選択されていません",
|
||||
appliedToWorkflow: "ワークフローに適用しました",
|
||||
notConnectedToComfyUI: "ComfyUIに接続されていません",
|
||||
wsConnectionFailed: "WebSocket接続に失敗しました",
|
||||
feederRunError: (msg) => `Feeder実行エラー: ${msg}`,
|
||||
feederStopped: "Feederを停止しました",
|
||||
feederComplete: (n) => `Feeder完了(${n}枚生成)`,
|
||||
presetSavedName: (name) => `プリセットを保存しました: ${name}`,
|
||||
presetLoaded: (name) => `プリセットを読み込みました: ${name}`,
|
||||
presetDeleted: (name) => `プリセットを削除しました: ${name}`,
|
||||
selectParentFolderFirst: "先に親フォルダを選択してください",
|
||||
folderDeleted: "フォルダを削除しました",
|
||||
folderCreated: (name) => `フォルダ「${name}」を作成しました`,
|
||||
noOtherFolders: "移動先フォルダがありません。先にサブフォルダを作成してください。",
|
||||
deletedNImages: (n) => `${n}件の画像を削除しました`,
|
||||
movedNImages: (n) => `${n}件の画像を移動しました`,
|
||||
addedNImagesToGroup: (n, g) => `${n}件の画像を「${g}」に追加しました`,
|
||||
favoritedNImages: (n) => `${n}件をお気に入りに追加しました`,
|
||||
unfavoritedNImages: (n) => `${n}件をお気に入りから外しました`,
|
||||
unknownWorkflowFormat: "不明なワークフロー形式です",
|
||||
generationComplete: "生成が完了しました",
|
||||
generationError: (msg) => `生成エラー: ${msg}`,
|
||||
batchNoneSelected: (what) => `${what}が選択されていません`,
|
||||
batchItemFailed: (i, total, msg) => `[${i}/${total}] 失敗: ${msg}`,
|
||||
batchStopped: (completed, failed) => `バッチ停止 — 完了${completed}件、失敗${failed}件`,
|
||||
connectedToComfyUI: "ComfyUIに接続しました",
|
||||
failedToConnect: "接続に失敗しました",
|
||||
modelListsRefreshed: "モデルリストを更新しました",
|
||||
noFileWorkflowLoaded: "ファイルベースのワークフローが読み込まれていません",
|
||||
resetFailed: (msg) => `リセットに失敗しました: ${msg}`,
|
||||
interrupted: "中断しました",
|
||||
invalidJsonMsg: (msg) => `不正なJSON: ${msg}`,
|
||||
workflowLoadedName: (name) => `ワークフローを読み込みました: ${name}`,
|
||||
stackCleared: "スタックをクリアしました",
|
||||
enterPositiveInt: "正の整数を入力してください",
|
||||
sentToPositive: "ポジティブプロンプトに送信しました",
|
||||
sentToNegative: "ネガティブプロンプトに送信しました",
|
||||
invalidPathFormat: "不正なパスです。folder/name形式で、各部分は英数字・-・_・.のみ使用できます",
|
||||
|
||||
// -- Settings: text size & JSON colors --
|
||||
textSizeLabel: "文字サイズ",
|
||||
textSizeTextarea: "プロンプト / チャット入力欄",
|
||||
textSizeHint: "適用対象: 生成UIプロンプト、AIアシスタントチャット、プリセットプロンプト、ワイルドカード編集、Metadataプロンプトプレビュー",
|
||||
jsonColorsSection: "RAW JSON 文字色",
|
||||
jsonColorBase: "通常テキスト",
|
||||
jsonColorYellow: "名前 / スケジューラ",
|
||||
jsonColorPink: "タイトル",
|
||||
jsonColorGreen: "Width / Height",
|
||||
jsonColorCyan: "プロンプト / テキスト",
|
||||
jsonColorRed: "画像 / ファイル",
|
||||
jsonColorReset: "デフォルトに戻す",
|
||||
|
||||
// -- Prompt tab --
|
||||
tabPrompt: "プロンプト",
|
||||
you: "あなた",
|
||||
@@ -1044,6 +1224,8 @@ const LANGUAGES = {
|
||||
galleryOutputDir: "ギャラリー Outputフォルダ",
|
||||
galleryOutputDirLabel: "Outputフォルダのパス",
|
||||
galleryOutputDirHint: "ギャラリータブで参照するComfyUIのoutputフォルダを設定します。空欄の場合はComfyUIのデフォルトoutputディレクトリを使用します。",
|
||||
gallerySelectImageFirst: "先に画像を選択してください",
|
||||
galleryNoEmbeddedWorkflow: "この画像にはComfyUIワークフローが埋め込まれていません。",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
@@ -1106,7 +1288,7 @@ const LANGUAGES = {
|
||||
helpWf6: "詳細モーダル:名前変更、お気に入り、サムネイル変更、バッジ付与、タグ、メモ、AI要約、ComfyUIで開く、生成UIに読み込み、デフォルト設定、削除",
|
||||
helpWf7: "バッジ管理:バッジの追加・名前変更・削除、カスタム色設定(Modelsタブと共有)— ⚙ Badgeボタン",
|
||||
helpGen1: "ComfyUIの接続・切断、接続状態の確認",
|
||||
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)",
|
||||
helpGen2: "Workflowタブからワークフローを読み込み(App形式 .app.json は非対応)。Reset Workflowボタンは現在のワークフローファイルをディスクから再読込してエディタをリロード。Saveボタン(タブバー右端)はエディタでの編集を含む現在のワークフローを新しい.jsonファイルとしてWorkflowタブに保存(現在のワークフロー名を初期値としたファイル名ダイアログを表示)",
|
||||
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
|
||||
helpGen4: "Inputタブ:左列にPrompt(上段)+ Image ドラッグ&ドロップ(下段)",
|
||||
helpGen5: "Modelタブ:Checkpoint/VAE/LoRA(Single/Stackタブ)/ControlNet/UNET/TextEncoderのセレクタ(フィルタ検索付き)",
|
||||
@@ -1160,7 +1342,7 @@ const LANGUAGES = {
|
||||
helpNodes5: "サイドパネル:詳細(クラス名、パッケージ、カテゴリ、説明、フラグ)、I/O仕様(入出力の型・デフォルト値)、グループ管理",
|
||||
helpNodes6: "ノードセット:再利用可能なノードコレクションの作成(説明、タグ、ノード間リンク定義付き)",
|
||||
helpModels1: "インストール済みモデルの閲覧:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embeddingをサブタブで切り替え",
|
||||
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)",
|
||||
helpModels2: "サムネイル / テーブル表示モード切り替え(ページネーション付き)。テーブル表示ではファイル名・サブフォルダ・拡張子に加えCivitAI由来のType / Base Model列を表示。列ヘッダーをクリックでソート — 1回で昇順(▲)、2回で降順(▼)、3回でソート解除。E/D列は有効/無効状態でソート",
|
||||
helpModels3: "検索、タグフィルタ、グループフィルタ、お気に入りフィルタ、ステータスフィルタ(すべて / 有効のみ / 無効のみ)",
|
||||
helpModels4: "サイドパネル:基本情報(ファイルパス、タグ、メモ)、グループ管理、CivitAI連携",
|
||||
helpModels5: "CivitAI連携:SHA256ハッシュでモデル情報取得、モデルタイプごとの一括取得;プレビュー画像がない場合は自動でダウンロード・保存",
|
||||
@@ -1179,10 +1361,12 @@ const LANGUAGES = {
|
||||
helpGallery5: "フォルダツリー:クリックで画像を読み込み;▶で展開;「+ New」で選択フォルダ内にサブフォルダを作成;「Del」でそのフォルダとすべての内容を削除",
|
||||
helpGallery6: "Ctrl+クリックで複数選択 — 一括操作:グループへ追加、一括お気に入り、一括お気に入り解除、移動(Move To...)、削除",
|
||||
helpGallery7: "詳細パネル — Infoタブ:ファイル名、サイズ、日付、タグ(追加/削除)、メモ;「Move To...」で他フォルダへ移動;「Delete」で完全削除",
|
||||
helpGallery8: "詳細パネル — Metadataタブ:PNGの埋め込みデータ(prompt / workflow キー)またはGenerateUIタブで保存したメタデータからワークフローJSONを表示;ワンクリックでクリップボードコピー",
|
||||
helpGallery8: "詳細パネル — JSONタブ:PNGの埋め込みデータ(prompt / workflow キー)またはGenerateUIタブで保存したメタデータからワークフローJSONを表示;ワンクリックでクリップボードコピー",
|
||||
helpGallery9: "詳細パネル — Groupsタブ:画像ごとのグループ作成、割り当て、解除、名前変更、削除",
|
||||
helpGallery10: "ワークフロー自動保存:GenerateUIタブで生成した画像はワークフローが自動でギャラリーメタデータに保存され、Metadataタブで確認可能",
|
||||
helpGallery10: "ワークフロー自動保存:GenerateUIタブで生成した画像はワークフローが自動でギャラリーメタデータに保存され、JSONタブで確認可能",
|
||||
helpGallery11: "PNG (tEXt/iTXt)、JPEG、WebP、GIF対応;PNG形式はComfyUIの埋め込みJSON(prompt / workflow キー)を読み込んでワークフロー抽出が可能",
|
||||
helpGallery12: "Metadataボタン(緑、詳細パネルのタブバー内):選択画像をMetadataタブで開いて埋め込みデータを詳細確認。画像サムネイルのAlt+クリックでも同じ操作が可能",
|
||||
helpGallery13: "Load GenUIボタン(青、詳細パネルのタブバー内):選択画像に埋め込まれたComfyUIワークフローをGenerateUIタブへ直接読み込んで切り替え。ワークフローが埋め込まれていない場合や非対応形式の場合は警告トーストを表示",
|
||||
helpSidepanelTitle: "Workflow Studio Library(ComfyUIサイドパネル)",
|
||||
helpSidepanel1: "ComfyUIツールバーのWorkflow Studio Libraryボタンから開く",
|
||||
helpSidepanel2: "Workflowsタブ:All / ★ Favorites / Groupsサブタブ、Allビューでお気に入りに★表示",
|
||||
@@ -1493,6 +1677,93 @@ const LANGUAGES = {
|
||||
increment: "递增",
|
||||
decrement: "递减",
|
||||
|
||||
// -- GenerateUI: workflow save --
|
||||
saveWorkflowTitle: "保存工作流",
|
||||
filenameLabel: "文件名",
|
||||
pleaseEnterFilename: "请输入文件名",
|
||||
saveFailed: (msg) => msg ? `保存失败: ${msg}` : "保存失败",
|
||||
savedAs: (f) => `已保存: ${f}`,
|
||||
overwriteConfirm: (f) => `「${f}」已存在。要覆盖吗?`,
|
||||
uiFormatOverwriteWarn: "原文件为UI格式。保存将以API格式覆盖,节点布局等信息将丢失。要继续吗?",
|
||||
rawJsonUnappliedInvalid: "Raw JSON有未应用的编辑,但不是有效的JSON。请先应用或修正后再保存。",
|
||||
|
||||
// -- Toast messages (shared) --
|
||||
errorWithMsg: (msg) => `错误: ${msg}`,
|
||||
errorsList: (msgs) => `错误: ${msgs}`,
|
||||
copyFailed: "复制失败",
|
||||
workflowCopied: "工作流已复制到剪贴板",
|
||||
memoSaved: "备注已保存",
|
||||
refreshed: "已刷新",
|
||||
deleteFailed: (msg) => msg ? `删除失败: ${msg}` : "删除失败",
|
||||
deletedName: (name) => `已删除: ${name}`,
|
||||
renameFailed: "重命名失败",
|
||||
renamedTo: (name) => `已重命名为「${name}」`,
|
||||
importErrorMsg: (msg) => `导入错误: ${msg}`,
|
||||
importedViaDrop: (n) => `已通过拖放导入${n}个文件`,
|
||||
nameAlreadyExists: (name) => `「${name}」已存在`,
|
||||
languageChanged: "语言已更改。正在重新加载...",
|
||||
groupExists: "分组已存在",
|
||||
groupNameExists: "同名分组已存在",
|
||||
groupCreated: (name) => `已创建分组「${name}」`,
|
||||
groupDeleted: (name) => `已删除分组「${name}」`,
|
||||
addedToGroup: "已添加到分组",
|
||||
addedToGroupName: (g) => `已添加到「${g}」`,
|
||||
removedFromGroupName: (g) => `已从「${g}」中移除`,
|
||||
alreadyInGroup: "已在此分组中",
|
||||
selectGroupFirst: "请先选择分组",
|
||||
selectPresetFirst: "请先选择预设",
|
||||
feederNoNode: "未选择ImageFeeder节点",
|
||||
appliedToWorkflow: "已应用到工作流",
|
||||
notConnectedToComfyUI: "未连接到ComfyUI",
|
||||
wsConnectionFailed: "WebSocket连接失败",
|
||||
feederRunError: (msg) => `Feeder运行错误: ${msg}`,
|
||||
feederStopped: "Feeder已停止",
|
||||
feederComplete: (n) => `Feeder完成(已生成${n}张)`,
|
||||
presetSavedName: (name) => `预设已保存: ${name}`,
|
||||
presetLoaded: (name) => `预设已加载: ${name}`,
|
||||
presetDeleted: (name) => `预设已删除: ${name}`,
|
||||
selectParentFolderFirst: "请先选择父文件夹",
|
||||
folderDeleted: "文件夹已删除",
|
||||
folderCreated: (name) => `已创建文件夹「${name}」`,
|
||||
noOtherFolders: "没有其他可用文件夹。请先创建子文件夹。",
|
||||
deletedNImages: (n) => `已删除${n}张图像`,
|
||||
movedNImages: (n) => `已移动${n}张图像`,
|
||||
addedNImagesToGroup: (n, g) => `已将${n}张图像添加到「${g}」`,
|
||||
favoritedNImages: (n) => `已收藏${n}张图像`,
|
||||
unfavoritedNImages: (n) => `已取消收藏${n}张图像`,
|
||||
unknownWorkflowFormat: "未知的工作流格式",
|
||||
generationComplete: "生成完成",
|
||||
generationError: (msg) => `生成错误: ${msg}`,
|
||||
batchNoneSelected: (what) => `未选择${what}`,
|
||||
batchItemFailed: (i, total, msg) => `[${i}/${total}] 失败: ${msg}`,
|
||||
batchStopped: (completed, failed) => `批处理已停止 — 完成${completed}个,失败${failed}个`,
|
||||
connectedToComfyUI: "已连接到ComfyUI",
|
||||
failedToConnect: "连接失败",
|
||||
modelListsRefreshed: "模型列表已刷新",
|
||||
noFileWorkflowLoaded: "未加载基于文件的工作流",
|
||||
resetFailed: (msg) => `重置失败: ${msg}`,
|
||||
interrupted: "已中断",
|
||||
invalidJsonMsg: (msg) => `无效的JSON: ${msg}`,
|
||||
workflowLoadedName: (name) => `工作流已加载: ${name}`,
|
||||
stackCleared: "堆栈已清空",
|
||||
enterPositiveInt: "请输入正整数",
|
||||
sentToPositive: "已发送到正向提示词",
|
||||
sentToNegative: "已发送到负向提示词",
|
||||
invalidPathFormat: "路径无效。请使用 folder/name 格式,各部分仅限字母、数字、-、_、.",
|
||||
|
||||
// -- Settings: text size & JSON colors --
|
||||
textSizeLabel: "文字大小",
|
||||
textSizeTextarea: "提示词 / 聊天输入框",
|
||||
textSizeHint: "适用于:生成UI提示词、AI助手聊天、预设提示词、通配符编辑、Metadata提示词预览",
|
||||
jsonColorsSection: "RAW JSON 文字颜色",
|
||||
jsonColorBase: "普通文本",
|
||||
jsonColorYellow: "名称 / 调度器",
|
||||
jsonColorPink: "标题",
|
||||
jsonColorGreen: "Width / Height",
|
||||
jsonColorCyan: "提示词 / 文本",
|
||||
jsonColorRed: "图像 / 文件",
|
||||
jsonColorReset: "恢复默认",
|
||||
|
||||
// -- Prompt tab --
|
||||
tabPrompt: "提示词",
|
||||
you: "你",
|
||||
@@ -1505,6 +1776,10 @@ const LANGUAGES = {
|
||||
enterPresetName: "请输入预设名称",
|
||||
noPromptToSave: "没有可保存的提示词",
|
||||
presetSaved: "预设已保存",
|
||||
copyPositivePrompt: "PP 复制",
|
||||
copyNegativePrompt: "NP 复制",
|
||||
copiedToClipboard: "已复制到剪贴板",
|
||||
noTextToCopy: "没有可复制的文本",
|
||||
attachImage: "附加图片",
|
||||
clearChat: "清空聊天",
|
||||
send: "发送",
|
||||
@@ -1719,6 +1994,8 @@ const LANGUAGES = {
|
||||
galleryOutputDir: "图库输出文件夹",
|
||||
galleryOutputDirLabel: "输出文件夹路径",
|
||||
galleryOutputDirHint: "设置图库标签页浏览的ComfyUI输出文件夹。留空则使用ComfyUI默认输出目录。",
|
||||
gallerySelectImageFirst: "请先选择图像",
|
||||
galleryNoEmbeddedWorkflow: "此图像中未嵌入ComfyUI工作流。",
|
||||
|
||||
tabAi: "AI TOOL",
|
||||
|
||||
@@ -1781,7 +2058,7 @@ const LANGUAGES = {
|
||||
helpWf6: "详情弹窗:重命名、收藏、缩略图更换、徽章分配、标签、备注、AI摘要、在ComfyUI中打开、加载到生成UI、设为默认、删除",
|
||||
helpWf7: "徽章管理:添加、重命名、删除徽章并自定义颜色(与Models标签共享)— ⚙ Badge按钮",
|
||||
helpGen1: "连接/断开ComfyUI,检查连接状态",
|
||||
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)",
|
||||
helpGen2: "从工作流标签页加载工作流(不支持App格式.app.json)。Reset Workflow按钮从磁盘重新读取当前工作流文件并重新加载编辑器。Save按钮(标签栏右端)将当前工作流(包括在编辑器中所做的编辑)保存为新的.json文件到工作流标签页;会显示以当前工作流名称为默认值的文件名对话框",
|
||||
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
|
||||
helpGen4: "Input标签:左列为Prompt(上)+ Image拖放(下)",
|
||||
helpGen5: "Model标签:Checkpoint/VAE/LoRA(Single/Stack标签)/ControlNet/UNET/TextEncoder选择器(含筛选)",
|
||||
@@ -1835,7 +2112,7 @@ const LANGUAGES = {
|
||||
helpNodes5: "侧面板:详情(类名、包、分类、描述、标志)、I/O规格(输入输出类型和默认值)、组管理",
|
||||
helpNodes6: "节点集:创建可复用的节点集合(含描述、标签、节点间链接定义)",
|
||||
helpModels1: "浏览已安装模型:Checkpoint、LoRA、VAE、ControlNet、UNET、TextEncoder、Hypernetwork、Embedding,通过子标签切换",
|
||||
helpModels2: "缩略图和表格视图模式切换(带分页)",
|
||||
helpModels2: "缩略图和表格视图模式切换(带分页)。表格视图除文件名、子文件夹和扩展名外,还显示来自CivitAI数据的Type / Base Model列。点击列标题可排序 — 第一次升序(▲),第二次降序(▼),第三次取消排序。E/D列按启用/禁用状态排序",
|
||||
helpModels3: "搜索、标签筛选、分组筛选、收藏筛选、状态筛选(全部 / 仅启用 / 仅禁用)",
|
||||
helpModels4: "侧面板:基本信息(文件路径、标签、备注)、分组管理、CivitAI集成",
|
||||
helpModels5: "CivitAI集成:通过SHA256哈希获取模型信息,按模型类型批量获取;无预览图时自动下载并保存",
|
||||
@@ -1854,10 +2131,12 @@ const LANGUAGES = {
|
||||
helpGallery5: "文件夹树:点击加载图像,▶展开;'+ New'在选定文件夹内创建子文件夹;'Del'删除该文件夹及其所有内容",
|
||||
helpGallery6: "使用Ctrl+点击多选 — 批量操作:添加到分组、全部收藏、取消全部收藏、移动到...、删除",
|
||||
helpGallery7: "详情面板 — 信息(Info)标签:文件名、大小、日期、标签(添加/移除)、备注;'移动到...'将图像移至另一文件夹;'删除'永久删除",
|
||||
helpGallery8: "详情面板 — 元数据(Metadata)标签:显示来自PNG嵌入数据(prompt / workflow键)或Generate UI标签保存的工作流JSON;一键复制到剪贴板",
|
||||
helpGallery8: "详情面板 — JSON标签:显示来自PNG嵌入数据(prompt / workflow键)或Generate UI标签保存的工作流JSON;一键复制到剪贴板",
|
||||
helpGallery9: "详情面板 — 分组(Groups)标签:对每个图像进行组的创建、分配、移除、重命名和删除",
|
||||
helpGallery10: "工作流自动保存:在Generate UI标签生成的图像,其工作流会自动保存到图库元数据,并在Metadata标签中显示",
|
||||
helpGallery10: "工作流自动保存:在Generate UI标签生成的图像,其工作流会自动保存到图库元数据,并在JSON标签中显示",
|
||||
helpGallery11: "支持PNG(tEXt/iTXt)、JPEG、WebP、GIF;PNG格式读取ComfyUI嵌入的JSON(prompt / workflow键)提取工作流",
|
||||
helpGallery12: "Metadata按钮(绿色,位于详情面板标签栏):在Metadata标签中打开所选图像以全面查看嵌入数据;Alt+点击任意图像缩略图效果相同",
|
||||
helpGallery13: "Load GenUI按钮(蓝色,位于详情面板标签栏):将所选图像中嵌入的ComfyUI工作流直接加载到GenerateUI标签并切换过去;如果没有嵌入工作流或格式不受支持,则显示警告提示",
|
||||
helpSidepanelTitle: "Workflow Studio Library(ComfyUI侧面板)",
|
||||
helpSidepanel1: "从ComfyUI工具栏的Workflow Studio Library按钮打开",
|
||||
helpSidepanel2: "Workflows标签:All / ★ Favorites / Groups子标签,All视图中收藏项显示★",
|
||||
@@ -2076,14 +2355,9 @@ let _summaryLang = "en";
|
||||
* Initialize i18n from localStorage settings.
|
||||
*/
|
||||
export function initI18n() {
|
||||
try {
|
||||
const s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
_currentLang = s.uiLang || "en";
|
||||
_summaryLang = s.summaryLang || "en";
|
||||
} catch {
|
||||
_currentLang = "en";
|
||||
_summaryLang = "en";
|
||||
}
|
||||
const s = getSettings();
|
||||
_currentLang = s.uiLang || "en";
|
||||
_summaryLang = s.summaryLang || "en";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { t } from "./i18n.js";
|
||||
import { escapeHtml } from "./util.js";
|
||||
|
||||
// ── File size limit ───────────────────────────────────────────
|
||||
const MAX_FILE_SIZE = 50 * 1024 * 1024;
|
||||
@@ -504,7 +505,6 @@ async function extractAllMetadata(file) {
|
||||
}
|
||||
|
||||
// ── UI helpers ────────────────────────────────────────────────
|
||||
function escapeHtml(s) { return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); }
|
||||
|
||||
function buildModelItem(label) {
|
||||
const el = document.createElement("div");
|
||||
|
||||
+41
-55
@@ -7,6 +7,7 @@ import { showToast, openModal, closeModal } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
import { escapeHtml, readJsonStorage } from "./util.js";
|
||||
|
||||
// ── Constants ─────────────────────────────────────────────
|
||||
const RESERVED_GROUPS = ["Batch", "Stack"];
|
||||
@@ -190,9 +191,7 @@ function applyToGenUI(modelName, modelType) {
|
||||
// User-defined badge colors (stored in metadata per model)
|
||||
// Global badge palette: label → color, stored in localStorage
|
||||
function getBadgePalette() {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem("wfm_models_badge_palette") || "{}");
|
||||
} catch { return {}; }
|
||||
return readJsonStorage("wfm_models_badge_palette");
|
||||
}
|
||||
|
||||
function saveBadgePalette(palette) {
|
||||
@@ -201,13 +200,6 @@ function saveBadgePalette(palette) {
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
function parseModelPath(fullName) {
|
||||
const lastSlash = Math.max(fullName.lastIndexOf("/"), fullName.lastIndexOf("\\"));
|
||||
@@ -670,7 +662,7 @@ async function saveModelMetadata(modelName, updates) {
|
||||
}
|
||||
return data;
|
||||
} catch (err) {
|
||||
showToast("Error saving metadata: " + err.message, "error");
|
||||
showToast(t("saveFailed", err.message), "error");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -742,50 +734,44 @@ function filterModels() {
|
||||
return sortModels(models);
|
||||
}
|
||||
|
||||
function sortKeyOf(modelName) {
|
||||
const meta = state.modelMetadata[modelName] || {};
|
||||
switch (state.sortColumn) {
|
||||
case "fav":
|
||||
return meta.favorite ? 1 : 0;
|
||||
case "filename":
|
||||
return parseModelPath(modelName).name.toLowerCase();
|
||||
case "subdir":
|
||||
return parseModelPath(modelName).dir.toLowerCase();
|
||||
case "civtype": {
|
||||
const civ = meta.sha256 && state.civitaiCache[meta.sha256];
|
||||
return (civ?.type || "").toLowerCase();
|
||||
}
|
||||
case "basemodel": {
|
||||
const civ = meta.sha256 && state.civitaiCache[meta.sha256];
|
||||
return (civ?.baseModel || "").toLowerCase();
|
||||
}
|
||||
case "ext":
|
||||
return getExtension(parseModelPath(modelName).name).toLowerCase();
|
||||
case "tags":
|
||||
return (meta.tags || []).join(", ").toLowerCase();
|
||||
case "memo":
|
||||
return (meta.memo || "").toLowerCase();
|
||||
case "enabled":
|
||||
return isModelDisabled(modelName) ? 1 : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function sortModels(models) {
|
||||
if (!state.sortColumn) return models;
|
||||
return [...models].sort((a, b) => {
|
||||
const metaA = state.modelMetadata[a] || {};
|
||||
const metaB = state.modelMetadata[b] || {};
|
||||
let va, vb;
|
||||
switch (state.sortColumn) {
|
||||
case "fav":
|
||||
va = metaA.favorite ? 1 : 0; vb = metaB.favorite ? 1 : 0; break;
|
||||
case "filename": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = pa.name.toLowerCase(); vb = pb.name.toLowerCase(); break;
|
||||
}
|
||||
case "subdir": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = pa.dir.toLowerCase(); vb = pb.dir.toLowerCase(); break;
|
||||
}
|
||||
case "civtype": {
|
||||
const civA = metaA.sha256 && state.civitaiCache[metaA.sha256];
|
||||
const civB = metaB.sha256 && state.civitaiCache[metaB.sha256];
|
||||
va = (civA?.type || "").toLowerCase(); vb = (civB?.type || "").toLowerCase(); break;
|
||||
}
|
||||
case "basemodel": {
|
||||
const civA = metaA.sha256 && state.civitaiCache[metaA.sha256];
|
||||
const civB = metaB.sha256 && state.civitaiCache[metaB.sha256];
|
||||
va = (civA?.baseModel || "").toLowerCase(); vb = (civB?.baseModel || "").toLowerCase(); break;
|
||||
}
|
||||
case "ext": {
|
||||
const pa = parseModelPath(a); const pb = parseModelPath(b);
|
||||
va = getExtension(pa.name).toLowerCase(); vb = getExtension(pb.name).toLowerCase(); break;
|
||||
}
|
||||
case "tags":
|
||||
va = (metaA.tags || []).join(", ").toLowerCase();
|
||||
vb = (metaB.tags || []).join(", ").toLowerCase(); break;
|
||||
case "memo":
|
||||
va = (metaA.memo || "").toLowerCase(); vb = (metaB.memo || "").toLowerCase(); break;
|
||||
case "enabled":
|
||||
va = isModelDisabled(a) ? 1 : 0; vb = isModelDisabled(b) ? 1 : 0; break;
|
||||
default: return 0;
|
||||
}
|
||||
if (va < vb) return state.sortDir === "asc" ? -1 : 1;
|
||||
if (va > vb) return state.sortDir === "asc" ? 1 : -1;
|
||||
return 0;
|
||||
});
|
||||
// ソートキーを1モデル1回だけ計算(比較ごとのparseModelPath等の再計算を回避)
|
||||
const dir = state.sortDir === "asc" ? 1 : -1;
|
||||
return models
|
||||
.map((m) => [sortKeyOf(m), m])
|
||||
.sort((a, b) => (a[0] < b[0] ? -dir : a[0] > b[0] ? dir : 0))
|
||||
.map((pair) => pair[1]);
|
||||
}
|
||||
|
||||
function getAllTags() {
|
||||
@@ -1283,7 +1269,7 @@ async function clearStackGroup() {
|
||||
state.allModelGroups[state.activeModelType] = state.modelGroups;
|
||||
await saveModelGroups(state.modelGroups);
|
||||
renderModelGrid();
|
||||
showToast("Stack cleared", "success");
|
||||
showToast(t("stackCleared"), "success");
|
||||
}
|
||||
|
||||
// ── Favorite toggle ───────────────────────────────────────
|
||||
@@ -2089,7 +2075,7 @@ async function loadModelsForCurrentType() {
|
||||
} catch (err) {
|
||||
console.error("Failed to load models:", err);
|
||||
if (placeholder) placeholder.textContent = t("modelsLoadError");
|
||||
showToast("Error: " + err.message, "error");
|
||||
showToast(t("errorWithMsg", err.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { showToast } from "./app.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { escapeHtml } from "./util.js";
|
||||
|
||||
// ── State ─────────────────────────────────────────────────
|
||||
|
||||
@@ -50,9 +51,6 @@ function categoryBadgeHtml(cat) {
|
||||
return `<span class="wfm-badge wfm-badge-category">${cat}</span>`;
|
||||
}
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
||||
}
|
||||
|
||||
// ── API ───────────────────────────────────────────────────
|
||||
|
||||
@@ -586,7 +584,7 @@ function renderSideGroups(node) {
|
||||
const name = input?.value?.trim();
|
||||
if (!name) return;
|
||||
if (state.nodeGroups[name]) {
|
||||
showToast("Group already exists", "warning");
|
||||
showToast(t("groupExists"), "warning");
|
||||
return;
|
||||
}
|
||||
state.nodeGroups[name] = [node.name];
|
||||
@@ -604,7 +602,7 @@ function renderSideGroups(node) {
|
||||
const newName = prompt(`Rename group "${oldName}" to:`, oldName);
|
||||
if (!newName || newName === oldName) return;
|
||||
if (state.nodeGroups[newName] !== undefined) {
|
||||
showToast("Group name already exists", "warning");
|
||||
showToast(t("groupNameExists"), "warning");
|
||||
return;
|
||||
}
|
||||
state.nodeGroups[newName] = state.nodeGroups[oldName];
|
||||
@@ -613,7 +611,7 @@ function renderSideGroups(node) {
|
||||
if (state.groupFilter === oldName) state.groupFilter = newName;
|
||||
renderSideGroups(node);
|
||||
renderFilters();
|
||||
showToast(`Renamed to "${newName}"`, "success");
|
||||
showToast(t("renamedTo", newName), "success");
|
||||
});
|
||||
|
||||
// グループ削除
|
||||
@@ -627,7 +625,7 @@ function renderSideGroups(node) {
|
||||
if (state.groupFilter === name) state.groupFilter = "";
|
||||
renderSideGroups(node);
|
||||
renderFilters();
|
||||
showToast(`Group "${name}" deleted`, "success");
|
||||
showToast(t("groupDeleted", name), "success");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+18
-19
@@ -4,6 +4,7 @@
|
||||
|
||||
import { showToast } from "./app.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { readJsonStorage } from "./util.js";
|
||||
|
||||
// ============================================
|
||||
// State
|
||||
@@ -115,9 +116,7 @@ async function loadAllPresets() {
|
||||
promptPresets = await fetchPresets();
|
||||
|
||||
// Load groups from localStorage
|
||||
try {
|
||||
pmGroups = JSON.parse(localStorage.getItem(PM_GROUPS_KEY) || "{}");
|
||||
} catch { pmGroups = {}; }
|
||||
pmGroups = readJsonStorage(PM_GROUPS_KEY);
|
||||
|
||||
// Clean stale entries from groups (preserve reserved groups even if empty)
|
||||
const validIds = new Set(promptPresets.map(p => p.id));
|
||||
@@ -1050,43 +1049,43 @@ export function initPromptTab() {
|
||||
if (!name || !name.trim()) return;
|
||||
const key = name.trim();
|
||||
if (pmGroups[key]) {
|
||||
showToast("Group already exists", "error");
|
||||
showToast(t("groupExists"), "error");
|
||||
return;
|
||||
}
|
||||
pmGroups[key] = [];
|
||||
saveGroups();
|
||||
renderPresetManager();
|
||||
showToast(`Group "${key}" created`, "success");
|
||||
showToast(t("groupCreated", key), "success");
|
||||
});
|
||||
|
||||
document.getElementById("wfm-preset-add-to-group-btn")?.addEventListener("click", () => {
|
||||
const groupSelect = document.getElementById("wfm-preset-group-select");
|
||||
const groupName = groupSelect?.value;
|
||||
if (!groupName) {
|
||||
showToast("Select a group first", "error");
|
||||
showToast(t("selectGroupFirst"), "error");
|
||||
return;
|
||||
}
|
||||
const id = presetSelect?.value;
|
||||
if (!id) {
|
||||
showToast("Select a preset first", "error");
|
||||
showToast(t("selectPresetFirst"), "error");
|
||||
return;
|
||||
}
|
||||
if (!pmGroups[groupName]) pmGroups[groupName] = [];
|
||||
if (pmGroups[groupName].includes(id)) {
|
||||
showToast("Already in this group", "info");
|
||||
showToast(t("alreadyInGroup"), "info");
|
||||
return;
|
||||
}
|
||||
pmGroups[groupName].push(id);
|
||||
saveGroups();
|
||||
renderPresetManager();
|
||||
showToast("Added to group", "success");
|
||||
showToast(t("addedToGroup"), "success");
|
||||
});
|
||||
|
||||
document.getElementById("wfm-preset-del-group-btn")?.addEventListener("click", () => {
|
||||
const groupSelect = document.getElementById("wfm-preset-group-select");
|
||||
const groupName = groupSelect?.value;
|
||||
if (!groupName) {
|
||||
showToast("Select a group first", "error");
|
||||
showToast(t("selectGroupFirst"), "error");
|
||||
return;
|
||||
}
|
||||
if (PROMPT_RESERVED_GROUPS.includes(groupName)) {
|
||||
@@ -1097,7 +1096,7 @@ export function initPromptTab() {
|
||||
delete pmGroups[groupName];
|
||||
saveGroups();
|
||||
renderPresetManager();
|
||||
showToast(`Group "${groupName}" deleted`, "success");
|
||||
showToast(t("groupDeleted", groupName), "success");
|
||||
});
|
||||
|
||||
// --- Preset Manager ---
|
||||
@@ -1160,7 +1159,7 @@ export function initPromptTab() {
|
||||
const n = prompt("Number of items to pick (n):", "2");
|
||||
if (n === null) return;
|
||||
const num = parseInt(n, 10);
|
||||
if (isNaN(num) || num < 1) { showToast("Enter a positive integer", "error"); return; }
|
||||
if (isNaN(num) || num < 1) { showToast(t("enterPositiveInt"), "error"); return; }
|
||||
const template = "{" + num + "$$|}";
|
||||
const start = ta.selectionStart;
|
||||
wcInsertAtCursor(ta, template);
|
||||
@@ -1198,7 +1197,7 @@ export function initPromptTab() {
|
||||
if (!src || !dst) return;
|
||||
dst.value = src.value;
|
||||
dst.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
showToast("Sent to Positive Prompt", "success");
|
||||
showToast(t("sentToPositive"), "success");
|
||||
});
|
||||
|
||||
document.getElementById("wfm-wc-to-neg-btn")?.addEventListener("click", () => {
|
||||
@@ -1207,7 +1206,7 @@ export function initPromptTab() {
|
||||
if (!src || !dst) return;
|
||||
dst.value = src.value;
|
||||
dst.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
showToast("Sent to Negative Prompt", "success");
|
||||
showToast(t("sentToNegative"), "success");
|
||||
});
|
||||
|
||||
document.getElementById("wfm-wc-clear-btn")?.addEventListener("click", () => {
|
||||
@@ -1235,22 +1234,22 @@ export function initPromptTab() {
|
||||
const ext = extSelect?.value || "txt";
|
||||
const content = contentTA?.value || "";
|
||||
|
||||
if (!rawName) { showToast("Enter a filename", "error"); return; }
|
||||
if (!rawName) { showToast(t("pleaseEnterFilename"), "error"); return; }
|
||||
// Validate each path component (allow letters, numbers, -, _, ., space)
|
||||
const nameParts = rawName.split("/");
|
||||
if (nameParts.some(p => !p || !/^[\w\-. ]+$/.test(p))) {
|
||||
showToast("Invalid path. Use folder/name format, each part: letters, numbers, -, _, . only", "error");
|
||||
showToast(t("invalidPathFormat"), "error");
|
||||
return;
|
||||
}
|
||||
const name = rawName;
|
||||
const filename = `${name}.${ext}`;
|
||||
const saved = await wcSaveFile(filename, content);
|
||||
if (saved) {
|
||||
showToast(`Saved: ${filename}`, "success");
|
||||
showToast(t("savedAs", filename), "success");
|
||||
wcCloseEditor();
|
||||
wcRefreshFiles();
|
||||
} else {
|
||||
showToast("Failed to save file", "error");
|
||||
showToast(t("saveFailed"), "error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1259,7 +1258,7 @@ export function initPromptTab() {
|
||||
if (!wcEditingFilename) return;
|
||||
if (!confirm(`Delete "${wcEditingFilename}"?`)) return;
|
||||
await wcDeleteFile(wcEditingFilename);
|
||||
showToast(`Deleted: ${wcEditingFilename}`, "success");
|
||||
showToast(t("deletedName", wcEditingFilename), "success");
|
||||
wcCloseEditor();
|
||||
wcRefreshFiles();
|
||||
});
|
||||
|
||||
@@ -6,6 +6,8 @@ import { showToast } from "./app.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { t, getLang, getSummaryLang, setLang, setSummaryLang, getLanguageOptions, getSummaryLanguageOptions } from "./i18n.js";
|
||||
|
||||
import { getSettings, readJsonStorage } from "./util.js";
|
||||
|
||||
const SETTINGS_KEY = "wfm_settings";
|
||||
|
||||
function rgbToHex(rgb) {
|
||||
@@ -15,11 +17,7 @@ function rgbToHex(rgb) {
|
||||
}
|
||||
|
||||
function loadLocalSettings() {
|
||||
try {
|
||||
return JSON.parse(localStorage.getItem(SETTINGS_KEY) || "{}");
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
return readJsonStorage(SETTINGS_KEY);
|
||||
}
|
||||
|
||||
function saveLocalSettings(patch) {
|
||||
@@ -960,7 +958,7 @@ export async function initSettingsTab() {
|
||||
setLang(lang);
|
||||
saveLocalSettings({ ...loadLocalSettings(), uiLang: lang });
|
||||
// Re-render the entire page to apply new language
|
||||
showToast("Language changed. Reloading...", "success");
|
||||
showToast(t("languageChanged"), "success");
|
||||
setTimeout(() => location.reload(), 500);
|
||||
});
|
||||
|
||||
@@ -1176,7 +1174,7 @@ export async function initSettingsTab() {
|
||||
|
||||
// Clear default workflow
|
||||
document.getElementById("wfm-settings-clear-wf")?.addEventListener("click", () => {
|
||||
const s = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
const s = getSettings();
|
||||
delete s.defaultWorkflow;
|
||||
delete s.defaultWorkflowData;
|
||||
localStorage.setItem("wfm_settings", JSON.stringify(s));
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Shared utilities
|
||||
*/
|
||||
|
||||
// HTMLエスケープ(属性値で使うため " も必ずエスケープする)
|
||||
export function escapeHtml(s) {
|
||||
return String(s)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
// localStorage からJSONを安全に読む(不正JSON・未設定時はfallback)
|
||||
export function readJsonStorage(key, fallback = {}) {
|
||||
try {
|
||||
const raw = localStorage.getItem(key);
|
||||
return raw ? JSON.parse(raw) : fallback;
|
||||
} catch {
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
|
||||
// プラグイン共通設定 (wfm_settings)
|
||||
export function getSettings() {
|
||||
return readJsonStorage("wfm_settings");
|
||||
}
|
||||
+17
-24
@@ -10,6 +10,7 @@ import { loadWorkflowIntoEditor } from "./generate-tab.js";
|
||||
import { t, getSummaryPrompt } from "./i18n.js";
|
||||
import { highlightJSON } from "./json-highlight.js";
|
||||
import { openBadgeEditModal } from "./models-tab.js";
|
||||
import { escapeHtml, getSettings, readJsonStorage } from "./util.js";
|
||||
|
||||
// ============================================
|
||||
// Constants
|
||||
@@ -33,21 +34,13 @@ const state = {
|
||||
|
||||
|
||||
function getBadgePalette() {
|
||||
try { return JSON.parse(localStorage.getItem("wfm_models_badge_palette") || "{}"); }
|
||||
catch { return {}; }
|
||||
return readJsonStorage("wfm_models_badge_palette");
|
||||
}
|
||||
|
||||
function saveBadgePalette(palette) {
|
||||
localStorage.setItem("wfm_models_badge_palette", JSON.stringify(palette));
|
||||
}
|
||||
|
||||
function escapeHtml(s) {
|
||||
return String(s)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Open in ComfyUI
|
||||
@@ -94,7 +87,7 @@ const groups = {
|
||||
|
||||
load() {
|
||||
try {
|
||||
this._data = JSON.parse(localStorage.getItem("wfm_groups") || "{}");
|
||||
this._data = readJsonStorage("wfm_groups");
|
||||
} catch {
|
||||
this._data = {};
|
||||
}
|
||||
@@ -501,7 +494,7 @@ async function toggleFavorite(wf, btnEl) {
|
||||
btnEl.textContent = newVal ? "\u2605" : "\u2606";
|
||||
btnEl.classList.toggle("active", newVal);
|
||||
} catch (err) {
|
||||
showToast("Error: " + err.message, "error");
|
||||
showToast(t("errorWithMsg", err.message), "error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,7 +670,7 @@ function renderSideGroup(wf) {
|
||||
groups.remove(filename, btn.dataset.group);
|
||||
renderSideGroup(wf);
|
||||
_refreshGroupFilter();
|
||||
showToast(`Removed from "${btn.dataset.group}"`, "success");
|
||||
showToast(t("removedFromGroupName", btn.dataset.group), "success");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -687,7 +680,7 @@ function renderSideGroup(wf) {
|
||||
if (!g) return;
|
||||
groups.assign(filename, g);
|
||||
renderSideGroup(wf);
|
||||
showToast(`Added to "${g}"`, "success");
|
||||
showToast(t("addedToGroupName", g), "success");
|
||||
});
|
||||
|
||||
// グループ作成(作成後に現在のWFに追加)
|
||||
@@ -696,14 +689,14 @@ function renderSideGroup(wf) {
|
||||
const name = input?.value.trim();
|
||||
if (!name) return;
|
||||
if (!groups.createGroup(name)) {
|
||||
showToast(`"${name}" already exists`, "warning");
|
||||
showToast(t("nameAlreadyExists", name), "warning");
|
||||
return;
|
||||
}
|
||||
groups.assign(filename, name);
|
||||
input.value = "";
|
||||
renderSideGroup(wf);
|
||||
_refreshGroupFilter();
|
||||
showToast(`Group "${name}" created`, "success");
|
||||
showToast(t("groupCreated", name), "success");
|
||||
});
|
||||
|
||||
// グループ名変更
|
||||
@@ -717,13 +710,13 @@ function renderSideGroup(wf) {
|
||||
const newName = prompt(`Rename group "${oldName}" to:`, oldName);
|
||||
if (!newName || newName === oldName) return;
|
||||
if (!groups.renameGroup(oldName, newName)) {
|
||||
showToast("Rename failed", "error");
|
||||
showToast(t("renameFailed"), "error");
|
||||
return;
|
||||
}
|
||||
if (state.groupFilter === oldName) state.groupFilter = newName;
|
||||
renderSideGroup(wf);
|
||||
_refreshGroupFilter();
|
||||
showToast(`Renamed to "${newName}"`, "success");
|
||||
showToast(t("renamedTo", newName), "success");
|
||||
});
|
||||
|
||||
// グループ削除
|
||||
@@ -743,7 +736,7 @@ function renderSideGroup(wf) {
|
||||
}
|
||||
renderSideGroup(wf);
|
||||
_refreshGroupFilter();
|
||||
showToast(`Group "${name}" deleted`, "success");
|
||||
showToast(t("groupDeleted", name), "success");
|
||||
});
|
||||
|
||||
_refreshGroupFilter();
|
||||
@@ -903,7 +896,7 @@ function openDetailModal(wf) {
|
||||
favBtn.classList.toggle("active", newVal);
|
||||
renderGrid();
|
||||
} catch (err) {
|
||||
showToast("Error: " + err.message, "error");
|
||||
showToast(t("errorWithMsg", err.message), "error");
|
||||
}
|
||||
});
|
||||
titleEl.parentNode.insertBefore(favBtn, titleEl);
|
||||
@@ -1036,7 +1029,7 @@ function openDetailModal(wf) {
|
||||
apiData = await comfyWorkflow.convertUiToApi(wfData);
|
||||
}
|
||||
// Save to localStorage
|
||||
const settings = JSON.parse(localStorage.getItem("wfm_settings") || "{}");
|
||||
const settings = getSettings();
|
||||
settings.defaultWorkflow = wf.filename;
|
||||
settings.defaultWorkflowData = apiData;
|
||||
localStorage.setItem("wfm_settings", JSON.stringify(settings));
|
||||
@@ -1186,7 +1179,7 @@ export function initWorkflowTab() {
|
||||
showToast(msg, ng.length ? "error" : "success");
|
||||
await loadWorkflows();
|
||||
} catch (err) {
|
||||
showToast("Import error: " + err.message, "error");
|
||||
showToast(t("importErrorMsg", err.message), "error");
|
||||
}
|
||||
e.target.value = "";
|
||||
});
|
||||
@@ -1229,10 +1222,10 @@ export function initWorkflowTab() {
|
||||
const data = await importFiles(files);
|
||||
const ok =
|
||||
data.results?.filter((r) => r.status === "success").length ?? 0;
|
||||
showToast(`${ok} file(s) imported via drag & drop`, "success");
|
||||
showToast(t("importedViaDrop", ok), "success");
|
||||
await loadWorkflows();
|
||||
} catch (err) {
|
||||
showToast("Import error: " + err.message, "error");
|
||||
showToast(t("importErrorMsg", err.message), "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1306,7 +1299,7 @@ export function initWorkflowTab() {
|
||||
// Toolbar: Refresh button
|
||||
document.getElementById("wfm-refresh-btn")?.addEventListener("click", async () => {
|
||||
await loadWorkflows();
|
||||
showToast("Refreshed", "success");
|
||||
showToast(t("refreshed"), "success");
|
||||
});
|
||||
|
||||
// Toolbar: ⚙ settings button (view settings panel)
|
||||
|
||||
@@ -1089,7 +1089,7 @@
|
||||
<h3>Models Tab</h3>
|
||||
<ul>
|
||||
<li id="wfm-help-models-1">Browse installed models: Checkpoint, LoRA, VAE, ControlNet, UNET, TextEncoder, Hypernetwork, Embedding with sub-tab switching</li>
|
||||
<li id="wfm-help-models-2">Thumbnail, Card, and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension; <b>column headers are clickable to sort</b> — click once for ascending (▲), again for descending (▼), a third time to clear the sort; the <b>E/D</b> column sorts by enable/disable status</li>
|
||||
<li id="wfm-help-models-2">Thumbnail and Table view modes with pagination; Table view shows Type and Base Model columns sourced from CivitAI data alongside filename, subdirectory, and extension; <b>column headers are clickable to sort</b> — click once for ascending (▲), again for descending (▼), a third time to clear the sort; the <b>E/D</b> column sorts by enable/disable status</li>
|
||||
<li id="wfm-help-models-3">Search, tag filter, group filter, favorites filter, and status filter (All / Enabled only / Disabled only)</li>
|
||||
<li id="wfm-help-models-4">Side panel: opens to CivitAI tab by default when a model is selected; Info (file path, tags, memo), Groups management, CivitAI integration</li>
|
||||
<li id="wfm-help-models-5">CivitAI integration: fetch model info by SHA256 hash, batch fetch per model type</li>
|
||||
@@ -1273,8 +1273,8 @@
|
||||
<button class="wfm-gallery-detail-tab-btn active" data-detail-tab="info">Info</button>
|
||||
<button class="wfm-gallery-detail-tab-btn" data-detail-tab="meta">JSON</button>
|
||||
<button class="wfm-gallery-detail-tab-btn" data-detail-tab="group">Groups</button>
|
||||
<button id="wfm-gallery-open-metadata-btn" class="wfm-gallery-detail-tab-btn wfm-gallery-action-btn-green" title="Open in Metadata tab (or Alt+click image)">Metadata</button>
|
||||
<button id="wfm-gallery-load-genui-btn" class="wfm-gallery-detail-tab-btn wfm-gallery-action-btn-primary" title="Load workflow into GenerateUI">Load GenUI</button>
|
||||
<button id="wfm-gallery-open-metadata-btn" class="wfm-gallery-action-btn wfm-gallery-action-btn-green" title="Open in Metadata tab (or Alt+click image)">Metadata</button>
|
||||
<button id="wfm-gallery-load-genui-btn" class="wfm-gallery-action-btn wfm-gallery-action-btn-primary" title="Load workflow into GenerateUI">Load GenUI</button>
|
||||
</div>
|
||||
<!-- Info タブ -->
|
||||
<div id="wfm-gallery-detail-info" class="wfm-gallery-detail-tab-content active">
|
||||
|
||||
Reference in New Issue
Block a user