Compare commits

...
1 Commits
13 changed files with 285 additions and 14 deletions
+1
View File
@@ -2,6 +2,7 @@
Condensed version-by-version index of DEVLOG.md (each line: version + one-line summary of what changed and why). Full rationale, code details, and "How to apply" lessons live in the excluded DEVLOG.md itself; this index exists so graphify can extract a queryable semantic node per release without feeding the full log to the local Ollama model. Regenerate with `python tools/generate_doc_index.py devlog` whenever DEVLOG.md changes.
- **v0.4.8** — 機能追加: LabタブにPromptグループ一括適用+キーフレーム並べ替え + バグ修正: デフォルトワークフローの上書き保存が反映されない + Styleテーブルの「このファイルへ追加」対応
- **v0.4.7** — 機能追加: Prompt Tab内部リファクタ + Gallery Promptタブ新設 + Send to Canvas改善 + Presetsソート
- **v0.4.6** — 機能追加: MetadataタブをGalleryタブへ統合 + Promptタブに一覧編集可能なTable表示を新設
- **v0.4.5** — 調査: トップバー保存ワークフローのRMBG不具合報告(原因なし) + バグ修正: LabタブModel列の無意味な空キーフレーム表示を解消
+24
View File
@@ -2,6 +2,30 @@
---
## v0.4.8
### 機能追加: LabタブにPromptグループ一括適用+キーフレーム並べ替え + バグ修正: デフォルトワークフローの上書き保存が反映されない + Styleテーブルの「このファイルへ追加」対応
ユーザーからの複数の要望・不具合報告を1セッションで順に実装した一連の作業。
**1. LabタブPrompt列に「PG」ボタン — Promptタブのグループをキーフレームへ一括変換**: 「生成UIタブのLabのプロンプトにプロンプトタブのグループを使用できるようにしたい。'PG'ボタンを配置、モーダルでプロンプトのグループを選択、決定するとプロンプトのキーフレームが#1から自動で作成されます(#1は上書き)」との要望。`prompt-presets.js`の`pmGroups`(グループ名→プリセットID配列)を参照する`getPresetsInGroup()`を新設してexportし、`lab-tab.js`側にPresetManagerの一覧UI(`.wfm-pm-item`)を再利用したグループ選択モーダルを実装。選択→適用で`_lab.columns.prompt`をグループ内プリセット順に#1から全置換(#1は上書き、以降は#2,#3...)する。グループのプリセット数がBatch数を超える場合はBatch数を自動引き上げ(Batch入力欄自体の上限50でキャップ)、それでも収まらない分は既存の「Batchを超えたキーフレーム」警告トースト(`_warnIfKeyframesExceedBatch`)をそのまま再利用して通知する形にした。
**2. Lab: Model/Prompt/KSampler キーフレームの並べ替え**: 続けて「モデル、プロンプト、Ksamplerそれぞれでキーフレームの順変更を可能にしたい。キーフレームのモーダル展開をWクリックに変更しシングルクリックでキーフレームを選択、PGボタン左隣に上下ボタンを設置し操作可能にしたい」との要望。キーフレームセルのクリック挙動を分離し、シングルクリックは選択状態(列ごとに`_selectedIdx[col]`で管理、青枠でハイライト)、ダブルクリックで従来の編集モーダルを開くように変更。各列ヘッダーに▲/▼ボタンを追加し(Promptは要望通りPGボタンの左隣)、選択中のキーフレームと隣接するキーフレームの`atIteration`を入れ替えることで並び順を変更する実装にした。キーフレーム#1(ベースライン — GenerateUIのライブ値を表示する特別な行)は移動不可、かつ他のキーフレームが#1の位置に入れ替わることもないよう制約した。Prompt Group適用・Plan読込・Plan Clearなど列を丸ごと置き換える操作では選択状態を自動リセットするようにし、配列外を指す不整合を防いだ。
**3. バグ修正: デフォルトワークフローに設定した状態で同名上書き保存すると変更が反映されない**: 「生成UIタブで読み込んだデフォルトワークフローのモデルを変更しワークフローを同名で上書き保存した。ワークフロータブでJSONでモデルが変更していることを確認。ブラウザハード再読み込みを行うと以前のモデルが表示される」との不具合報告(スクリーンショット添付、旧モデル名がインストール済みモデルの一覧に無く「見つかりません」警告が出ている状態)。調査の結果、「デフォルトワークフローに設定」機能(`workflow-tab.js`)は設定した時点のワークフローJSON全体を`localStorage`(`wfm_settings.defaultWorkflowData`)へスナップショットとして保存し、起動時の自動読込(`generate-tab.js`)はこのスナップショットを読む仕様であることが判明。GenerateUIタブでの同名上書き保存はファイル自体は更新するが、このスナップショットまでは更新していなかったため、リロードのたびに保存前の古い内容が復活していた。`saveCurrentWorkflow()`の保存成功後処理に、保存したファイル名が現在の`defaultWorkflow`と一致する場合は`defaultWorkflowData`も同時に更新する処理を追加して修正した。
**4. Prompt Tab Tableビュー Styleタブに「+ Add to this file」対応**: 「プロンプトタブ、テーブルのスタイルにForm同様に既存のjsonファイルに追加する方法が欲しい(custom.json以外の場合)。該当jsonのスタイルを選択状態で+ Add to this fileボタンで追加できるようにしたい」との要望。Formタブのスタイルマネージャー(`prompt-styles.js`)には既にこの機能があったが、Tableビュー(`prompt-table.js`)の新規スタイル作成は常に`custom.json`固定(`styleApiCreate(..., null)`)だった。行選択が1件かつそのスタイルの`file`が`custom.json`以外の場合のみ有効化される「+ Add to this file」ボタンをツールバーに追加し、クリックすると保存先ファイルを保持したまま空の新規行を追加(File列に保存前からバッジ表示)、保存時に`styleApiCreate(name, pos, neg, pendingNewStyleFile)`で対象ファイルへ追記する実装にした。バックエンド(`settings_routes.py`)は元々`file`パラメータでの追記に対応済みだったため、フロントエンドの導線を追加するだけで実現できた。
**ヘルプ・README更新**: `project_v0336_conventions`の慣習(index.html + i18n.js 3言語 + app.jsのhelpIdMapの3点セット)に従い、Lab subtab(Setting/Columnsカードへ選択・並べ替えとPGボタンの説明2項目)とPrompt Tab(Table Viewカードへ「+ Add to this file」の説明1項目)を追加。README.mdはGenerateUI Tab(Saveボタン説明にデフォルトワークフロースナップショット修正の注記)、Lab subtab(見出しのバージョン範囲をv0.4.8へ更新、選択/並べ替えとPGボタンの新規項目)、Prompt Tab(Styleテーブルの項目に「+ Add to this file」のTableビュー対応を追記)を更新した。
**検証**: 全JSファイルを`node --check`で構文確認。開発元gitリポジトリと実行時`custom_nodes`フォルダは別実体のため([[project_dev_deploy_sync]]参照)、変更ファイルごとに改行コード(CRLF/LF)の一致を確認してから同期し、都度`diff`で完全一致を検証した。デフォルトワークフローのバグ修正はユーザー自身の実機(GenerateUIでの上書き保存→ハード再読み込み)で確認済み。PGボタン・キーフレーム並べ替え・Styleの「+ Add to this file」もユーザー自身の実機確認で動作を確認済み。
**How to apply**: 開発元リポジトリと実行時`custom_nodes`フォルダへの同期前には必ず`file`コマンドで両ファイルの改行コードが一致しているか確認する(過去に一部ファイルだけLF化していた事例があるため — [[project_dev_deploy_sync]]参照)。一致していれば単純な`cp`で安全にデプロイでき、`diff`で完全一致を最終確認する。キーフレームや行の「並べ替え」機能を実装する際、内部的にソート順を保持する配列(今回は`atIteration`昇順)に対しては、配列そのものの並べ替えではなく「隣接要素同士でソートキーの値を交換する」実装にすると、他のロジック(`_resolveKeyframe`等)が前提とする「配列は常にソート済み」という不変条件を崩さずに済む。
関連: [[project_dev_deploy_sync]], [[project_v0336_conventions]]
---
## v0.4.7
### 機能追加: Prompt Tab内部リファクタ + Gallery Promptタブ新設 + Send to Canvas改善 + Presetsソート
+3 -3
View File
@@ -26,7 +26,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- Built-in AI tools (translation and more)
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.4.7-green)
![Version](https://img.shields.io/badge/version-0.4.8-green)
## Features (tab -> feature names)
@@ -42,8 +42,8 @@ One-click capture, Auto-save as thumbnail, Embedded workflow metadata, Auto-impo
### Feeder subtab (v0.3.5 / v0.3.42)
ImageFeeder node control, Image library, Selection management, Presets, Continuous Run loop, Index sync, Seed, WFS_GalleryFeeder node, Node & group selector, Image grid, After Gen modes, Run / Stop controls
### Lab subtab (v0.3.87 – v0.4.5)
Setting / Results / Plan JSON sub-panels, Per-column keyframes, Model column — Checkpoint / LoRA Single / VAE, Empty state when no matching node exists, Wildcards, Prompt cell extras, Keyframe #1 live-reflect, Bypass checkbox, LoRA node bypass & prompt injection, T2I workflow support, Use generated image for next, Workflow recall, Plan files, Plan Load, Plan JSON tab, Save index image to Output on Run, Index images are self-contained plan files, Eagle integration
### Lab subtab (v0.3.87 – v0.4.8)
Setting / Results / Plan JSON sub-panels, Per-column keyframes, Model column — Checkpoint / LoRA Single / VAE, Empty state when no matching node exists, Wildcards, Prompt cell extras, Keyframe #1 live-reflect, Bypass checkbox, LoRA node bypass & prompt injection, T2I workflow support, Use generated image for next, Workflow recall, Plan files, Plan Load, Plan JSON tab, Save index image to Output on Run, Index images are self-contained plan files, Eagle integration, Select vs. edit, and keyframe reordering, PG — apply a Prompt tab preset group
### Prompt Tab
3-column layout, AI chat assistant, Image attachment, Translation, Prompt presets, Preset Manager, Group management, Clipboard copy, GenUI Set, Wildcard/Style tab bar, Wildcard input toolbar, Wildcard file manager, Style manager, Form / Table toggle, Table view — Presets / Presets Group / Wildcards / Style
+6 -2
View File
@@ -22,7 +22,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- Built-in AI tools (translation and more)
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.4.7-green)
![Version](https://img.shields.io/badge/version-0.4.8-green)
## Screenshots
@@ -90,6 +90,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **6-tab layout** — Input / Model / Settings / Feeder / Batch / **Lab** tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
- **Save button** — located at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API; hidden while the Batch or Lab subtab is active (v0.4.6), since those work on workflow copies / their own Plan files rather than the currently loaded workflow
- **Default-workflow snapshot fix** (v0.4.8) — overwriting the loaded workflow under a filename that's currently set as the auto-load **Default workflow** (Settings tab, see below) now also refreshes that cached snapshot; previously only the file on disk was updated, so the old (pre-edit) version — including any checkpoint no longer installed — kept reappearing after every page reload until the default was re-set by hand
- **Input tab** — Prompt and Image inner tabs (drag-and-drop upload); Prompt tab shows Positive Prompt and Negative Prompt textareas, plus an **Embeddings selector** at the bottom (Filter + Select + Weight input + Paste button); Paste inserts `(embedding:Name:weight)` at the cursor position of the last focused textarea (defaults to Positive when neither is focused); Raw JSON (540px) in the right column
- **Revert button** (v0.3.70) — a ↺ button next to each Apply button reverts the textarea to the node's currently applied value (the reverse of Apply)
- **Emphasis weight editing** (v0.3.70) — select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust `(text:weight)` by ±0.05, A1111/native-ComfyUI style; parentheses are removed automatically when the weight returns to 1.0
@@ -148,7 +149,7 @@ Two independent modes selectable via **[Image Loop] / [Gallery]** toggle buttons
</details>
<details>
<summary><h3>Lab subtab (v0.3.87 – v0.4.5)</h3></summary>
<summary><h3>Lab subtab (v0.3.87 – v0.4.8)</h3></summary>
An experimental batch generator: runs the workflow currently loaded in GenerateUI N times, letting Model (Checkpoint/LoRA Single/VAE) / Prompt / KSampler each change independently starting at a chosen iteration — unlike the Batch tab's single-axis queue, every column keeps its own list of change points. Never mutates the loaded workflow; every iteration runs on a fresh clone. Works with both I2I and T2I workflows (v0.3.90).
@@ -170,6 +171,8 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Save index image to Output on Run** (v0.3.90, on by default since v0.3.93) — checkbox in the run controls; when checked, every completed Run also builds the same contact-sheet index image used for Plan files and saves it directly into ComfyUI's own Output folder as `Lab_index_<counter>_.png` (auto-numbered like a normal generated image, right alongside the images that Run just generated); independent of Plan Save, which always writes its own copy next to the plan file regardless of this checkbox; saved with the plan as `save_index_on_run`
- **Index images are self-contained plan files** (v0.3.91) — every index-image PNG, whether from Plan Save/Save As or from Save index image to Output on Run, carries the entire plan embedded directly in the file as a PNG `wfm_lab_plan` chunk; this is what lets the Output-folder copy above work as a Plan Load source even though it has no matching `.json` anywhere
- **Eagle integration** — every image Lab generates is auto-saved to Eagle the same way as GenerateUI's own Generate button, if enabled in the Settings tab; the Output-folder index image above is included too (v0.3.90) once saved
- **Select vs. edit, and keyframe reordering** (v0.4.8) — a single click on a keyframe cell now only selects it (blue outline); double-click to open its edit modal as before. Each column's header (Model / Prompt / KSampler) also gets **▲ / ▼** buttons that swap the selected keyframe with its immediate neighbor, reordering keyframes without retyping them; keyframe #1 (the live-reflecting baseline) can never move, and nothing can be swapped into its slot
- **PG — apply a Prompt tab preset group** (v0.4.8) — a **PG** button on the Prompt column header opens a picker for the Prompt tab's Table-view preset groups (the same groups the Batch tab's checklist uses); choosing one replaces the entire Prompt column with one keyframe per preset in that group's order, starting at #1 (#1 is overwritten, not appended after). If the group has more presets than the current Batch count, Batch count is raised automatically to fit (capped at 50, the Batch input's own limit); anything still beyond that shows the existing "keyframes beyond Batch count" warning instead of being dropped
</details>
@@ -204,6 +207,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Presets Group table** — create, rename, and delete groups, with each group's members shown as removable badges; the reserved **Batch** group is not listed here — it's managed entirely through the Presets table's B column and BC button instead
- **Wildcards table** — same files as the Form tab's Wildcard file manager above; editing the File path or the Ext dropdown renames the file (saves the content under the new name, then removes the old file)
- **Style table** — same styles as the Form tab's Style manager above, editable inline the same way as Presets
- **+ Add to this file** (v0.4.8) — select exactly one row whose File badge isn't `custom.json` to enable this toolbar button, bringing the Form tab's same-file-add capability (above) to the Table view too; it adds a blank row targeting that same file (shown as a badge in the File column even before saving); custom.json entries and multi-row selections leave it disabled — use the regular + New Style button for those instead
</details>
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-workflow-studio"
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.4.7"
version = "0.4.8"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+7
View File
@@ -280,6 +280,13 @@
color: var(--wfm-danger);
}
/* Single-click selection target for the column header's up/down reorder buttons —
layered as a box-shadow (not border-color) so it never conflicts with the
revert/live/bypassed/node-bypassed border-color signaling above. */
.wfm-lab-cell.wfm-lab-cell-selected {
box-shadow: 0 0 0 2px var(--wfm-primary);
}
.wfm-lab-cell-applied {
margin-top: 3px;
padding-top: 3px;
+2
View File
@@ -507,6 +507,7 @@ function applyI18nToHtml() {
"wfm-help-lab-13": "helpLab13", "wfm-help-lab-14": "helpLab14",
"wfm-help-lab-15": "helpLab15",
"wfm-help-lab-16": "helpLab16", "wfm-help-lab-17": "helpLab17",
"wfm-help-lab-18": "helpLab18", "wfm-help-lab-19": "helpLab19",
"wfm-help-lab-card-plan-title": "helpLabCardPlanTitle",
"wfm-help-lab-plan-1": "helpLabPlan1", "wfm-help-lab-plan-2": "helpLabPlan2",
"wfm-help-lab-plan-3": "helpLabPlan3", "wfm-help-lab-plan-4": "helpLabPlan4",
@@ -534,6 +535,7 @@ function applyI18nToHtml() {
"wfm-help-prompt-20": "helpPrompt20", "wfm-help-prompt-21": "helpPrompt21",
"wfm-help-prompt-22": "helpPrompt22", "wfm-help-prompt-23": "helpPrompt23",
"wfm-help-prompt-24": "helpPrompt24", "wfm-help-prompt-25": "helpPrompt25",
"wfm-help-prompt-26": "helpPrompt26",
"wfm-help-settings-1": "helpSettings1", "wfm-help-settings-2": "helpSettings2",
"wfm-help-settings-3": "helpSettings3", "wfm-help-settings-4": "helpSettings4",
"wfm-help-settings-5": "helpSettings5", "wfm-help-settings-6": "helpSettings6",
+11
View File
@@ -164,6 +164,17 @@ async function saveCurrentWorkflow() {
nameEl.dataset.filename = filename;
}
}
// このファイル名が「デフォルトワークフロー」(workflow-tab.jsの「デフォルトに設定」で
// localStorageにスナップショットされたAPI形式JSON、ページ起動時に自動読込される)に
// 一致する場合、保存内容と食い違ったまま残らないようスナップショットも更新する。
// 更新しないと、ここで上書き保存しても次回リロード時に古いモデル等が復活する。
const settings = getSettings();
if (settings.defaultWorkflow === filename) {
settings.defaultWorkflowData = workflow;
localStorage.setItem("wfm_settings", JSON.stringify(settings));
}
showToast(t("savedAs", filename), "success");
} catch (err) {
showToast(t("saveFailed", err.message), "error");
+36
View File
@@ -287,6 +287,15 @@ const LANGUAGES = {
labT2IImageIgnored: "T2I mode is on — image upload is not needed and was skipped",
labIndexImageSaved: (filename) => `Index image saved to Output: ${filename}`,
labIndexImageSaveFailed: "Failed to save the index image to Output",
labPromptGroupBtnTitle: "Apply a Prompt Group",
labPromptGroupModalTitle: "Prompt Group",
labPromptGroupEmpty: "No groups yet. Create groups in the Prompt tab's group panel.",
labPromptGroupCount: (n) => `${n} preset(s)`,
labPromptGroupSelectFirst: "Select a group first",
labPromptGroupNoPresets: "This group has no presets",
labPromptGroupApplied: (name, n) => `Applied "${name}" (${n} keyframes) to Prompt`,
labPromptGroupBatchRaised: (n) => `Batch count raised to ${n} to fit the group`,
labSelectKeyframeFirst: "Select a keyframe first",
// -- GenerateUI Input tab: Image sub-panel placeholder --
i2iPlaceholderTitle: "Placeholder Image",
@@ -835,6 +844,8 @@ const LANGUAGES = {
helpLab15: "Checkpoint / LoRA / VAE each carry forward independently, the same effective-value rule as every other column (see above): a keyframe in one never resets the other two to the workflow default. A field left blank in the edit modal shows \"(inherits: ...)\" as its placeholder instead of \"(workflow default)\" when an earlier keyframe in that same list already set something, so it's clear what actually applies. \"Revert to #1's setting\" and Bypass — like +/- — only ever affect whichever ONE of the three is currently selected by the C/L/V toggle, never the other two",
helpLab16: "Bypass LoRA node checkbox (LoRA keyframe's own edit modal only): forces that keyframe's strength_model/strength_clip to 0 at apply-time, standing in for ComfyUI's own node Bypass (mode:4) — the workflow used here is already converted to API format, which has no mode concept, so zeroing strength is the behavioral equivalent. Disables the strength fields while checked; independent of the row-level Bypass checkbox above (see helpLab13), which skips the whole row instead of touching the node",
helpLab17: "Apply LoRA syntax + trigger words to Positive prompt checkbox (LoRA column only): when checked, appends <lora:name:strengthModel:strengthClip> plus that LoRA's cached CivitAI trigger words to the Positive prompt, comma-separated, at apply-time — the same format GenerateUI's own Model tab Apply button writes. Switching keyframes (a different LoRA, this checkbox turned off, or the row Bypassed) always strips exactly what the previous iteration injected before adding anything new, so a batch never accumulates every LoRA it has used. Disabled automatically while Bypass LoRA node is checked",
helpLab18: "A single click on a keyframe cell selects it (blue outline) instead of opening it — double-click to open the edit modal as before. Each column's header (Model / Prompt / Ksampler) also has ▲ / ▼ buttons that swap the selected keyframe with its immediate neighbor to reorder them without retyping anything; keyframe #1 (the baseline) can never move, and nothing can be swapped into its slot",
helpLab19: "Prompt column header's PG button: pick one of the Prompt tab's preset groups (Table view's Presets Group, the same groups used by the Batch tab's checklist) and replace the entire Prompt column with one keyframe per preset in that group's order, starting at #1 (#1 is overwritten, not appended after). If the group has more presets than the current Batch count, Batch count is raised automatically to fit (capped at 50, the Batch input's own limit); anything still beyond that shows the usual \"keyframes beyond Batch count\" warning instead of being silently dropped",
helpLabCardPlanTitle: "Setting subtab — Run & Plan files",
helpLabPlan1: "Right pane — Batch: number of iterations to run; Note: free-text memo saved together with the plan",
helpLabPlan2: "Run / Pause / Cancel: Run starts the batch loop; Pause/Resume freezes it between iterations; Cancel interrupts the current generation and stops the loop",
@@ -878,6 +889,7 @@ const LANGUAGES = {
helpPrompt23: "Wildcards table — same files as the Form tab's Wildcard file manager; editing the File path or the Ext dropdown renames the file (saves the content under the new name, then removes the old file)",
helpPrompt24: "Style table — same styles as the Form tab's Style manager, editable inline the same way as Presets",
helpPrompt25: "Presets table toolbar — the ★ and B sort buttons (next to the search box) bring favorited / batch-selected presets to the top of the list; both can be enabled together (★ takes priority, B breaks ties), and everything else keeps its original relative order",
helpPrompt26: "Style table toolbar — select exactly one row whose File badge isn't custom.json to enable + Add to this file: it adds a blank row targeting that same file (shown as a badge in the File column even before saving) — the same capability as the Form tab's Style manager (see above); custom.json entries and multi-row selections leave the button disabled, use the regular + New Style button for those instead",
helpSettings1: "UI language and summary language",
helpSettings2: "Theme selection (13 presets) with customization: color overrides, background patterns (stripes, polka dot, checkerboard, SVG tiling), and font selection (16 Google Fonts including Japanese display fonts)",
helpSettings3: "Workflow data folder path",
@@ -1573,6 +1585,15 @@ const LANGUAGES = {
labT2IImageIgnored: "T2Iモードが有効なため、画像のアップロードは不要としてスキップしました",
labIndexImageSaved: (filename) => `インデックス画像をOutputへ保存しました: ${filename}`,
labIndexImageSaveFailed: "インデックス画像のOutputへの保存に失敗しました",
labPromptGroupBtnTitle: "プロンプトグループを適用",
labPromptGroupModalTitle: "プロンプトグループ",
labPromptGroupEmpty: "グループがまだありません。Promptタブのグループパネルで作成してください。",
labPromptGroupCount: (n) => `プリセット${n}件`,
labPromptGroupSelectFirst: "先にグループを選択してください",
labPromptGroupNoPresets: "このグループにはプリセットがありません",
labPromptGroupApplied: (name, n) => `「${name}」(${n}件のキーフレーム)をPromptに適用しました`,
labPromptGroupBatchRaised: (n) => `グループに合わせてBatch数を${n}に増やしました`,
labSelectKeyframeFirst: "先にキーフレームを選択してください",
// -- GenerateUIタブ Inputサブタブ: Image内プレースホルダ --
i2iPlaceholderTitle: "プレースホルダ画像",
@@ -2121,6 +2142,8 @@ const LANGUAGES = {
helpLab15: "Checkpoint/LoRA/VAEは、他の列と全く同じ実効値ルール(上記参照)でそれぞれ独立して引き継がれます:いずれか1つのキーフレームが、残り2つをワークフロー本来の設定に戻すことはありません。編集モーダルで未設定のままの項目は、同じリスト内の以前のキーフレームで何か設定済みの場合、プレースホルダが「(ワークフローの設定のまま)」ではなく「(引き継ぎ: ...)」と表示され、実際に適用される値が分かるようになっています。「1回目の設定に戻す」やBypassも+/-と同様、現在C/L/Vトグルで選択中の1項目だけに作用し、残り2つには影響しません",
helpLab16: "LoRAノードをバイパスチェックボックス(LoRAキーフレーム自身の編集モーダルのみ):ComfyUI本来のノードBypass(mode:4)の代わりに、そのキーフレームのstrength_model/strength_clipを適用時に強制的に0にします — ここで使われるワークフローは既にAPI形式に変換済みでmodeの概念が無いため、強度をゼロにすることが実質的に同等の効果になります。チェック中は強度の入力欄が無効化されます。上記の行単位のBypassチェックボックス(helpLab13参照)とは独立しており、そちらは行全体をスキップするだけでノードには一切触れません",
helpLab17: "LoRA構文とトリガーワードをポジティブプロンプトに適用チェックボックス(LoRA列のみ):チェックすると、適用時に <lora:name:strengthModel:strengthClip> とそのLoRAのキャッシュ済みCivitAIトリガーワードを、カンマ区切りでポジティブプロンプトへ追加します — GenerateUIのModelタブのApplyボタンが書き込むのと同じ書式です。キーフレームを切り替えた場合(別のLoRAへの変更、このチェックボックスをオフにした場合、または行自体をBypassした場合)は、新しい内容を追加する前に必ず直前のイテレーションが注入した分だけを正確に取り除くため、バッチ内で使われた全LoRAが蓄積されることはありません。「LoRAノードをバイパス」がチェックされている間は自動的に無効化されます",
helpLab18: "キーフレームセルはシングルクリックで選択(青い枠線)に変わり、開くにはダブルクリックが必要になりました。各カラムのヘッダー(Model/Prompt/Ksampler)には▲/▼ボタンもあり、選択中のキーフレームを隣接するものと入れ替えて、入力し直すことなく並び順を変更できます。キーフレーム#1(ベースライン)は移動できず、他のキーフレームが#1の位置に入れ替わることもありません",
helpLab19: "Promptカラムヘッダーの PG ボタン:Promptタブのプリセットグループ(Tableビューの Presets Group、Batchタブのチェックリストと同じグループ)を1つ選ぶと、Prompt列全体をそのグループの並び順で1プリセットにつき1キーフレームへ置き換えます(#1から開始、#1は上書きで追加ではありません)。グループのプリセット数が現在のBatch数を超える場合はBatch数を自動的に引き上げます(上限50、Batch入力欄自体の上限と同じ)。それでも収まらない分は静かに削除されず、通常の「Batch数を超えたキーフレーム」警告が表示されます",
helpLabCardPlanTitle: "Settingサブタブ — 実行とプランファイル",
helpLabPlan1: "右ペイン — Batch:実行する回数。Note:プランと一緒に保存される自由記述のメモ",
helpLabPlan2: "Run/Pause/Cancel:Runでバッチループを開始、Pause/Resumeで回と回の間を一時停止・再開、Cancelで現在の生成を中断してループを止めます",
@@ -2164,6 +2187,7 @@ const LANGUAGES = {
helpPrompt23: "Wildcardsテーブル — Formタブのワイルドカードファイルマネージャーと同じファイル一覧です。File列のパスやExtドロップダウンを編集するとファイル名が変更されます(新しい名前で内容を保存してから、古いファイルを削除します)",
helpPrompt24: "Styleテーブル — Formタブのスタイル管理と同じスタイル一覧で、Presetsと同様にインライン編集できます",
helpPrompt25: "Presetsテーブルのツールバー — 検索ボックス横の★とBソートボタンで、お気に入り/Batch登録済みのプリセットを一覧の先頭に並べ替えます。両方同時にONにでき、その場合は★が優先、Bが次点の基準になり、それ以外は元の相対順序を維持します",
helpPrompt26: "Styleテーブルのツールバー — Fileバッジがcustom.jsonではない行を1件だけ選択すると「+ Add to this file」が有効になります。同じファイルを追加先とする空の行を追加します(保存前からFile列にバッジで表示されます)— Formタブのスタイルマネージャーと同じ機能です(上記参照)。custom.jsonのスタイルや複数選択時はボタンが無効のままです。その場合は通常の「+ New Style」を使ってください",
helpSettings1: "UI言語と要約言語の設定",
helpSettings2: "テーマ選択(13種プリセット)+カスタマイズ:カラー調整、背景パターン(ストライプ、ポルカドット、チェック、SVGタイリング)、フォント選択(日本語デザインフォント含む16種のGoogle Fonts)",
helpSettings3: "ワークフローデータフォルダのパス変更・リセット",
@@ -2857,6 +2881,15 @@ const LANGUAGES = {
labT2IImageIgnored: "T2I模式已开启,无需上传图片,已跳过",
labIndexImageSaved: (filename) => `索引图片已保存到Output:${filename}`,
labIndexImageSaveFailed: "索引图片保存到Output失败",
labPromptGroupBtnTitle: "应用提示词组",
labPromptGroupModalTitle: "提示词组",
labPromptGroupEmpty: "尚无分组。请在Prompt标签的分组面板中创建。",
labPromptGroupCount: (n) => `${n} 个预设`,
labPromptGroupSelectFirst: "请先选择一个分组",
labPromptGroupNoPresets: "该分组没有预设",
labPromptGroupApplied: (name, n) => `已将"${name}"(${n}个关键帧)应用到Prompt`,
labPromptGroupBatchRaised: (n) => `已将Batch数量提高到${n}以适应该分组`,
labSelectKeyframeFirst: "请先选择一个关键帧",
// -- GenerateUI标签页 Input子标签: Image内占位图 --
i2iPlaceholderTitle: "占位图片",
@@ -3405,6 +3438,8 @@ const LANGUAGES = {
helpLab15: "Checkpoint/LoRA/VAE与其他列采用完全相同的实际生效值规则(见上文),各自独立向后延续:其中一项的关键帧不会使另外两项恢复为工作流原始设置。在编辑弹窗中,若某字段留空,且同一列表中更早的关键帧已设置过值,其占位符会显示「(继承: ...)」而不是「(保持工作流原设置)」,方便确认实际会应用的值。「恢复第1次的设置」和Bypass与+/-一样,只会作用于当前C/L/V切换选中的那一项,不会影响另外两项",
helpLab16: "绕过LoRA节点复选框(仅LoRA关键帧自己的编辑弹窗中):在应用时强制将该关键帧的strength_model/strength_clip设为0,替代ComfyUI原生的节点Bypass(mode:4)——这里使用的工作流已转换为API格式,不带mode概念,因此将强度归零在效果上是等价的。勾选后会禁用强度输入框;与上方行级别的Bypass复选框(见helpLab13)相互独立,后者只是跳过整行而不会改动节点本身",
helpLab17: "将LoRA语法和触发词应用到正面提示词复选框(仅LoRA列):勾选后,会在应用时以逗号分隔的形式,将<lora:name:strengthModel:strengthClip>及该LoRA缓存的CivitAI触发词追加到正面提示词——格式与GenerateUI的Model标签页Apply按钮写入的完全一致。切换关键帧时(更换为另一个LoRA、取消勾选此复选框,或该行被Bypass)总会先精确移除上一次迭代注入的内容,再添加新内容,因此批次不会累积用过的所有LoRA。勾选「绕过LoRA节点」时会自动禁用",
helpLab18: "单击关键帧单元格现在只是选中它(蓝色描边),不再直接打开编辑弹窗——需要双击才能打开编辑弹窗。每列的表头(Model/Prompt/Ksampler)新增了▲/▼按钮,可将选中的关键帧与相邻的关键帧互换位置,从而在不重新输入内容的情况下调整顺序;关键帧#1(基准行)无法移动,也不会有其他关键帧被换到#1的位置",
helpLab19: "Prompt列表头的PG按钮:选择Prompt标签中的一个预设分组(Table视图中的Presets Group,与Batch标签复选列表使用的是同一批分组),即可将整个Prompt列替换为该分组内每个预设对应一个关键帧、按分组顺序排列(从#1开始,#1会被覆盖而不是在其后追加)。如果分组中的预设数量超过当前Batch数量,会自动提高Batch数量以容纳(上限为50,与Batch输入框本身的上限一致);仍然超出的部分不会被静默丢弃,而是照常显示「关键帧超出Batch数量」的提示",
helpLabCardPlanTitle: "Setting子标签 — 运行与方案文件",
helpLabPlan1: "右侧面板 — Batch:要运行的迭代次数;Note:与方案一起保存的自由备注",
helpLabPlan2: "Run/Pause/Cancel:Run开始批量循环;Pause/Resume在各次迭代之间暂停/继续;Cancel会中断当前生成并停止循环",
@@ -3448,6 +3483,7 @@ const LANGUAGES = {
helpPrompt23: "Wildcards表格 — 与Form标签的通配符文件管理器使用相同的文件列表;编辑File列的路径或Ext下拉框会重命名文件(先以新名称保存内容,再删除旧文件)",
helpPrompt24: "Style表格 — 与Form标签的Style管理器使用相同的Style列表,可像Presets一样进行内联编辑",
helpPrompt25: "Presets表格工具栏 — 搜索框旁边的★和B排序按钮,可将收藏/已加入Batch的预设排到列表顶部;两者可同时启用(★优先,B为次要条件),其余项保持原有的相对顺序",
helpPrompt26: "Style表格工具栏——只选中一行且其File徽标不是custom.json时,「+ Add to this file」按钮才会启用:会添加一个以该文件为目标的空白行(保存前File列就会显示该文件的徽标)——与Form标签中Style管理器的同一功能(见上文)。custom.json条目或多选时按钮保持禁用,此时请改用常规的「+ New Style」按钮",
helpSettings1: "UI语言和摘要语言设置",
helpSettings2: "主题选择(13种预设)+ 自定义:颜色调整、背景图案(条纹、波点、棋盘格、SVG平铺)、字体选择(含日文显示字体在内的16种Google Fonts)",
helpSettings3: "工作流数据文件夹路径更改/重置",
+147 -3
View File
@@ -16,6 +16,7 @@ import { escapeHtml, embedPngTextChunk, getEagleSettings, saveToEagle, setupSear
import { extractAllMetadata, readAllPNGTextChunks } from "./metadata-tab.js";
import { syncJsonHighlight, syncScroll } from "./json-highlight.js";
import { _expandWildcardsInWorkflow } from "./generate-tab.js";
import { pmGroups, getPresetsInGroup } from "./prompt-presets.js";
// Checkpoint/LoRA/VAE are three fully independent keyframe timelines — same as
// Prompt/KSampler — each with its own +/-, its own atIteration sequence, its own
@@ -128,6 +129,13 @@ let _lastGeneratedImageRef = null; // ComfyUI "name [type]" annotated ref of the
// with the plan and simply resets to "checkpoint" on page load.
let _modelViewMode = "checkpoint";
// Single-click-selected keyframe index per real column key (checkpoint/lora/vae/prompt/
// ksampler) — used by that column's up/down reorder buttons. A single click selects
// (this object); a double click still opens the edit modal directly, bypassing
// selection. Not part of the Plan data — resets whenever columns are replaced wholesale
// (plan load/clear, Prompt Group apply) so a stale index never points past the new array.
let _selectedIdx = {};
// ============================================
// Init
// ============================================
@@ -137,6 +145,8 @@ export function initLabTab() {
_initPlanDropZone();
_initSubtabToggle();
_initColumnButtons();
_initReorderButtons();
_initPromptGroupButton();
_initModelViewToggle();
_initRunControls();
_initPlanButtons();
@@ -400,6 +410,133 @@ function _initColumnButtons() {
});
}
// Single click on a cell selects it (for the up/down reorder buttons below) instead of
// opening the edit modal — opening now requires a double click (_renderColumn wires
// both listeners on the same cell).
function _selectCell(col, idx) {
_selectedIdx[col] = idx;
_renderColumnForKey(col);
}
// Up/down buttons: swap the selected keyframe with its immediate array neighbor. Row 1
// (idx 0, the baseline) can never move and nothing can be swapped into its slot — it has
// no atIteration input of its own and drives the "live GenerateUI value" display, so
// letting another keyframe take its place would silently change that keyframe's
// behavior. Swapping the two keyframes' atIteration values (rather than reordering the
// array directly) keeps each object's own value permanently paired with its own
// atIteration field; re-deriving the array order from those swapped values below is
// then just "swap array position to match", not a re-sort of the whole column.
function _initReorderButtons() {
document.querySelectorAll(".wfm-lab-col-up").forEach((btn) => {
btn.addEventListener("click", () => _moveSelectedKeyframe(_resolveColumnKey(btn.dataset.col), -1));
});
document.querySelectorAll(".wfm-lab-col-down").forEach((btn) => {
btn.addEventListener("click", () => _moveSelectedKeyframe(_resolveColumnKey(btn.dataset.col), 1));
});
}
function _moveSelectedKeyframe(col, direction) {
const kfs = _lab.columns[col];
const idx = _selectedIdx[col];
if (idx == null || idx >= kfs.length) { // unselected, or stale after a bulk replace/remove
showToast(t("labSelectKeyframeFirst"), "error");
return;
}
const targetIdx = idx + direction;
if (idx <= 0 || targetIdx <= 0 || targetIdx >= kfs.length) return; // baseline immovable; can't swap past either end
const tmpIter = kfs[idx].atIteration;
kfs[idx].atIteration = kfs[targetIdx].atIteration;
kfs[targetIdx].atIteration = tmpIter;
[kfs[idx], kfs[targetIdx]] = [kfs[targetIdx], kfs[idx]];
_selectedIdx[col] = targetIdx;
_renderColumnForKey(col);
}
// "PG" button on the Prompt column header: lets the user pick one of the Prompt tab's
// preset groups (pmGroups, defined in prompt-presets.js) and replace the ENTIRE Prompt
// column with one keyframe per preset in the group, in group order, starting at
// iteration #1 (which is overwritten, not appended to).
function _initPromptGroupButton() {
const btn = document.getElementById("wfm-lab-prompt-group-btn");
if (btn) btn.title = t("labPromptGroupBtnTitle");
btn?.addEventListener("click", () => _openPromptGroupModal());
}
function _openPromptGroupModal() {
const groupNames = Object.keys(pmGroups).sort();
const listHtml = groupNames.length === 0
? `<div class="wfm-pm-empty">${t("labPromptGroupEmpty")}</div>`
: groupNames.map((g) => {
const count = getPresetsInGroup(g).length;
return `<div class="wfm-pm-item wfm-lab-pg-item" data-group="${escapeHtml(g)}">
<div class="wfm-pm-item-body">
<div class="wfm-pm-item-name">${escapeHtml(g)}</div>
<div class="wfm-pm-item-sub">${t("labPromptGroupCount", count)}</div>
</div>
</div>`;
}).join("");
const html = `
<div id="wfm-lab-pg-list">${listHtml}</div>
<div style="display:flex;gap:8px;margin-top:12px;justify-content:flex-end;">
<button id="wfm-lab-pg-apply" class="wfm-btn wfm-btn-primary" disabled>${t("labApply")}</button>
</div>`;
openModal(t("labPromptGroupModalTitle"), html);
let selectedGroup = null;
const applyBtn = document.getElementById("wfm-lab-pg-apply");
document.querySelectorAll(".wfm-lab-pg-item").forEach((el) => {
el.addEventListener("click", () => {
document.querySelectorAll(".wfm-lab-pg-item").forEach((o) => o.classList.remove("active"));
el.classList.add("active");
selectedGroup = el.dataset.group;
if (applyBtn) applyBtn.disabled = false;
});
});
applyBtn?.addEventListener("click", () => {
if (!selectedGroup) { showToast(t("labPromptGroupSelectFirst"), "error"); return; }
_applyPromptGroupToLab(selectedGroup);
});
}
// Full replacement of _lab.columns.prompt: one keyframe per preset in the group, in
// group order, atIteration 1..N — #1 is overwritten (never appended after), matching
// how every other "bulk load" action on Lab (e.g. plan load) replaces rather than merges.
function _applyPromptGroupToLab(groupName) {
const presets = getPresetsInGroup(groupName);
if (presets.length === 0) { showToast(t("labPromptGroupNoPresets"), "error"); return; }
// Batch input caps at 50 (see templates/index.html); raise batchCount to fit the
// group up to that cap, same as the existing keyframe-beyond-batch warning handles
// anything past it (see _warnIfKeyframesExceedBatch below) rather than silently
// dropping presets past #50.
if (presets.length > _lab.batchCount) {
_lab.batchCount = Math.min(presets.length, 50);
const batchEl = document.getElementById("wfm-lab-batch-count");
if (batchEl) batchEl.value = _lab.batchCount;
showToast(t("labPromptGroupBatchRaised", _lab.batchCount), "info");
}
_lab.columns.prompt = presets.map((p, idx) => ({
atIteration: idx + 1,
value: {
positive: p.text || p.posText || "",
negative: p.negText || "",
styleApplied: false,
styleName: "",
},
revertToBase: false,
bypassed: false,
}));
delete _selectedIdx.prompt; // stale selection would point past the freshly replaced array
_renderColumnForKey("prompt");
_warnIfKeyframesExceedBatch();
closeModal();
showToast(t("labPromptGroupApplied", groupName, presets.length), "success");
}
// Wires the Model column header's C/L/V buttons — switches which independent field
// (checkpoint/lora/vae) the shared cell list, +/-, and cell-click modal all operate on.
// Purely a display/routing selector: none of the three keyframe arrays are touched by
@@ -464,8 +601,12 @@ function _renderColumn(col, containerId = `wfm-lab-col-cells-${col}`) {
}
const keyframes = _lab.columns[col];
container.innerHTML = keyframes.map((kf, idx) => _cellHtml(col, kf, idx)).join("");
// Single click selects (for the up/down reorder buttons); double click still opens
// the edit modal directly, independent of whatever is currently selected.
container.querySelectorAll(".wfm-lab-cell").forEach((el) => {
el.addEventListener("click", () => _openCellModal(col, parseInt(el.dataset.idx, 10)));
const idx = parseInt(el.dataset.idx, 10);
el.addEventListener("click", () => _selectCell(col, idx));
el.addEventListener("dblclick", () => _openCellModal(col, idx));
});
}
@@ -485,6 +626,7 @@ function _cellHtml(col, kf, idx) {
const revertClass = kf.revertToBase ? " wfm-lab-cell-revert" : "";
const bypassClass = kf.bypassed ? " wfm-lab-cell-bypassed" : "";
const nodeBypassClass = (col === "lora" && kf.value?.nodeBypass) ? " wfm-lab-cell-node-bypassed" : "";
const selectedClass = _selectedIdx[col] === idx ? " wfm-lab-cell-selected" : "";
if (idx === 0) {
// Bypassed takes priority over the live-reflect display — an explicit "skip this
// row" toggle shouldn't be masked by Setting 1's usual "show the workflow's
@@ -492,13 +634,13 @@ function _cellHtml(col, kf, idx) {
const live = !kf.bypassed && _isLiveDisplay(col, idx);
const liveClass = live ? " wfm-lab-cell-live" : "";
const label = live ? _cellLabel(col, { value: _liveValueFor(col), revertToBase: false, bypassed: false }) : _cellLabel(col, kf);
return `<div class="wfm-lab-cell${revertClass}${bypassClass}${nodeBypassClass}${liveClass}" data-idx="${idx}">
return `<div class="wfm-lab-cell${revertClass}${bypassClass}${nodeBypassClass}${liveClass}${selectedClass}" data-idx="${idx}">
<span class="wfm-lab-cell-index">${kf.atIteration}:</span>
<span class="wfm-lab-cell-value">${label}</span>
</div>`;
}
// Iteration #2 and beyond: value on its own line, applied-at iteration below it
return `<div class="wfm-lab-cell${revertClass}${bypassClass}${nodeBypassClass}" data-idx="${idx}">
return `<div class="wfm-lab-cell${revertClass}${bypassClass}${nodeBypassClass}${selectedClass}" data-idx="${idx}">
<div class="wfm-lab-cell-value">${_cellLabel(col, kf)}</div>
<div class="wfm-lab-cell-applied">${t("labAppliedAt", kf.atIteration)}</div>
</div>`;
@@ -1517,6 +1659,7 @@ function _applyPlanData(filename, data) {
_lab.workflowFilename = data.workflow_filename || null;
_lab.columns = _migrateLabColumns(data.columns);
_lab.results = { images: (data.results?.images || []).slice(0, MAX_RESULTS) };
_selectedIdx = {}; // every column's array was just replaced wholesale
_updatePlanWorkflowUI();
_updateT2IModeUI();
@@ -1596,6 +1739,7 @@ async function _loadPlanFromServer(filename) {
function _clearPlan() {
if (!window.confirm(t("labConfirmClear"))) return;
_lab = _emptyLabState();
_selectedIdx = {};
const noteEl = document.getElementById("wfm-lab-note");
const batchEl = document.getElementById("wfm-lab-batch-count");
+7
View File
@@ -208,6 +208,13 @@ function matchesSearch(p) {
(p.tags || []).some(t => t.toLowerCase().includes(s));
}
// Ordered list of actual preset objects for a group (stale ids already filtered out by
// loadAllPresets, but this is defensive for callers that read pmGroups directly too).
export function getPresetsInGroup(groupName) {
const ids = pmGroups[groupName] || [];
return ids.map(id => promptPresets.find(p => p.id === id)).filter(Boolean);
}
export function isInBatchPreset(id) {
return (pmGroups["Batch"] || []).includes(id);
}
+29 -5
View File
@@ -768,6 +768,7 @@ function openWildcardPromptModal(file) {
let tableStyles = [];
let stylesSearch = "";
let pendingNewStyle = false;
let pendingNewStyleFile = null; // null = default custom.json; set by "+ Add to this file"
const selectedStyleNames = new Set();
function styleMatchesSearch(s) {
@@ -781,9 +782,18 @@ function styleMatchesSearch(s) {
function updateStylesDeleteBtn() {
const btn = document.getElementById("wfm-ptable-style-delete-btn");
const deselectBtn = document.getElementById("wfm-ptable-style-deselect-btn");
const addFileBtn = document.getElementById("wfm-ptable-style-addfile-btn");
const n = selectedStyleNames.size;
if (btn) { btn.disabled = n === 0; btn.textContent = n > 0 ? `Delete (${n})` : "Delete"; }
if (deselectBtn) deselectBtn.disabled = n === 0;
// 「このファイルへ追加」は選択が1件かつcustom.json以外のファイル由来のときだけ有効
// (prompt-styles.js の Form 版と同じ制約 — custom.jsonは既に「+ New Style」で追加可能)
if (addFileBtn) {
const single = n === 1 ? tableStyles.find(s => selectedStyleNames.has(s.name)) : null;
const targetFile = (single?.file && single.file !== "custom.json") ? single.file : "";
addFileBtn.disabled = !targetFile;
addFileBtn.dataset.targetFile = targetFile;
}
}
async function loadStylesTable() {
@@ -841,11 +851,14 @@ function buildStyleRow(style, index) {
tr.appendChild(tdName);
const tdFile = document.createElement("td");
if (style?.file) {
// 新規行は保存先未定(=custom.json)なら空欄のまま、「このファイルへ追加」経由なら
// pendingNewStyleFile を保存前からバッジ表示して、どこに追加されるか分かるようにする
const fileForBadge = style?.file || (isNew ? pendingNewStyleFile : null);
if (fileForBadge) {
const badge = document.createElement("span");
badge.className = "wfm-prompt-edit-file-badge";
badge.title = style.file;
badge.textContent = style.file;
badge.title = fileForBadge;
badge.textContent = fileForBadge;
tdFile.appendChild(badge);
}
tr.appendChild(tdFile);
@@ -872,9 +885,10 @@ function buildStyleRow(style, index) {
addBtn.addEventListener("click", async () => {
const name = nameInput.value.trim();
if (!name) { showToast(t("pleaseEnterStyleName"), "error"); nameInput.focus(); return; }
const result = await styleApiCreate(name, posTA.value, negTA.value, null);
const result = await styleApiCreate(name, posTA.value, negTA.value, pendingNewStyleFile);
if (result.ok) {
pendingNewStyle = false;
pendingNewStyleFile = null;
await loadStylesTable();
await styleRefreshList();
await refreshStylesList();
@@ -883,7 +897,7 @@ function buildStyleRow(style, index) {
showToast(t("errorWithMsg", result.error), "error");
}
});
cancelBtn.addEventListener("click", () => { pendingNewStyle = false; renderStylesTable(); });
cancelBtn.addEventListener("click", () => { pendingNewStyle = false; pendingNewStyleFile = null; renderStylesTable(); });
} else {
const saveStyleRow = async (changedEl) => {
const nameNow = nameInput.value.trim();
@@ -1073,6 +1087,16 @@ export function initPromptTableTab() {
document.getElementById("wfm-ptable-style-add-btn")?.addEventListener("click", () => {
if (pendingNewStyle) return;
pendingNewStyle = true;
pendingNewStyleFile = null;
renderStylesTable();
document.querySelector("#wfm-ptable-style-tbody input")?.focus();
});
document.getElementById("wfm-ptable-style-addfile-btn")?.addEventListener("click", (e) => {
if (pendingNewStyle) return;
const targetFile = e.currentTarget.dataset.targetFile;
if (!targetFile) return;
pendingNewStyle = true;
pendingNewStyleFile = targetFile;
renderStylesTable();
document.querySelector("#wfm-ptable-style-tbody input")?.focus();
});
+11
View File
@@ -567,6 +567,8 @@
</div>
</div>
<div class="wfm-lab-col-btns">
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-up" data-col="model" title="Move selected keyframe up">▲</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-down" data-col="model" title="Move selected keyframe down">▼</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-add" data-col="model" title="Add keyframe">+</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-remove" data-col="model" title="Remove last keyframe">-</button>
</div>
@@ -577,6 +579,9 @@
<div class="wfm-lab-col-header">
<span>プロンプト</span>
<div class="wfm-lab-col-btns">
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-up" data-col="prompt" title="Move selected keyframe up">▲</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-down" data-col="prompt" title="Move selected keyframe down">▼</button>
<button type="button" id="wfm-lab-prompt-group-btn" class="wfm-btn wfm-btn-xs" title="Apply Prompt Group">PG</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-add" data-col="prompt" title="Add keyframe">+</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-remove" data-col="prompt" title="Remove last keyframe">-</button>
</div>
@@ -587,6 +592,8 @@
<div class="wfm-lab-col-header">
<span>Ksampler</span>
<div class="wfm-lab-col-btns">
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-up" data-col="ksampler" title="Move selected keyframe up">▲</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-down" data-col="ksampler" title="Move selected keyframe down">▼</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-add" data-col="ksampler" title="Add keyframe">+</button>
<button type="button" class="wfm-btn wfm-btn-xs wfm-lab-col-remove" data-col="ksampler" title="Remove last keyframe">-</button>
</div>
@@ -1277,6 +1284,7 @@
<span style="flex:1;"></span>
<button id="wfm-ptable-style-deselect-btn" class="wfm-btn wfm-btn-sm" disabled title="Clear row selection">Deselect</button>
<button id="wfm-ptable-style-delete-btn" class="wfm-btn wfm-btn-sm wfm-btn-danger" disabled>Delete</button>
<button id="wfm-ptable-style-addfile-btn" class="wfm-btn wfm-btn-sm" disabled title="Select a style whose file is not custom.json to add a new style to that same file">+ Add to this file</button>
<button id="wfm-ptable-style-add-btn" class="wfm-btn wfm-btn-sm wfm-btn-primary">+ New Style</button>
</div>
<div class="wfm-prompt-table-scroll">
@@ -1512,6 +1520,8 @@
<li id="wfm-help-lab-15">Checkpoint / LoRA / VAE each carry forward independently, the same effective-value rule as every other column (see above): a keyframe in one never resets the other two to the workflow default. A field left blank in the edit modal shows "(inherits: ...)" as its placeholder instead of "(workflow default)" when an earlier keyframe in that same list already set something, so it's clear what actually applies. "Revert to #1's setting" and Bypass — like +/- — only ever affect whichever ONE of the three is currently selected by the C/L/V toggle, never the other two</li>
<li id="wfm-help-lab-16">Bypass LoRA node checkbox (LoRA keyframe's own edit modal only): forces that keyframe's strength_model/strength_clip to 0 at apply-time, standing in for ComfyUI's own node Bypass (mode:4) — the workflow used here is already converted to API format, which has no mode concept, so zeroing strength is the behavioral equivalent. Disables the strength fields while checked; independent of the row-level Bypass checkbox above, which skips the whole row instead of touching the node</li>
<li id="wfm-help-lab-17">Apply LoRA syntax + trigger words to Positive prompt checkbox (LoRA column only): when checked, appends &lt;lora:name:strengthModel:strengthClip&gt; plus that LoRA's cached CivitAI trigger words to the Positive prompt, comma-separated, at apply-time — the same format GenerateUI's own Model tab Apply button writes. Switching keyframes (a different LoRA, this checkbox turned off, or the row Bypassed) always strips exactly what the previous iteration injected before adding anything new, so a batch never accumulates every LoRA it has used. Disabled automatically while Bypass LoRA node is checked</li>
<li id="wfm-help-lab-18">A single click on a keyframe cell selects it (blue outline) instead of opening it — double-click to open the edit modal as before. Each column's header (Model / Prompt / Ksampler) also has <b>&#9650; / &#9660;</b> buttons that swap the selected keyframe with its immediate neighbor to reorder them without retyping anything; keyframe #1 (the baseline) can never move, and nothing can be swapped into its slot</li>
<li id="wfm-help-lab-19">Prompt column header's <b>PG</b> button: pick one of the Prompt tab's preset groups (Table view's Presets Group, the same groups used by the Batch tab's checklist) and replace the entire Prompt column with one keyframe per preset in that group's order, starting at #1 (#1 is overwritten, not appended after). If the group has more presets than the current Batch count, Batch count is raised automatically to fit (capped at 50, the Batch input's own limit); anything still beyond that shows the usual "keyframes beyond Batch count" warning instead of being silently dropped</li>
</ul>
</div>
@@ -1600,6 +1610,7 @@
<li id="wfm-help-prompt-23">Wildcards table — same files as the Form tab's Wildcard file manager; editing the <b>File</b> path or the <b>Ext</b> dropdown renames the file (saves the content under the new name, then removes the old file)</li>
<li id="wfm-help-prompt-24">Style table — same styles as the Form tab's Style manager, editable inline the same way as Presets</li>
<li id="wfm-help-prompt-25">Presets table toolbar — the ★ and B sort buttons (next to the search box) bring favorited / batch-selected presets to the top of the list; both can be enabled together (★ takes priority, B breaks ties), and everything else keeps its original relative order</li>
<li id="wfm-help-prompt-26">Style table toolbar — select exactly one row whose <b>File</b> badge isn't <code>custom.json</code> to enable <b>+ Add to this file</b>: it adds a blank row targeting that same file (shown as a badge in the File column even before saving) — the same capability as the Form tab's Style manager (see above); custom.json entries and multi-row selections leave the button disabled, use the regular <b>+ New Style</b> button for those instead</li>
</ul>
</div>
</div>