Compare commits

...
5 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 5 7274017347 release: v0.5.4 — GenerateUIタブのLTX-2.5/Wan2.2対応 + VideoタブのLTX-2.5/Wan2.2対応・ハイライト表示 + RAW JSON検索の意図しない編集を修正
- GenerateUIタブ: LTX-2.5/Wan2.2ワークフローのPositive/Negative Prompt検出(LTXVDualCFGGuider/
  LTXVConditioning対応)とSettingsタブLatent Image検出(EmptyHunyuanLatentVideo/EmptyLTXVLatentVideo
  + Lengthフィールド)を追加、isVideoWorkflow()の動画タイムアウト判定も拡張
- Videoタブ: 該当項目のラベルをGenerateUI Modelタブと同じ色でハイライト表示する機能を追加
  (Wan2.2など操作不可な項目は非ハイライトのまま)
- 生成UIタブRAW JSON検索: ヒット箇所へのフォーカス/selectionRange設定を廃止し、ハイライト表示のみ
  に変更(検索直後のキー入力で意図せずJSONが編集される問題を修正)
- 別セッションでのVideoタブLTX-2.5/Wan2.2対応(サブグラフ入力labelベースの汎用検出)・MultiType
  ウィジェット脱落バグ修正・動画再生ボリューム保存設定、およびAI Assistant設定のUnsloth対応・
  Prompt/Tagger独立モーダル化・モデルアンロード機能を本リリースに統合
- ヘルプ(index.html/i18n.js 3言語/app.js helpIdMap)とREADME.md/DEVLOG.mdを更新

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 16:50:30 +09:00
ketle-manandClaude Sonnet 5 b94ab48ca4 AI Assistant設定をUnsloth対応+Prompt/Tagger独立モーダル化、モデルアンロード機能を追加
- Prompt AI/Tagger VLMにUnslothバックエンドを追加(サーバー側プロキシでAPIキー付与)
- Taggerタブ: Ollama直呼び出しを廃止しOllama/LM Studio/Lemonade/Unsloth共通のvlm_models/vlm_predictに統一、API URL直接入力欄を廃止
- 中央Settingsタブの「AI Assistant Settings」を廃止し、Prompt/Tagger各タブに⚙設定ボタン+モーダル(ai-settings-modal.js)を新設、それぞれ独立したlocalStorageキーで管理
- Thinking mode / Max tokens をPrompt/Tagger双方の生成呼び出しに反映(Tagger側はPython側のvlm_predictにも反映)
- Ollama/LM Studio/Lemonadeのモデルアンロード機能を追加(AI TOOL設定にもUnloadボタンを追加、Unslothは非対応として明示)
- ヘルプタブ(Prompt/Settings/AI TOOL/Tagger)の説明文を新仕様に合わせて更新(EN/JA/ZH)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 13:17:03 +09:00
ketle-manandClaude Sonnet 5 ed3512d269 ci: publish-node-actionのバージョンをSHA固定(サプライチェーン対策)
@mainの可変ブランチ参照はComfy-Org/publish-node-actionが更新された際に
挙動が変わりうるため、リリースタグ1.0.1のコミットSHAに固定する。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 10:24:53 +09:00
ketle-manandClaude Sonnet 5 9ed91e64f8 Video: LTX-2.5 / Wan2.2対応 + 動画音量の保存設定を追加
- VideoタブがLTX-2.5 (Text/Image/First&Last-Frame to Video) とWan2.2 (Text to
  Video) を検出・読み込み・生成できるよう汎用化。従来MiniMax H3専用だったノード
  検出/フォーム反映ロジックを、サブグラフが公開する入力のlabelベースで意味的に
  スロットを特定する方式に一般化した
- convertUiToApi(): object_infoの複合型宣言(例 "FLOAT,INT")がウィジェット名
  リストから丸ごと脱落し、後続ウィジェットの値がずれるバグを修正。
  LTXVEmptyLatentAudio.batch_sizeに誤った値が注入され動画生成が
  "Expected size 1 but got size 25" で失敗する原因だった
- Videoタブのminimax_test.json自動読み込みを廃止(同梱していないため)
- 動画再生ボリュームを設定タブに追加し、Video/Galleryの全プレーヤー間で
  保存・共有されるようにした(動画を切り替えるたびに最大音量へ戻る問題を解消)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-29 00:51:09 +09:00
ketle-manandClaude Sonnet 5 c0db7374b7 release: v0.5.3 — Labタブのワークフロー切替時の表示残留を修正 + Galleryタブ読み込み高速化・rootフォルダ自動展開 + READMEスクリーンショット刷新
- Labタブ: ワークフロー読み込み時、Labサブタブが既にアクティブでも
  Setting 1のライブ反映セルを再描画するよう修正(前ワークフローの表示残留を解消)
- Galleryタブ: フォルダスキャン時の不要なPath.resolve()呼び出しを除去し
  9,777枚のフォルダで7.5秒→0.14秒に高速化。os.walk()ベースの再帰スキャンも
  DirEntryベースに書き換え
- Galleryタブ: フォルダツリーのrootをデフォルト展開状態に変更
- README: スクリーンショット5件を削除、Video/Lab/AI TOOLタブの新規4枚を追加

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-28 16:08:24 +09:00
33 changed files with 1053 additions and 585 deletions
+1 -1
View File
@@ -17,6 +17,6 @@ jobs:
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
uses: Comfy-Org/publish-node-action@d2366e7abb6ab16f3bb03e3520ae25c8cf749bc9 # 1.0.1
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+2
View File
@@ -2,6 +2,8 @@
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.5.4** — 機能追加: Video/GenerateUIタブのLTX-2.5・Wan2.2対応拡大 + AI Assistant設定のUnsloth対応・独立モーダル化・モデルアンロード機能
- **v0.5.3** — バグ修正: Labタブのワークフロー切替時に前の内容が残留 + Galleryタブの読み込み高速化・root自動展開 + READMEスクリーンショット刷新
- **v0.5.2** — 機能追加: GenerateUI/Labタブの動画ワークフロー対応 + VideoタブにFrame抽出/GIF変換機能 + データ管理監査とZIPフルバックアップ + Send to LI node統一
- **v0.5.1** — 機能追加: mp4動画の埋め込みメタデータ対応(Gallery Prompt/JSON・Metadataサブタブ・サイドパネルIタブ)+ Gallery Infoタブに寸法/再生時間表示 + MiniMax H3等オールインワン動画ノードのプロンプト抽出バグ修正
- **v0.5.0** — 機能追加: mp4動画Gallery対応 + Videoタブ新設(MiniMax H3専用) + バグ修正: Galleryのタグ/メモが再起動後に消える
+57
View File
@@ -2,6 +2,63 @@
---
## v0.5.4
### 機能追加: Video/GenerateUIタブのLTX-2.5・Wan2.2対応拡大 + AI Assistant設定のUnsloth対応・独立モーダル化・モデルアンロード機能
複数セッションにまたがり実施された作業をまとめてリリース。Videoタブが従来MiniMax H3専用だった検出/生成ロジックをLTX-2.5・Wan2.2にも対応させ、続けて生成UIタブ側の解析ロジックにも同じ2ファミリーへの対応を追加した。並行してAI Assistant設定(Prompt/Tagger)をUnslothバックエンド対応・タブ別モーダル化・モデルアンロード機能へ刷新した。
**1. Videoタブ: LTX-2.5 / Wan2.2対応(ノード検出の汎用化)**: 従来MiniMax H3専用だったサブグラフ検出/フォーム反映ロジックを、サブグラフが公開する入力のlabel(無ければname)ベースで意味的にスロットを特定する方式に一般化した。MiniMax H3/LTX-2.5系は内部ノード型のプレフィックス(`LTXV*`等)で、Wan2.2は該当する固有ノード型を持たないためサブグラフ名自体("...(Wan2.2)"表記)で家系を判定する。これによりVideoタブの「Load in Video」からLTX-2.5のText/Image/First&Last-Frame to VideoワークフローとWan2.2のText to Videoワークフローも読み込み・生成できるようになった。同梱していない`minimax_test.json`の自動読み込みも廃止。
**2. バグ修正: convertUiToApi()のMultiTypeウィジェット脱落**: object_infoが複合型(例: `LTXVEmptyLatentAudio.frame_rate: "FLOAT,INT"`)を宣言している入力が、単純な完全一致判定(`upper === "INT" || ...`)に引っかからずウィジェット名/型リストから丸ごと脱落し、後続ウィジェットの値が1つずつずれる問題を発見・修正した。実際に`LTXVEmptyLatentAudio.batch_size`にframe_rateの値が誤って書き込まれ、動画生成が"Expected size 1 but got size 25"で失敗する原因になっていた。`_resolveWidgetType()`を新設し、カンマ区切りの型宣言から実際にウィジェットスロットを占める単一のスカラー型を解決するよう修正。
**3. 動画再生ボリュームの保存設定**: 動画を切り替えるたびに音量が最大へ戻ってしまう問題を解消するため、設定タブに音量設定を追加しVideo/Galleryタブの全プレーヤー間で保存・共有されるようにした。
**4. GenerateUIタブ: LTX-2.5 / Wan2.2対応(プロンプト検出・Latent Image・タイムアウト)**: Videoタブとは独立した解析経路(`analyzeWorkflow()`、フラット化済みAPI形式ワークフローを解析)側でも同じ2ファミリーの通常ワークフロー読み込みに対応させる作業。実機確認したところ、Model タブ(Checkpoint/VAE/Diffusion Model/Text Encoder/LoRA)は既存の`UNETLoader`/`CLIPLoader`/`VAELoader`ベースの汎用検出でWan2.2/LTX-2.5とも既に問題なく動作していたが、次の2点に不備を発見した。
- **Positive/Negative Prompt検出(LTX-2.5)**: LTX-2.5は`LTXVDualCFGGuider`(positive/negativeが同一の`LTXVConditioning`ノードの別出力スロットを指す)+ `LTXVConditioning`(自身のpositive/negative入力を介して実際のプロンプトソースへ分岐)という専用ノード構成を使うため、既存の`CFGGuider`/`InstructPixToPixConditioning`向けロール伝播ロジックでは拾えず、Positive/Negative Promptが空欄のままSaveVideoノードへのフォールバック表示になっていた。`LTXVDualCFGGuider`をロール伝播の起点に、`LTXVConditioning`を`InstructPixToPixConditioning`と同型の分岐伝播ノードとして追加し解決した。
- **Latent Image検出(Wan2.2・LTX-2.5共通)**: SettingsタブのLatent Imageセクションが`EmptyLatentImage`/`EmptySD3LatentImage`/`EmptyFlux2LatentImage`のみ対応しており、Wan2.2の`EmptyHunyuanLatentVideo`とLTX-2.5の`EmptyLTXVLatentVideo`が未対応で「No EmptyLatentImage node found」表示になっていた。両ノード型を追加し、動画特有の`length`(フレーム数)入力を編集するフィールドも新設した(Duration×FPSの数式ノードにリンクされ非リテラルなことが多いため、Width/Height同様「linked」表示にフォールバックする)。
- あわせて`isVideoWorkflow()`(生成タイムアウトを30分に延長する判定)を、`SaveVideo`/`CreateVideo`ノードや動画用latentノードの存在でも判定できるよう拡張した。従来はMiniMax H3のようなオールインワン`*ToVideo`ノードの有無でしか判定できず、LTX-2.5/Wan2.2は通常の静止画と同じ短いタイムアウトで打ち切られる恐れがあった。
**5. Videoタブ左パネルのハイライト表示**: GenerateUIのModelタブが持つ「ワークフローに実際に該当する項目のラベルをハイライト」する仕組み(`wfm-model-label-active`クラス、設定タブでカスタマイズ可能な共通色)をVideoタブの左パネルにも適用した。Prompt/Durationは常時、First Frame/Last Frameはサブグラフがそのスロットを公開している場合のみ、Aspect Ratio/Megapixels/MultipleはResolutionSelectorノードが存在する場合のみハイライトする — Wan2.2のように該当ノードがなく操作不可(disabled)な項目は、既存の無効化表示と矛盾しないよう非ハイライトのままにした。
**6. バグ修正: 生成UIタブRAW JSON検索がヒット箇所にカーソルを当てて不意に編集させてしまう**: 検索でヒットした際に`editor.focus()` + `setSelectionRange()`でテキストエリアへフォーカス・選択範囲を作っていたため、検索直後にキー入力すると選択範囲が上書きされ意図せずJSONが書き換わってしまう問題があった。ハイライト表示(`<mark>`によるオーバーレイ)とスクロール追従は維持しつつ、フォーカス移動と選択状態の作成のみを取りやめ、編集はユーザーが明示的にエディタをクリックした場合のみに限定した。
**7. AI Assistant設定: Unsloth対応・Prompt/Tagger独立モーダル化・モデルアンロード機能**: Prompt AI(Prompt タブ)とTagger VLM(Taggerタブ)にUnslothバックエンドを追加した(サーバー側プロキシでAPIキーを付与)。Taggerタブは従来Ollama直呼び出しだった実装を、Ollama/LM Studio/Lemonade/Unslothの4バックエンド共通の`vlm_models`/`vlm_predict`エンドポイントに統一し、API URL直接入力欄を廃止した。中央Settingsタブにあった単一の「AI Assistant Settings」パネルを廃止し、Prompt/Tagger各タブに⚙設定ボタン+専用モーダル(`ai-settings-modal.js`、Backend/Connection/Model/Generation/Unload/Saveの共通UIコンポーネント)を新設、それぞれ独立した`localStorage`キーで設定を持つように変更した(PromptとTaggerで異なるバックエンド/モデルを使い分けられる)。Thinking mode / Max tokensの設定をPrompt/Tagger双方の生成呼び出しに反映(Tagger側はPython側の`vlm_predict`にも反映)。Ollama(`keep_alive:0`)/LM Studio(`/api/v1/models/unload`)/Lemonade(`/api/v1/unload`)向けのモデルアンロード機能を追加し、AI TOOLタブの設定にもUnloadボタンを追加した(Unslothは対応する公式APIが無いため非対応として明示)。
**8. CI: publish-node-actionのバージョンをSHA固定**: `Comfy-Org/publish-node-action@main`という可変ブランチ参照は、アクション側が更新された際に挙動が変わりうるサプライチェーンリスクのため、リリースタグ1.0.1のコミットSHAに固定するよう`.github/workflows/publish.yml`を修正した([[project_registry_flagged_versions]]で追跡している過去のRegistry Banned/Flagged原因調査の一環)。
**ヘルプ・README更新**: `project_v0336_conventions`の慣習(index.html + i18n.js 3言語 + app.jsのhelpIdMapの3点セット)に従い、GenerateUIタブ(LTX-2.5/Wan2.2対応・RAW JSON検索の挙動)とVideoタブ(ハイライト色機能)のヘルプ本文を英語・日本語・中国語の3言語で追加・更新した(Prompt/Settings/AI TOOL/Taggerタブのヘルプは7番の対応セッション内で既に更新済み)。README.mdはWorkflowタブ(Load in Video対象の拡大)、GenerateUIタブ(MultiTypeバグ修正・LTX-2.5/Wan2.2対応)、Videoタブ(対応ファミリー拡大・ハイライト色・音量設定・見出しバージョン範囲更新)、Settingsタブ(AI Assistant Settings廃止の案内・音量設定・ハイライト色の共有先追記)、Prompt/Taggerタブ(AI Assistant設定のモーダル化・マルチバックエンド化)、AI TOOLタブ(モデルアンロード機能)を更新した。
**検証**: 全JS/Pythonファイルを`node --check`/`ast.parse()`で構文確認。GenerateUIタブのLTX-2.5/Wan2.2対応は、実機ブラウザ(Kapture)でwan22_test.json / ltx_25_test.jsonの2ワークフローを実際に生成UIタブへ読み込み、Positive/Negative Promptの実文表示・Latent Image欄(Width/Height/Batch Size/Length)の表示・ハイライト色の点灯状態をスクリーンショットで確認した。RAW JSON検索のフォーカス修正は、検索実行後にキー入力してもtextareaの値が変化しないことを実機で確認した。開発元gitリポジトリと実行時`custom_nodes`フォルダは別実体のため([[project_dev_deploy_sync]]参照)、変更ファイルを都度両フォルダへ同期しCRLF/LF差異を除いた`diff`で完全一致を確認した。
**How to apply**: `analyzeWorkflow()`のような中央解析関数はワークフロー「ファミリー」が増えるたびに、既存パターン(KSampler系のロール伝播、EmptyLatentImage系のlatentノード検出)と同型の分岐を追加していく設計で拡張できる — 逆に言えば、新しいノード構成(今回のLTXVDualCFGGuider/LTXVConditioningのような「複数出力を持つ1ノードがpositive/negativeを兼ねる」パターン)は`InstructPixToPixConditioning`のような既存の同型ケースを探して倣うと実装が速い。同じワークフローファミリーへの対応が複数タブ(Video/GenerateUI)にまたがる場合、検出ロジック自体は各タブの解析経路(Video: サブグラフを直接歩く、GenerateUI: フラット化済みAPI形式を解析)が別実装なので、片方を直しても他方は直らない — 「Videoタブでは動くのにGenerateUIでは動かない」という状況は、まさにこの二重実装のズレが原因だった。テキストエリアへの自動フォーカス/selectionRangeは、検索・ハイライトのような「見せるだけ」の操作と「編集を許可する」操作を暗黙に混同させるため、ハイライト表示に徹する機能ではフォーカス移動自体を避けるのが安全。
関連: [[project_v050_video_tab]], [[project_dev_deploy_sync]], [[project_v0336_conventions]], [[project_registry_flagged_versions]]
---
## v0.5.3
### バグ修正: Labタブのワークフロー切替時に前の内容が残留 + Galleryタブの読み込み高速化・root自動展開 + READMEスクリーンショット刷新
ユーザーからの複数のバグ報告・改善要望を1セッションで順に対応した作業。
**1. バグ修正: Labタブで起動時デフォルトワークフロー読み込み後に別ワークフローを読み込むと前の内容が残る**: 「別のワークフローを読み込んだ。一部以前のワークフローの内容が残ったまま表示される(クリックするか他のタブから戻ると消える)」との報告。Labタブの「Setting 1」列(Checkpoint/LoRA/VAE/Prompt/KSampler)はGenerateUIの現在の読み込み内容をライブ反映する仕組みだが、その再描画(`refreshLabLiveDefaults()`)は「サブタブをLabに切り替えたとき」の一箇所(`generate-tab.js`のサブタブクリックハンドラ)でしかトリガーされていなかった。Labタブを既に開いた状態で別のワークフローを読み込んだ場合、`loadWorkflowIntoEditor()`側では再描画が一切呼ばれず、前のワークフローの表示がそのまま残っていた。「セルをクリックしたり他のタブから戻ると直る」という報告内容は、それらの操作がたまたま再描画をトリガーしていたことの裏返しだった。`loadWorkflowIntoEditor()`の末尾で、現在アクティブなサブタブがLabの場合は`refreshLabLiveDefaults()`を追加で呼ぶよう修正。
**2. 改善: Galleryタブの生成後の更新が遅い**: 「生成後の画像表示に更新して読み直すのに時間がかかる」との報告。実データ(Output先の`Text2Img`フォルダ、画像9,777枚)で`_scan_folder()`を実測したところ**7.5秒**かかっており、原因を切り分けたところ`entry.stat(follow_symlinks=True)`と、各ファイルごとに呼んでいた`Path(entry.path).resolve()`の2箇所がボトルネックと判明。特に`resolve()`の再解決が支配的で、これだけで1ファイルあたり約0.7ms×9,777件のファイルシステム往復が発生していた。`_scan_folder()`の呼び出し元(`list_images()`/`_bg_index_folder()`)は既にフォルダ自体を`Path(folder_path).resolve()`済みで渡しているため、`entry.path`は既に絶対パスであり、エントリ単位での再`resolve()`は不要だった。`entry.is_file()`/`entry.stat()`を`follow_symlinks=False`に変更し、パス生成も`entry.path.replace("\\", "/")`に簡略化(出力フォルダにシンボリックリンクの画像が置かれる想定はないため安全と判断)。同じ理由で`os.walk()`ベースだった`_scan_folder_recursive()`(ImagePrompt/Style Catalog用の再帰スキャン)も、`os.scandir()`を自前で再帰しDirEntryベースでstatする実装に書き換えた。実測で9,777枚のフォルダに対する`list_images()`全体が0.14秒(コールド)/0.08秒(フォルダキャッシュ温存時)まで短縮(約50倍高速化)。
**3. 改善: Galleryフォルダツリーのrootをデフォルト展開状態に**: 上記の高速化を受けて「rootフォルダはデフォルトで展開状態で表示したい」との要望。フォルダスキャンが軽くなったことでサブフォルダの内容もすぐ確認できるようになった一方、`renderTreeNode()`はrootも他のノードと同じく初期状態は折りたたみ(▶)だったため気付きにくかった。root(`isRoot`)の場合のみ、ツリー構築時に矢印を展開済み(▼)にし子ノードを即座にレンダリングするよう`gallery-tab.js`を修正。
**4. READMEスクリーンショット刷新**: 「以下のスクリーンショットは削除したい」との依頼でGenUI Feeder / GenUI LoRA Stack / Models Multi-select Menu / Tagger Tab / Customizeの5件をREADME.mdの表と`docs/`実ファイルの両方から削除(残った項目は2列レイアウトに詰め直し)。続けてVideo Tab・Lab Tab(2枚)・AI TOOL Tabの新規スクリーンショット計4枚をユーザーが`docs/`に配置し、READMEの表に追加した。
**検証**: JS/Pythonとも`node --check`/`ast.parse()`で構文確認。Gallery高速化は開発元リポジトリの`GalleryService`を実データ(実際の`Text2Img`フォルダ、9,777枚)に対してvenv Pythonから直接呼び出し、修正前後の`_scan_folder()`/`list_images()`の実行時間をベンチマークして改善を数値で確認(7.5秒→0.063秒、`list_images()`全体は0.14秒)。返却されるパス文字列が修正前と同じ絶対パス形式であることも確認済み。開発元gitリポジトリと実行時`custom_nodes`フォルダは別実体のため([[project_dev_deploy_sync]]参照)、変更・削除した全ファイル(`generate-tab.js`, `gallery_service.py`, `gallery-tab.js`, `README.md`, `docs/`配下の画像)を都度両フォルダへ同期し`diff`/存在確認で完全一致を確認、Pythonファイル変更のため`__pycache__`もクリア。全項目ともユーザー自身の実機確認で解消・反映を確認済み。
**How to apply**: あるタブ/サブタブの表示を「別の場所(GenerateUI本体など)の現在の状態をライブ反映する」設計にする場合、再描画のトリガーを「そのタブへの切替」1箇所だけに置くと、切替を経由しない別の更新経路(今回はワークフロー読み込み)で表示が古いまま取り残される。ライブ反映される値の更新元(今回は`loadWorkflowIntoEditor()`)側でも、現在表示中のタブを見て能動的に再描画を呼ぶ必要がある。パフォーマンス調査では「体感で重い処理」を分解して各行を実測するまで真犯人を決め打ちしない方がよい — 今回も当初`follow_symlinks=True`のstat呼び出しを主因と想定したが、実測すると`Path.resolve()`の方が支配的だった。Windows上で大量ファイルを扱う`os.scandir()`ループでは、`entry.path`が既に呼び出し元でresolve済みのフォルダ配下の絶対パスであることを踏まえ、エントリ単位での`resolve()`/`follow_symlinks=True`はファイル数に比例した無視できないコストになり得るため避ける。バックエンドの表示速度を改善した際は、それに応じてフロントエンドのデフォルトUI状態(今回は折りたたみ初期状態)も見直す価値がある — 「遅いから畳んでおく」という妥協がボトルネック解消後も残ったままになりがち。
関連: [[project_dev_deploy_sync]]
---
## v0.5.2
### 機能追加: GenerateUI/Labタブの動画ワークフロー対応 + VideoタブにFrame抽出/GIF変換機能 + データ管理監査とZIPフルバックアップ + Send to LI node統一
+6 -6
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.5.2-green)
![Version](https://img.shields.io/badge/version-0.5.4-green)
## Features (tab -> feature names)
@@ -49,7 +49,7 @@ Setting / Results / Plan JSON sub-panels, Per-column keyframes, Model column —
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
### Settings Tab
2-column layout, Collapsible sections, Theme selection, Theme customization, Workflows directory, Gallery output directory, Eagle connection, Ollama connection, CivitAI Host, CivitAI API Key, Default workflow, Default Checkpoint, Data Management, Text Size, RAW JSON Colors, GenerateUI Model Tab Highlight, Wildcard Integration, G'MIC-Qt Integration, Language
2-column layout, Collapsible sections, Theme selection, Theme customization, Workflows directory, Gallery output directory, Eagle connection, CivitAI Host, CivitAI API Key, Default workflow, Default Checkpoint, Video Playback Volume, Data Management, Text Size, RAW JSON Colors, GenerateUI Model Tab Highlight, Wildcard Integration, G'MIC-Qt Integration, Language
### Gallery Tab (v0.3.44)
Output / ImagePrompt / Style_Catalog / Metadata sub-tabs, Image browser, Folder tree root label, Thumbnail / Table views, Folder management, File operations, Download, MP4 video support, MP4 embedded metadata, Info tab: dimensions & duration, Multi-select, Image Compare, Prompt search, Server-side filtering, Group management, Thumbnail F button, Favorites, Detail panel, Prompt tab, Workflow viewer, GenUI button, Image Edit button, Send GenUI Image button, Send to LI node button, Send CC button, Search clear (✕), Clear all filters (✕ Clear), Workflow auto-save, Output folder configurable, SVG file support, Performance
@@ -70,16 +70,16 @@ Node Browser, Search & Filter, Package badges, Node detail panel, Node Sets, Rig
Model Browser, Thumbnail / Table views, Table column sort, Search & Filter, User-defined badges, Side panel tabs, CivitAI integration, CivitAI panel — Info / Sample sub-tabs, CivitAI panel states, Batch CivitAI fetch, Detail modal, GenUI Model button, Group management, Table view memo, Preview images, Enable / Disable models, Multi-select & bulk operations, Search clear (✕), Clear all filters (✕ Clear)
### Tagger Tab (v0.3.38)
3 sub-tabs, Model support, Threshold sliders, Ollama VLM, Single tab, Single output options, Batch tab, DB tab, Dependencies
3 sub-tabs, Model support, Threshold sliders, VLM tagging, Single tab, Single output options, Batch tab, DB tab, Dependencies
### Image Edit Tab (v0.3.65)
Layer-based image editor, Loading images, New button, Tools, Layer panel, Layer lock, Text quality, Export, Canvas navigation, Undo / Redo
### Video Tab (v0.5.0 – v0.5.2)
Dedicated MiniMax H3 video generation UI, independent of GenerateUI, 3-pane layout, First Frame / Last Frame are both optional, Node lookup instead of hardcoded IDs, Load in Video, Preview frame + Video Source panel, Frame tab, GIF tab
### Video Tab (v0.5.0 – v0.5.4)
Dedicated video generation UI, independent of GenerateUI, 3-pane layout, First Frame / Last Frame are both optional, Semantic node lookup, not hardcoded IDs, Field highlight color, Load in Video, Preview frame + Video Source panel, Frame tab, GIF tab, Playback volume
### AI TOOL Tab (v0.3.14)
4-pane layout, Translation pane, Chat pane, Chat pane — image generation via Tool Calling, Chat pane — generate_image extra parameters, TOOLS pane (VLM), TOOLS pane — shared Chat attachment, TOOLS pane (Wildcards), Chat pane — image-to-image (I2I), Chat pane — SVG generation, no ComfyUI workflow involved, Chat pane — Skills, Settings pane, Unsloth backend, Settings pane — Chat Image Generation, Settings pane — Chat I2I Generation, Settings pane — Generation, Settings shared, Backend support, URL security, Lemonade's other endpoints (not integrated)
4-pane layout, Translation pane, Chat pane, Chat pane — image generation via Tool Calling, Chat pane — generate_image extra parameters, TOOLS pane (VLM), TOOLS pane — shared Chat attachment, TOOLS pane (Wildcards), Chat pane — image-to-image (I2I), Chat pane — SVG generation, no ComfyUI workflow involved, Chat pane — Skills, Settings pane, Unsloth backend, Settings pane — Chat Image Generation, Settings pane — Chat I2I Generation, Settings pane — Generation, Model unload, Settings shared, Backend support, URL security, Lemonade's other endpoints (not integrated)
### Workflow Studio Library (ComfyUI Side Panel) (v0.3.9)
Tab layout (W / N / P / M / I / A), W — Workflows tab, N — Nodes tab, M — Models tab, P — Prompts tab, I — Information tab, A — AI TOOL tab, Drag & drop workflows, Drag & drop nodes, Drag & drop prompts, Send to Canvas, Copy prompts, Double-click, Search, ⚙ Theme settings
+32 -28
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.5.2-green)
![Version](https://img.shields.io/badge/version-0.5.4-green)
## Screenshots
@@ -30,29 +30,25 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
| :-------------------------------------: | :---------------------------------: |
| ![Workflow Tab](docs/1_workflowtab.png) | ![Models Tab](docs/2_modelstab.png) |
| Prompt Input Assistance | Gen UI Feeder |
| :----------------------------------------------------------: | :---------------------------------------: |
| ![Prompt Input Assistance](docs/3_PromptInputAssistance.png) | ![Gen UI Feeder](docs/4_GenUI_feeder.png) |
| Prompt Input Assistance | GenUI Batch |
| :----------------------------------------------------------: | :-------------------------------------: |
| ![Prompt Input Assistance](docs/3_PromptInputAssistance.png) | ![GenUI Batch](docs/10_GenUI_Batch.png) |
| GenUI LoRA Stack | GenUI Batch |
| :---------------------------------------------: | :-------------------------------------: |
| ![GenUI LoRA Stack](docs/9_GenUI_LoraStack.png) | ![GenUI Batch](docs/10_GenUI_Batch.png) |
| Models Multi-select Menu | Top Bar |
| :-----------------------------------------------------------: | :---------------------------: |
| ![Models Multi-select Menu](docs/11_multiple_select_menu.png) | ![Top Bar](docs/5_topbar.png) |
| Top Bar | Image Edit Tab |
| :----------------------------: | :--------------------------------------: |
| ![Top Bar](docs/5_topbar.png) | ![Image Edit Tab](docs/13_ImageEdit.png) |
| WS Library | Library Information |
| :----------------------------------: | :---------------------------------------------------: |
| ![WS Library](docs/6_ws_library.png) | ![Library Information](docs/7_library_Infomation.png) |
| Tagger Tab | Image Edit Tab |
| :-------------------------------: | :--------------------------------------: |
| ![Tagger Tab](docs/12_Tagger.png) | ![Image Edit Tab](docs/13_ImageEdit.png) |
| Video Tab | AI TOOL Tab |
| :----------------------------------: | :--------------------------------------: |
| ![Video Tab](docs/14_videotab.png) | ![AI TOOL Tab](docs/17_aitooltab.png) |
| Customize | |
| :--------------------------------: | :-: |
| ![Customize](docs/8_Customize.png) | |
| Lab Tab | Lab Index Image |
| :--------------------------------: | :------------------------------------------: |
| ![Lab Tab](docs/15_labtab.png) | ![Lab Index Image](docs/16_lab_index.png) |
---
@@ -69,7 +65,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **Badge management** — add, rename, delete badges with custom colors shared with the Models tab (⚙ Badge button)
- **AI summary** — generate workflow descriptions using Ollama
- **Import / Export** — import workflows from files or clipboard; **Send to Canvas** button sends the selected workflow directly to the ComfyUI canvas (UI and API formats both supported)
- **Side panel toolbar buttons** (v0.5.0) — selecting a card shows three buttons in the top toolbar: **Load in GenerateUI**, **Load in Video** (new — loads a MiniMax H3 Image-to-Video workflow into the Video tab; shows an error toast for workflows that don't contain that node), and **Send to Canvas**; the detail modal's duplicate copies of these three buttons were removed in favor of this single toolbar location
- **Side panel toolbar buttons** (v0.5.0) — selecting a card shows three buttons in the top toolbar: **Load in GenerateUI**, **Load in Video** (loads a MiniMax H3 Image-to-Video, LTX-2.5 (Text/Image/First&Last-Frame to Video), or Wan2.2 (Text to Video) workflow into the Video tab (LTX-2.5/Wan2.2 support: v0.5.4); shows an error toast for workflows that don't contain a supported node), and **Send to Canvas**; the detail modal's duplicate copies of these three buttons were removed in favor of this single toolbar location
- **Default view setting** — persist your preferred view mode (Thumbnail / Table)
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — rightmost toolbar button; resets search text, group filter, and badge filter (ALL) in one click
@@ -117,7 +113,9 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **Right pane (Batch Queue)** — 7 columns: Checkpoint / Lora / Prompt / Workflow / Sampler / Scheduler / **Style**; each column header has an enable checkbox (radio behavior: only one at a time); count shown per column; Style batch applies each selected style sequentially to a workflow copy
- **Lora batch prompt sync** (v0.3.69) — for each selected LoRA, its syntax (`<lora:name:strength_model:strength_clip>`) and CivitAI trained words are automatically appended to the Positive prompt (rebuilt from the original prompt each time, not accumulated), then restored to the pre-batch state when the batch completes or is stopped; if a selected LoRA is not yet recognized by ComfyUI's model list, a warning toast suggests a Refresh or restart
- **UI-to-API conversion** — automatic conversion supporting subgraphs (nested workflows), COMBO types, and display-only node exclusion; improved analysis covers SDXL multi-hop CONDITIONING chains, CLIPTextEncodeSDXL, SDXLPromptStyler, KSamplerAdvanced, and Guider-based "Advanced Sampling" workflows (`SamplerCustomAdvanced`/`SamplerCustom` + `CFGGuider`/`DualCFGGuider`/`BasicGuider` + `RandomNoise` + `KSamplerSelect` + `*Scheduler` — Flux.2 Klein, LongCat, Boogu, HiDream E1, etc.)
- **MultiType widget-value bug fix** (v0.5.4) — a node input declaring a comma-joined MultiType (e.g. LTX-2.5's `LTXVEmptyLatentAudio.frame_rate: "FLOAT,INT"`) was silently dropped from the widget list instead of being recognized as a scalar widget, which shifted every subsequent widget's value onto the wrong input (surfaced as `LTXVEmptyLatentAudio.batch_size` receiving `frame_rate`'s value and video generation failing with "Expected size 1 but got size 25")
- **Video workflow support** (v0.5.2) — loading a MiniMax H3 (or other all-in-one video-generation) workflow now works from GenerateUI too, not just the dedicated Video tab: the Input tab's Prompt field picks up its `prompt` widget, the Image tab picks up its LoadImage-based `first_frame` the same way any other I2I workflow does, and generation runs with a longer timeout since video generation takes much longer than a still image; the result preview shows the generated mp4 inline (`<video>`) instead of trying to render it as an image
- **LTX-2.5 / Wan2.2 support** (v0.5.4) — these follow ComfyUI's regular node-graph pattern rather than an all-in-one node, so they needed their own detection: Positive/Negative Prompt now traces through LTX-2.5's `LTXVDualCFGGuider`/`LTXVConditioning` nodes to the actual prompt text, and the Settings tab's Latent Image section recognizes Wan2.2's `EmptyHunyuanLatentVideo` and LTX-2.5's `EmptyLTXVLatentVideo` (width/height/batch size, plus an added **Length (frames)** field) instead of showing "No EmptyLatentImage node found"; the extended generation timeout now also triggers off a `SaveVideo`/`CreateVideo` node anywhere in the graph, not just an all-in-one node
- **Eagle integration** — auto-save generated images to [Eagle](https://eagle.cool/) with metadata
</details>
@@ -184,7 +182,8 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
<summary><h3>Prompt Tab</h3></summary>
- **3-column layout** — AI Assistant (left), Presets/Preset Manager tab-panel (center), Wildcard/Style support (right)
- **AI chat assistant** — powered by [Ollama](https://ollama.com/), generate and refine prompts interactively
- **AI chat assistant** — generate and refine prompts interactively using Ollama, LM Studio, Lemonade, or Unsloth (multi-backend: v0.5.4)
- **⚙ Settings modal** (v0.5.4) — replaces the old central Settings-tab panel; opens a dedicated modal (Backend / Connection / Model / Generation / Unload / Save) scoped to this tab only, saved under its own `localStorage` key so it stays independent of the Tagger tab's VLM settings; **Thinking mode** and **Max tokens** apply to every chat request, and an **Unload** button frees the selected model from Ollama/LM Studio/Lemonade (Unsloth has no such API and is shown as unsupported)
- **Image attachment** — attach reference images for vision-capable models
- **Translation** — JA/EN/ZH translation buttons for multilingual prompt creation
- **Prompt presets** — save/load reusable prompt templates (positive & negative) with category support
@@ -225,16 +224,17 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Workflows directory** — configure which folder to scan for workflows
- **Gallery output directory** — configure which output folder the Gallery tab scans for images
- **Eagle connection** — set Eagle API endpoint for auto-save
- **Ollama connection** — configure Ollama server URL
- **CivitAI Host** — choose which site opens when clicking a model link: `civitai.com` (SFW only) or `civitai.red` (unrestricted); saved to `settings.json` and synced to `localStorage` for the Models tab to use without extra fetches
- **CivitAI API Key** — optional Bearer token for authenticated CivitAI access; stored in `settings.json` (excluded from data exports); environment variable `CIVITAI_API_KEY` takes priority if set
- **Default workflow** — set a workflow to auto-load on startup
- **Default Checkpoint** (v0.3.73) — optional checkbox to force every checkpoint loader node's model to a chosen default whenever a workflow is loaded into GenerateUI; a safeguard against generation errors or garbled images from a stale/mismatched checkpoint saved in the workflow file
- ~~AI Assistant Settings~~ (removed in v0.5.4) — the central Ollama backend/URL/model panel that used to live here was replaced by a ⚙ Settings button + modal directly in the Prompt tab and the Tagger tab, each with its own independent configuration (backend, URL, model, Thinking mode, Max tokens, and a model Unload button) — see those tabs below; the AI TOOL tab's own Settings pane is unaffected
- **Video Playback Volume** (v0.5.4) — the video preview's volume is remembered here and shared across every video player in the plugin (Video tab, Gallery tab), instead of resetting to maximum whenever a different video is opened
- **Data Management** — export core settings/metadata/prompts/CivitAI cache to a single JSON file; import to restore data (useful when migrating or reinstalling); API keys are excluded from exports for security
- **Full Backup (ZIP)** (v0.5.2) — additionally covers what the JSON bundle can't represent: folder-based data (AI Skills, Lab Plans, Style presets) and the Tagger SQLite database; two opt-in checkboxes can also include ComfyUI's default workflows folder (`user/default/workflows`) and the Impact Pack's wildcard folder in the export — both of those are export-only and stored under an `_external/` prefix in the ZIP that Restore always skips, since auto-overwriting files a different plugin/ComfyUI core manages would be unsafe; copy them back by hand if needed. Restoring overwrites existing files; restart ComfyUI afterward for either restore path
- **Text Size** — one slider (10–28 px) adjusts font size for all prompt and chat textareas at once: Generate UI positive/negative prompts, AI Assistant chat input, Preset prompts, Wildcard prompt and file editor, and Metadata prompt full preview; takes effect immediately and saved with Save Settings
- **RAW JSON Colors** — customize the 6 syntax highlight colors for the Raw JSON editor in Generate UI: Default Text (base), Name/Scheduler (yellow), Title (pink), Width/Height (green), Prompt/Text (cyan), Image/File (red); changes apply immediately on color pick; Reset Defaults restores the original scheme; saved to `localStorage` under `wfm_settings.jsonColors` and applied on startup
- **GenerateUI Model Tab Highlight** (v0.3.98) — pick the color used to mark Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork labels and the LoRA column header in GenerateUI's Model tab when the loaded workflow actually contains that type of node; default bright green; changes apply immediately, Reset Defaults restores it; saved to `localStorage` under `wfm_settings.modelTabActiveColor`
- **GenerateUI Model Tab Highlight** (v0.3.98) — pick the color used to mark Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork labels and the LoRA column header in GenerateUI's Model tab when the loaded workflow actually contains that type of node; default bright green; changes apply immediately, Reset Defaults restores it; saved to `localStorage` under `wfm_settings.modelTabActiveColor`; the same color and mechanism also drives the Video tab's field highlighting (v0.5.4, see above)
- **Wildcard Integration** — link the WFS wildcard directory to ComfyUI-Impact-Pack's `wildcards/` directory (directory junction on Windows, symlink on other OS); existing WFS wildcard files are automatically migrated; requires [ComfyUI-Impact-Pack](https://github.com/ltdrdata/ComfyUI-Impact-Pack)
- **G'MIC-Qt Integration** — set the path to `gmic_qt.exe` for the Image Edit Filter tool; download G'MIC-Qt Standalone from `gmic.eu/download.html` (Windows: `gmic_qt-win64.zip`), extract anywhere, then enter the full path to `gmic_qt.exe` and click Save
- **Language** — English / Japanese / Chinese
@@ -368,10 +368,11 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **3 sub-tabs** — Single / Batch / DB for single-image tagging, folder batch processing, and tag database management
- **Model support** — WD Tagger (ONNX, NCHW/NHWC auto-detect), SwinV2 (ONNX), DeepDanbooru (.h5, requires TensorFlow); place each model in its own subfolder under `ComfyUI/models/tagger/<model-name>/` containing the `.onnx` + `selected_tags.csv` (or `.h5` + label file)
- **Threshold sliders** — General threshold (default 0.35) and Character threshold for `character:` prefix tags (default 0.85); sliders update the display value in real time
- **Ollama VLM** — optional vision model alongside WD Tagger; set API URL and select model (↻ to refresh list); results from both models are merged into one comma-separated tag string
- **VLM tagging** (v0.3.38, multi-backend: v0.5.4) — optional vision model alongside WD Tagger, running on Ollama, LM Studio, Lemonade, or Unsloth through the same unified backend used by the Prompt tab; results from both models are merged into one comma-separated tag string
- **⚙ Settings modal** (v0.5.4) — a Settings button (Single and Batch tabs) opens the same modal component as the Prompt tab's AI Assistant (Backend / Connection / Model / Generation / Unload), but saved under its own `localStorage` key so Tagger's VLM backend/model choice is independent of the Prompt tab's; **Thinking mode** and **Max tokens** apply to VLM requests too, and the **Unload** button frees the selected model (Ollama/LM Studio/Lemonade; Unsloth unsupported) — replaces the old Tagger-only direct Ollama URL/model fields
- **Single tab** — drag & drop an image onto the preview area or click Upload; Gallery detail panel **Tagger** button opens the selected image directly here
- **Single output options** — (1) **GenUI:P** — appends tags to the GenerateUI tab's positive prompt and immediately applies to the loaded workflow; (2) **Send to Prompt** — appends tags to the Prompt tab's positive textarea; (3) **Save to Gallery** — saves tags to Gallery image metadata (requires image opened from Gallery); (4) **Write to File** — embeds tags into JPEG EXIF (`ImageDescription`) or PNG `tEXt` chunk (`Tags` key), other formats get a `.tags.json` sidecar; (5) **Save to DB** — stores in internal SQLite database
- **Batch tab** — enter a folder path, configure WD Tagger and Ollama settings; output options: **Save to DB** (default on), **Write to File** (EXIF/PNG metadata), **Write .txt** (creates `<filename>.txt` alongside each image with all tags); real-time progress bar and log; Stop cancels after the current image
- **Batch tab** — enter a folder path, configure WD Tagger thresholds and (via the same ⚙ Settings modal as Single) the VLM backend; output options: **Save to DB** (default on), **Write to File** (EXIF/PNG metadata), **Write .txt** (creates `<filename>.txt` alongside each image with all tags); real-time progress bar and log; Stop cancels after the current image
- **DB tab** — searchable SQLite database of all tagged images; click a row to open the edit panel and modify WD Tags / VLM Tags; Save updates the record, Delete removes it; Export CSV downloads all records
- **Dependencies** — install into ComfyUI's embedded Python: `python_embedded\python.exe -m pip install -r requirements.txt`; for GPU inference use `onnxruntime-gpu`; TensorFlow (DeepDanbooru) is optional and commented out in `requirements.txt`
@@ -403,16 +404,18 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
</details>
<details>
<summary><h3>Video Tab (v0.5.0 – v0.5.2)</h3></summary>
<summary><h3>Video Tab (v0.5.0 – v0.5.4)</h3></summary>
- **Dedicated MiniMax H3 video generation UI, independent of GenerateUI** — a purpose-built tab for the MiniMax H3 (Image to Video) workflow; does not share state with the GenerateUI tab, and model selection (UNet/CLIP/VAE/Audio VAE) is fixed to the loaded workflow's own defaults rather than editable here
- **Dedicated video generation UI, independent of GenerateUI** — a purpose-built tab for MiniMax H3 (Image to Video), LTX-2.5 (Text / Image / First & Last Frame to Video), and Wan2.2 (Text to Video) workflows (LTX-2.5/Wan2.2: v0.5.4); does not share state with the GenerateUI tab, and model selection (UNet/CLIP/VAE/Audio VAE) is fixed to the loaded workflow's own defaults rather than editable here
- **3-pane layout** — left: form (First Frame / Last Frame / Prompt / Aspect Ratio / Megapixels / Multiple / Duration / Noise Seed / Generate); center: preview frame + Video Source panel, plus an Editing pane reserved for future video-editing tools; right: **Frame** / **GIF** property tabs (v0.5.2, see below)
- **First Frame / Last Frame are both optional** — leaving First Frame empty runs the workflow text-only (the node is simply left unconnected — a "bypass"); workflows that don't even include a LoadImage node for First Frame are supported out of the box, and a LoadImage node is only injected into the graph on the fly if an image is actually supplied
- **Node lookup instead of hardcoded IDs** — locates the MiniMax H3 subgraph instance, its linked Resolution Selector, and (if present) its linked LoadImage node by walking the workflow's subgraph definitions and links, so a workflow doesn't need to match the reference `minimax_test.json`'s exact node IDs
- **Load in Video** (Workflow tab) — load any workflow containing a MiniMax H3 Image-to-Video node straight into this tab from the Workflow tab's side-panel toolbar (next to Load in GenerateUI); unsupported workflows show an error toast instead of loading
- **First Frame / Last Frame are both optional** — leaving First Frame empty runs the workflow text-only (the node is simply left unconnected — a "bypass"); workflows that don't even include a LoadImage node for First Frame are supported out of the box (Wan2.2's Text-to-Video graph has neither slot at all), and a LoadImage node is only injected into the graph on the fly if an image is actually supplied
- **Semantic node lookup, not hardcoded IDs** (generalized in v0.5.4) — detects which of the three families is loaded from its subgraph's internal node types (or, for Wan2.2, the subgraph's own name — it has no distinctive internal node type), then locates its Resolution Selector and LoadImage node(s) by the subgraph's *public input label* (`prompt`, `duration`, `width`, `first_frame`, `last_frame`) rather than a fixed slot index — so it keeps working even though the three families expose those inputs under different internal names; a workflow no longer needs to match any bundled reference file's exact node IDs, and no fallback test workflow is auto-loaded on tab open
- **Field highlight color** (v0.5.4) — Prompt / Duration / First Frame / Last Frame / Aspect Ratio / Megapixels / Multiple labels turn the same highlight color as the GenerateUI Model tab (shared setting, customizable in the Settings tab — see below) when the loaded workflow actually exposes that field; e.g. a Wan2.2 workflow (no Resolution Selector node) leaves Aspect Ratio / Megapixels / Multiple unhighlighted since those controls are disabled
- **Load in Video** (Workflow tab) — load any workflow containing a MiniMax H3 Image-to-Video node, an LTX-2.5 Text/Image/First&Last-Frame-to-Video node, or a Wan2.2 Text-to-Video node straight into this tab from the Workflow tab's side-panel toolbar (next to Load in GenerateUI); unsupported workflows show an error toast instead of loading
- **Preview frame + Video Source panel** (v0.5.2, replaces the old Result panel) — the center pane's preview shows either a just-generated video or one loaded independently of generation; a **Video Source** drop zone next to it accepts any local video file (drag-and-drop or click to pick), with a **Clear** button to reset back to empty — the Frame/GIF tools below work on whatever is currently shown here, generated or not; generated results are still saved to Gallery metadata (embedded workflow JSON) automatically, so the Gallery tab's Workflow/Prompt panels work on generated videos the same way they do for images
- **Frame tab** (v0.5.2) — captures the preview video's current playback position as a still frame: play/seek to the position you want, click **Capture Frame** (client-side canvas, no server round-trip), then **Save to Output** to write it as a PNG into ComfyUI's own Output folder (auto-numbered, same pattern as other generated images)
- **GIF tab** (v0.5.2) — converts the preview video to an animated GIF; set Start/End (seconds), FPS, and an optional Max Width, then **Convert to GIF** — the server decodes the video (PyAV) and encodes an animated GIF (Pillow), both dependencies ComfyUI itself already requires, so no ffmpeg binary or extra install is needed; the result is saved into ComfyUI's Output folder and previewed inline
- **Playback volume** (v0.5.4) — the preview player's volume is saved to the Settings tab and shared across every video player in the plugin (Video tab, Gallery tab), so it no longer resets to maximum each time a different video is opened
</details>
@@ -436,6 +439,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Settings pane — Chat Image Generation** (v0.3.73) — "Use dedicated workflow" checkbox lets Chat-triggered image generation use a saved workflow of your choice instead of the one currently loaded in GenerateUI, without disturbing what's shown there (same pattern as Image Edit's Inpaint dedicated workflow)
- **Settings pane — Chat I2I Generation** (v0.3.74) — same "Use dedicated workflow" pattern as above, but for image-to-image generation when an image is attached; independent of the text-to-image dedicated workflow setting
- **Settings pane — Generation** (v0.3.98) — **Thinking mode** toggle (off by default; sends Ollama's `think` flag, and regardless of backend, any `<think>...</think>` block is stripped from the output when off so reasoning models don't clutter Translation/Chat/TOOLS results) and **Max tokens** (Ollama: `options.num_predict`; LM Studio/Lemonade/Unsloth: `max_tokens`; `0` = unlimited)
- **Model unload** (v0.5.4) — an Unload button next to the model selector frees VRAM/memory by unloading the currently selected model from Ollama (`keep_alive:0` via `/api/generate`, the officially documented method — Ollama has no dedicated unload endpoint), LM Studio (`/api/v1/models/unload`), or Lemonade (`/api/v1/unload`); Unsloth exposes no equivalent API and the button is disabled for that backend
- **Settings shared** — settings saved to `localStorage` under `wfm_ai_settings`; shared with the Library panel's AI TOOL tab so configuration is consistent across both interfaces
- **Backend support** — Ollama (`/api/generate` for text, `/api/chat` for conversations, `/api/tags` for model list); LM Studio and Lemonade via the OpenAI-compatible API directly from the browser (`/v1/chat/completions`, `/v1/models`); Unsloth via the same OpenAI-compatible API but relayed through a server-side proxy that attaches the `Authorization: Bearer` header; VLM images sent as base64 (`images:[]` for Ollama, `image_url` content block for LM Studio/Lemonade/Unsloth)
- **URL security** — backend URL validated via `new URL()` to enforce `http://` or `https://` scheme
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

+14 -7
View File
@@ -18,8 +18,8 @@ _db = TaggerDbService(TAGGER_DB_FILE)
def setup_routes(app: web.Application):
app.router.add_get("/wfm/tagger/models", handle_models)
app.router.add_post("/wfm/tagger/predict", handle_predict)
app.router.add_get("/wfm/tagger/ollama/models", handle_ollama_models)
app.router.add_post("/wfm/tagger/ollama/predict", handle_ollama_predict)
app.router.add_get("/wfm/tagger/vlm/models", handle_vlm_models)
app.router.add_post("/wfm/tagger/vlm/predict", handle_vlm_predict)
app.router.add_post("/wfm/tagger/batch/start", handle_batch_start)
app.router.add_get("/wfm/tagger/batch/status", handle_batch_status)
app.router.add_post("/wfm/tagger/batch/stop", handle_batch_stop)
@@ -61,25 +61,29 @@ async def handle_predict(request: web.Request) -> web.Response:
return web.json_response({"error": str(e)}, status=500)
async def handle_ollama_models(request: web.Request) -> web.Response:
async def handle_vlm_models(request: web.Request) -> web.Response:
backend = request.rel_url.query.get("backend", "ollama")
api_url = request.rel_url.query.get("api_url", "http://127.0.0.1:11434")
try:
models = await asyncio.to_thread(_svc.ollama_models, api_url)
models = await asyncio.to_thread(_svc.vlm_models, backend, api_url)
return web.json_response({"models": models})
except Exception as e:
return web.json_response({"error": str(e)}, status=500)
async def handle_ollama_predict(request: web.Request) -> web.Response:
async def handle_vlm_predict(request: web.Request) -> web.Response:
try:
body = await request.json()
result = await asyncio.to_thread(
_svc.ollama_predict,
_svc.vlm_predict,
body.get("image_b64", ""),
body.get("backend", "ollama"),
body.get("api_url", "http://127.0.0.1:11434"),
body.get("model", ""),
body.get("prompt", ""),
int(body.get("max_tags", 40)),
bool(body.get("thinking_mode", False)),
int(body.get("max_tokens", 0)),
)
return web.json_response(result)
except Exception as e:
@@ -96,7 +100,8 @@ async def handle_batch_start(request: web.Request) -> web.Response:
float(body.get("threshold", 0.35)),
float(body.get("char_threshold", 0.85)),
bool(body.get("use_ollama", False)),
body.get("ollama_api", "http://127.0.0.1:11434"),
body.get("vlm_backend", "ollama"),
body.get("vlm_api_url", "http://127.0.0.1:11434"),
body.get("ollama_model", ""),
body.get("ollama_prompt", ""),
int(body.get("ollama_max_tags", 40)),
@@ -104,6 +109,8 @@ async def handle_batch_start(request: web.Request) -> web.Response:
bool(body.get("write_file", False)),
bool(body.get("write_txt", False)),
_db,
bool(body.get("thinking_mode", False)),
int(body.get("max_tokens", 0)),
)
return web.json_response(result)
except Exception as e:
+45 -23
View File
@@ -312,15 +312,22 @@ class GalleryService:
try:
with os.scandir(folder) as it:
for entry in it:
if not entry.is_file(follow_symlinks=True):
# follow_symlinks=True forces stat() to make an extra syscall per file
# to resolve the link target even for plain files. Output folders don't
# contain symlinked images, so False is safe and much cheaper.
if not entry.is_file(follow_symlinks=False):
continue
if Path(entry.name).suffix.lower() not in IMAGE_EXTENSIONS:
continue
try:
st = entry.stat(follow_symlinks=True)
st = entry.stat(follow_symlinks=False)
# entry.path is already absolute+resolved because callers always
# pass in an already-resolved `folder`. Re-resolving it here via
# Path(entry.path).resolve() costs an extra filesystem round-trip
# per file — on a 9786-file folder that alone was 6.7s vs 0.07s.
entries.append((
entry.name,
str(Path(entry.path).resolve()).replace("\\", "/"),
entry.path.replace("\\", "/"),
st.st_size,
st.st_mtime,
))
@@ -333,30 +340,45 @@ class GalleryService:
return entries
def _scan_folder_recursive(self, folder: Path) -> list[tuple[str, str, int, float]]:
"""os.walk() でフォルダ配下を再帰的に列挙する(サブフォルダの画像も含む)。
"""フォルダ配下を再帰的に列挙する(サブフォルダの画像も含む)。
ImagePrompt/Style Catalogギャラリーのように深い階層に画像が置かれるケース用。
キャッシュはしない(フォルダ数が少なく、都度スキャンしても軽い想定)。
os.walk()はDirEntryを介さずPath.stat()(follow_symlinks=True相当)を呼ぶため、
_scan_folder()と同じ理由でフォルダ内ファイル数に対して極端に遅くなる。
os.scandir()を自前で再帰し、follow_symlinks=Falseでstatする。
"""
entries = []
try:
for root, dirs, files in os.walk(folder):
dirs[:] = [d for d in dirs if not d.startswith(".")]
for name in files:
if Path(name).suffix.lower() not in IMAGE_EXTENSIONS:
continue
full = Path(root) / name
try:
st = full.stat()
entries.append((
name,
str(full.resolve()).replace("\\", "/"),
st.st_size,
st.st_mtime,
))
except OSError:
continue
except PermissionError:
pass
def _walk(d):
try:
with os.scandir(d) as it:
dir_entries = list(it)
except (PermissionError, OSError):
return
for entry in dir_entries:
if entry.is_dir(follow_symlinks=False):
if not entry.name.startswith("."):
_walk(entry.path)
continue
if not entry.is_file(follow_symlinks=False):
continue
if Path(entry.name).suffix.lower() not in IMAGE_EXTENSIONS:
continue
try:
st = entry.stat(follow_symlinks=False)
# entry.path is already absolute since the top-level `folder` passed
# in by callers is always pre-resolved — see _scan_folder() for why
# re-resolving per file here would be costly.
entries.append((
entry.name,
entry.path.replace("\\", "/"),
st.st_size,
st.st_mtime,
))
except OSError:
continue
_walk(folder)
return entries
def list_images(
+97 -25
View File
@@ -5,6 +5,8 @@ import csv
import io
import json
import logging
import os
import re
import tempfile
import threading
import urllib.request
@@ -223,39 +225,107 @@ class TaggerService:
tags.append(label.replace("character:", ""))
return tags
# ── Ollama VLM ────────────────────────────────────────────
# ── VLM Tagging (Ollama / LM Studio / Lemonade / Unsloth) ──
def ollama_models(self, api_url: str) -> list:
@staticmethod
def _unsloth_api_key() -> Optional[str]:
"""UNSLOTH_API_KEY を環境変数(.env)から取得。Unslothはローカルでも常に必須。"""
return os.environ.get("UNSLOTH_API_KEY", "").strip() or None
@staticmethod
def _strip_thinking_tags(text: str) -> str:
text = re.sub(r"<think>[\s\S]*?</think>", "", text, flags=re.IGNORECASE)
text = re.sub(r"<thinking>[\s\S]*?</thinking>", "", text, flags=re.IGNORECASE)
return text.strip()
def vlm_models(self, backend: str, api_url: str) -> list:
backend = (backend or "ollama").lower()
try:
req = urllib.request.Request(api_url.rstrip("/") + "/api/tags")
if backend == "ollama":
req = urllib.request.Request(api_url.rstrip("/") + "/api/tags")
with urllib.request.urlopen(req, timeout=5) as resp:
data = json.loads(resp.read().decode("utf-8"))
return sorted(m["name"] for m in data.get("models", []))
headers = {}
if backend == "unsloth":
key = self._unsloth_api_key()
if not key:
logger.error("vlm_models: UNSLOTH_API_KEY is not set")
return []
headers["Authorization"] = f"Bearer {key}"
req = urllib.request.Request(api_url.rstrip("/") + "/v1/models", headers=headers)
with urllib.request.urlopen(req, timeout=5) as resp:
data = json.loads(resp.read().decode("utf-8"))
return sorted(m["name"] for m in data.get("models", []))
return sorted(m["id"] for m in data.get("data", []))
except Exception as e:
logger.error("ollama_models: %s", e)
logger.error("vlm_models: %s", e)
return []
def ollama_predict(self, image_b64: str, api_url: str, model: str, prompt: str, max_tags: int = 40) -> dict:
payload = json.dumps({
"model": model,
"messages": [{"role": "user", "content": prompt, "images": [image_b64]}],
"stream": False,
"options": {"temperature": 0.7, "num_ctx": 4096},
}).encode("utf-8")
def vlm_predict(self, image_b64: str, backend: str, api_url: str, model: str, prompt: str, max_tags: int = 40,
thinking_mode: bool = False, max_tokens: int = 0) -> dict:
backend = (backend or "ollama").lower()
try:
req = urllib.request.Request(
api_url.rstrip("/") + "/api/chat",
data=payload,
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req, timeout=180) as resp:
data = json.loads(resp.read().decode("utf-8"))
content = data.get("message", {}).get("content", "")
if backend == "ollama":
body = {
"model": model,
"messages": [{"role": "user", "content": prompt, "images": [image_b64]}],
"stream": False,
"think": bool(thinking_mode),
"options": {"temperature": 0.7, "num_ctx": 4096},
}
if max_tokens > 0:
body["options"]["num_predict"] = max_tokens
payload = json.dumps(body).encode("utf-8")
req = urllib.request.Request(
api_url.rstrip("/") + "/api/chat",
data=payload,
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req, timeout=180) as resp:
data = json.loads(resp.read().decode("utf-8"))
content = data.get("message", {}).get("content", "")
else:
headers = {"Content-Type": "application/json"}
if backend == "unsloth":
key = self._unsloth_api_key()
if not key:
return {"error": "UNSLOTH_API_KEY is not set. Copy .env.example to .env in the "
"plugin folder, fill in the key, and restart ComfyUI."}
headers["Authorization"] = f"Bearer {key}"
body = {
"model": model,
"messages": [{"role": "user", "content": [
{"type": "text", "text": prompt},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image_b64}"}},
]}],
"stream": False,
}
if max_tokens > 0:
body["max_tokens"] = max_tokens
payload = json.dumps(body).encode("utf-8")
req = urllib.request.Request(
api_url.rstrip("/") + "/v1/chat/completions",
data=payload,
headers=headers,
method="POST",
)
with urllib.request.urlopen(req, timeout=180) as resp:
data = json.loads(resp.read().decode("utf-8"))
message = data.get("choices", [{}])[0].get("message", {})
content = message.get("content", "")
# Unslothはreasoningを別フィールドで返すため<think>タグに畳んで統一的に扱う
reasoning = message.get("reasoning_content")
if reasoning:
content = f"<think>{reasoning}</think>{content}"
if not thinking_mode:
content = self._strip_thinking_tags(content)
tags = [t.strip() for t in content.split(",") if t.strip()][:max_tags]
return {"tags": ", ".join(tags), "count": len(tags)}
except Exception as e:
logger.error("ollama_predict: %s", e)
logger.error("vlm_predict: %s", e)
return {"error": str(e)}
# ── ファイルメタデータ書込 ────────────────────────────────
@@ -334,8 +404,9 @@ class TaggerService:
self._batch_state["stop"] = True
def batch_start(self, folder: str, model_name: str, threshold: float, char_threshold: float,
use_ollama: bool, ollama_api: str, ollama_model: str, ollama_prompt: str,
ollama_max_tags: int, save_db: bool, write_file: bool, write_txt: bool, db_service) -> dict:
use_ollama: bool, vlm_backend: str, vlm_api_url: str, ollama_model: str, ollama_prompt: str,
ollama_max_tags: int, save_db: bool, write_file: bool, write_txt: bool, db_service,
thinking_mode: bool = False, max_tokens: int = 0) -> dict:
if self._batch_state["running"]:
return {"error": "Batch already running"}
folder_path = Path(folder)
@@ -370,7 +441,8 @@ class TaggerService:
vlm_tags = ""
if use_ollama and ollama_model:
res2 = self.ollama_predict(b64, ollama_api, ollama_model, ollama_prompt, ollama_max_tags)
res2 = self.vlm_predict(b64, vlm_backend, vlm_api_url, ollama_model, ollama_prompt, ollama_max_tags,
thinking_mode, max_tokens)
vlm_tags = res2.get("tags", "")
all_tags = ", ".join(filter(None, [interrogator_tags, vlm_tags]))
+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.5.2"
version = "0.5.4"
license = "MIT"
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+205
View File
@@ -0,0 +1,205 @@
/**
* Shared AI backend settings modal (Backend / Connection / Model / Generation / Unload / Save).
* Used by the Prompt tab and Tagger tab, each with its own localStorage key so their
* settings stay independent — mirrors the AI TOOL tab's own settings pane (ai-tab.js).
*/
import { openModal, closeModal, showToast } from "./app.js";
import { t } from "./i18n.js";
import { readJsonStorage, getAiBackendDefaultUrl, unslothProxy, unloadAiModel } from "./util.js";
function loadCfg(storageKey) {
return readJsonStorage(storageKey);
}
function saveCfg(storageKey, patch) {
const data = { ...loadCfg(storageKey), ...patch };
localStorage.setItem(storageKey, JSON.stringify(data));
return data;
}
// 保存済み設定を {backend, url, model, thinkingMode, maxTokens} の形で返す
export function getAiBackendConfig(storageKey) {
const s = loadCfg(storageKey);
const backend = s.backend || "ollama";
const url = (s.backendUrl || getAiBackendDefaultUrl(backend)).replace(/\/$/, "");
return {
backend,
url,
model: s.model || "",
thinkingMode: !!s.thinkingMode,
maxTokens: Math.max(0, parseInt(s.maxTokens, 10) || 0),
};
}
function isValidBackendUrl(url) {
try {
const u = new URL(url);
return u.protocol === "http:" || u.protocol === "https:";
} catch {
return false;
}
}
async function fetchBackendModels(url, backend) {
if (backend === "ollama") {
const res = await fetch(`${url}/api/tags`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return (await res.json()).models?.map(m => m.name) || [];
} else if (backend === "unsloth") {
const data = await unslothProxy(url, "/v1/models", "GET");
return (data.data || []).map(m => m.id);
} else {
const res = await fetch(`${url}/v1/models`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return ((await res.json()).data || []).map(m => m.id);
}
}
/**
* @param {string} storageKey localStorage key holding {backend, backendUrl, model, thinkingMode, maxTokens}
* @param {string} title modal title
* @param {() => void} [onSaved] called after Save persists the config (e.g. to refresh a status label)
*/
export function openAiBackendSettingsModal(storageKey, title, onSaved) {
const saved = loadCfg(storageKey);
const backend = saved.backend || "ollama";
const html = `
<div class="wfm-ai-settings-container">
<div class="wfm-ai-settings-section">
<div class="wfm-ai-settings-title">${t("aiSettingsBackend")}</div>
<div class="wfm-ai-backend-row">
${[["ollama", "Ollama"], ["lmstudio", "LM Studio"], ["lemonade", "Lemonade"], ["unsloth", "Unsloth"]].map(([v, label]) => `
<label class="wfm-ai-radio-label">
<input type="radio" name="wfm-aism-backend" value="${v}" ${v === backend ? "checked" : ""}> ${label}
</label>`).join("")}
</div>
</div>
<div class="wfm-ai-settings-section">
<div class="wfm-ai-settings-title">${t("aiSettingsConnection")}</div>
<div class="wfm-ai-settings-row">
<label class="wfm-ai-label">URL</label>
<input type="text" id="wfm-aism-url" class="wfm-input wfm-ai-url-input" value="${saved.backendUrl || getAiBackendDefaultUrl(backend)}">
</div>
<div class="wfm-ai-settings-row">
<button id="wfm-aism-test-btn" class="wfm-btn">${t("aiSettingsTestBtn")}</button>
<button id="wfm-aism-unload-btn" class="wfm-btn">${t("aiUnloadModel")}</button>
</div>
<div class="wfm-ai-settings-row">
<span id="wfm-aism-test-result" class="wfm-ai-test-result"></span>
</div>
</div>
<div class="wfm-ai-settings-section">
<div class="wfm-ai-settings-title">${t("aiSettingsModelSection")}</div>
<div class="wfm-ai-settings-row">
<select id="wfm-aism-model" class="wfm-select wfm-ai-model-select">
<option value="">${t("selectModel")}</option>
</select>
<button id="wfm-aism-refresh-btn" class="wfm-btn">${t("aiSettingsRefreshBtn")}</button>
</div>
</div>
<div class="wfm-ai-settings-section">
<div class="wfm-ai-settings-title">${t("aiSettingsGenerationTitle")}</div>
<div class="wfm-ai-settings-row">
<label class="wfm-ai-label" style="display:flex;align-items:center;gap:6px;cursor:pointer;">
<input type="checkbox" id="wfm-aism-thinking"> ${t("aiSettingsThinkingMode")}
</label>
</div>
<div class="wfm-ai-settings-row">
<label class="wfm-ai-label">${t("aiSettingsMaxTokens")}</label>
<input type="number" id="wfm-aism-max-tokens" class="wfm-input" min="0" step="1" placeholder="${t("aiSettingsMaxTokensPlaceholder")}">
</div>
</div>
<div class="wfm-ai-settings-section">
<button id="wfm-aism-save-btn" class="wfm-btn wfm-btn-primary">${t("aiSettingsSaveBtn")}</button>
</div>
</div>`;
openModal(title, html);
const urlInput = document.getElementById("wfm-aism-url");
const modelSelect = document.getElementById("wfm-aism-model");
const thinkingCheckbox = document.getElementById("wfm-aism-thinking");
const maxTokensInput = document.getElementById("wfm-aism-max-tokens");
const testResultEl = document.getElementById("wfm-aism-test-result");
thinkingCheckbox.checked = !!saved.thinkingMode;
if (saved.maxTokens) maxTokensInput.value = saved.maxTokens;
function currentBackend() {
return document.querySelector("input[name='wfm-aism-backend']:checked")?.value || "ollama";
}
async function populateModels(selectedModel) {
const url = urlInput.value.trim();
try {
const models = await fetchBackendModels(url, currentBackend());
modelSelect.innerHTML = models.length
? models.map(name => `<option value="${name}" ${name === selectedModel ? "selected" : ""}>${name}</option>`).join("")
: `<option value="">${t("noModelsFound")}</option>`;
} catch {
modelSelect.innerHTML = `<option value="">${t("noModelsFound")}</option>`;
}
}
populateModels(saved.model || "");
document.querySelectorAll("input[name='wfm-aism-backend']").forEach(r => {
r.addEventListener("change", () => {
urlInput.value = getAiBackendDefaultUrl(r.value);
testResultEl.textContent = "";
});
});
document.getElementById("wfm-aism-refresh-btn")?.addEventListener("click", () => populateModels(modelSelect.value));
document.getElementById("wfm-aism-test-btn")?.addEventListener("click", async () => {
const url = urlInput.value.trim();
if (!isValidBackendUrl(url)) {
testResultEl.textContent = t("aiToastInvalidUrlInput");
testResultEl.className = "wfm-ai-test-result wfm-ai-status-error";
return;
}
testResultEl.textContent = t("aiStatusConnecting");
testResultEl.className = "wfm-ai-test-result wfm-ai-status-working";
try {
const models = await fetchBackendModels(url, currentBackend());
testResultEl.textContent = `${t("aiStatusConnectOk")} (${models.length} ${t("aiModels")})`;
testResultEl.className = "wfm-ai-test-result wfm-ai-status-ok";
await populateModels(modelSelect.value);
} catch (err) {
testResultEl.textContent = `${t("aiStatusConnectFail")}${err.message}`;
testResultEl.className = "wfm-ai-test-result wfm-ai-status-error";
}
});
document.getElementById("wfm-aism-unload-btn")?.addEventListener("click", async () => {
const url = urlInput.value.trim();
const model = modelSelect.value;
if (!model) { showToast(t("aiUnloadNoModel"), "error"); return; }
try {
await unloadAiModel(url, currentBackend(), model);
showToast(t("aiUnloadDone"), "success");
} catch (err) {
showToast(err.message === "UNSUPPORTED" ? t("aiUnloadUnsupported") : t("aiUnloadFailed") + err.message, "error");
}
});
document.getElementById("wfm-aism-save-btn")?.addEventListener("click", () => {
const url = urlInput.value.trim();
if (url && !isValidBackendUrl(url)) {
showToast(t("aiToastInvalidUrl"), "error");
return;
}
saveCfg(storageKey, {
backend: currentBackend(),
backendUrl: url,
model: modelSelect.value,
thinkingMode: !!thinkingCheckbox.checked,
maxTokens: Math.max(0, parseInt(maxTokensInput.value, 10) || 0),
});
showToast(t("aiToastSettingsSaved"), "success");
closeModal();
if (onSaved) onSaved();
});
}
+15 -1
View File
@@ -5,7 +5,7 @@
import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { readJsonStorage, getAiBackendDefaultUrl, escapeHtml } from "./util.js";
import { readJsonStorage, getAiBackendDefaultUrl, escapeHtml, unloadAiModel } from "./util.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyEditor } from "./comfyui-editor.js";
import { comfyWorkflow } from "./comfyui-workflow.js";
@@ -456,6 +456,20 @@ function initSettingsTab() {
}
});
// Unload model
document.getElementById("wfm-ai-unload-btn")?.addEventListener("click", async () => {
const backend = document.querySelector("input[name='wfm-ai-backend']:checked")?.value || "ollama";
const url = urlInput?.value?.trim() || "";
const model = document.getElementById("wfm-ai-model-select")?.value || "";
if (!model) { showToast(t("aiUnloadNoModel"), "error"); return; }
try {
await unloadAiModel(url, backend, model);
showToast(t("aiUnloadDone"), "success");
} catch (err) {
showToast(err.message === "UNSUPPORTED" ? t("aiUnloadUnsupported") : t("aiUnloadFailed") + err.message, "error");
}
});
// Model refresh
document.getElementById("wfm-ai-model-refresh-btn")?.addEventListener("click", () => refreshModels());
+4 -5
View File
@@ -319,10 +319,8 @@ function applyI18nToHtml() {
if (assistantHeader) assistantHeader.textContent = t("assistantSubtab");
const presetsHeader = document.querySelector(".wfm-prompt-split-right .wfm-prompt-split-header");
if (presetsHeader) presetsHeader.textContent = t("presetsSubtab");
const ollamaRefreshBtn = document.getElementById("wfm-ollama-refresh-btn");
if (ollamaRefreshBtn) ollamaRefreshBtn.textContent = t("refresh");
const ollamaTestBtn = document.getElementById("wfm-ollama-test-btn");
if (ollamaTestBtn) ollamaTestBtn.textContent = t("test");
const ollamaSettingsBtn = document.getElementById("wfm-ollama-settings-btn");
if (ollamaSettingsBtn) ollamaSettingsBtn.title = t("settings");
const ollamaAttachBtn = document.getElementById("wfm-ollama-attach-btn");
if (ollamaAttachBtn) ollamaAttachBtn.textContent = t("attachImage");
const ollamaClearBtn = document.getElementById("wfm-ollama-clear-btn");
@@ -487,6 +485,7 @@ function applyI18nToHtml() {
"wfm-help-gen-28": "helpGen28",
"wfm-help-gen-29": "helpGen29",
"wfm-help-gen-30": "helpGen30",
"wfm-help-gen-31": "helpGen31",
"wfm-help-feeder-title": "helpFeederTitle",
"wfm-help-feeder-desc": "helpFeederDesc",
"wfm-help-feeder-imgloop-title": "helpFeederImgloopTitle",
@@ -736,7 +735,7 @@ function applyI18nToHtml() {
"wfm-help-video-1": "helpVideo1", "wfm-help-video-2": "helpVideo2",
"wfm-help-video-3": "helpVideo3", "wfm-help-video-4": "helpVideo4",
"wfm-help-video-5": "helpVideo5", "wfm-help-video-6": "helpVideo6",
"wfm-help-video-7": "helpVideo7",
"wfm-help-video-7": "helpVideo7", "wfm-help-video-8": "helpVideo8",
};
for (const [id, key] of Object.entries(helpIdMap)) {
const el = document.getElementById(id);
+8
View File
@@ -1446,6 +1446,12 @@ export const comfyEditor = {
<label>Batch Size</label>
<input type="number" class="wfm-input" id="wfm-settings-batch" value="${latent.batch_size ?? 1}" min="1" max="64">
</div>
${latent.isVideoLatent ? `
<div class="wfm-form-group">
<label>Length (frames)</label>
<input type="number" class="wfm-input" id="wfm-settings-latent-length" value="${latent.length ?? ""}" placeholder="${latent.length === undefined ? "linked" : ""}" step="1" min="1">
</div>
` : ""}
<button class="wfm-btn wfm-btn-sm" id="wfm-settings-latent-apply">Apply</button>
${latent.width === undefined || latent.height === undefined ? `<p class="wfm-placeholder" style="margin-top:6px;">Width/Height is linked to another node (e.g. auto-follows the input image) — leave blank to keep it linked.</p>` : ""}
<div style="margin-top:10px;border-top:1px solid var(--wfm-border);padding-top:10px;">
@@ -1502,6 +1508,8 @@ export const comfyEditor = {
if (wEl?.value !== "") inputs.width = parseInt(wEl.value) || 512;
if (hEl?.value !== "") inputs.height = parseInt(hEl.value) || 512;
inputs.batch_size = parseInt(document.getElementById("wfm-settings-batch")?.value) || 1;
const lenEl = document.getElementById("wfm-settings-latent-length");
if (lenEl && lenEl.value !== "") inputs.length = parseInt(lenEl.value) || 1;
_syncRawJson();
});
+73 -36
View File
@@ -75,6 +75,35 @@ async function _loadObjectInfo() {
* Get ordered widget (non-link) input names for a node class from object_info.
* These correspond to widgets_values in UI-format nodes.
*/
// Scalar widget types object_info can declare for a required/optional input.
const _WIDGET_TYPE_SET = new Set(["INT", "FLOAT", "STRING", "BOOLEAN", "COMBO", "COMFY_DYNAMICCOMBO_V3"]);
/**
* Resolve a possibly-compound object_info type spec (e.g. LTXVEmptyLatentAudio's frame_rate:
* "FLOAT,INT", a MultiType declaration meaning "widget defaults to FLOAT but also accepts an INT
* link") down to the single scalar widget type it actually occupies a widgets_values slot as.
* Preferring the explicit widgetType hint some MultiType specs carry, else the first comma-
* separated segment. Returns null for link-only types (MODEL, CLIP, LATENT, etc.) or arrays that
* aren't combo option lists.
*
* Without this, a plain `upper === "INT" || ...` exact-match check silently drops any
* comma-joined MultiType widget from the name/type lists entirely — which corrupts every widget
* declared after it in the node's schema order in _simulateWidgetValues (see its own docstring),
* exactly the class of bug that produced e.g. LTXVEmptyLatentAudio's batch_size reading
* frame_rate's stale value instead of its own.
*/
function _resolveWidgetType(type, spec) {
if (Array.isArray(type)) return "COMBO";
if (typeof type !== "string") return null;
const explicit = spec?.[1]?.widgetType;
if (typeof explicit === "string" && _WIDGET_TYPE_SET.has(explicit.toUpperCase())) return explicit.toUpperCase();
for (const part of type.split(",")) {
const upper = part.trim().toUpperCase();
if (_WIDGET_TYPE_SET.has(upper)) return upper;
}
return null;
}
function _getWidgetInputNames(objectInfo, classType) {
const info = objectInfo[classType];
if (!info) return [];
@@ -89,31 +118,16 @@ function _getWidgetInputNames(objectInfo, classType) {
// (e.g. CLIPTextEncodeEditPlus's text1/text2). Never has a widgets_values entry.
if (Array.isArray(spec) && spec[1]?.forceInput) continue;
// Link types are strings like "MODEL", "CLIP", "CONDITIONING", "LATENT", "IMAGE", etc.
// Widget types are: "INT", "FLOAT", "STRING", "BOOLEAN", or an array of choices
if (Array.isArray(type)) {
// Combo/enum widget
names.push(name);
} else if (typeof type === "string") {
const upper = type.toUpperCase();
if (upper === "INT" || upper === "FLOAT" || upper === "STRING" || upper === "BOOLEAN" || upper === "COMBO" || upper === "COMFY_DYNAMICCOMBO_V3") {
names.push(name);
}
// Other uppercase types (MODEL, CLIP, etc.) are link inputs, skip
}
// Widget types are: "INT", "FLOAT", "STRING", "BOOLEAN", an array of choices, or a
// comma-joined MultiType union of those (e.g. "FLOAT,INT") — see _resolveWidgetType.
if (_resolveWidgetType(type, spec)) names.push(name);
}
// Optional inputs that are widgets
for (const [name, spec] of Object.entries(optional)) {
const type = Array.isArray(spec) ? spec[0] : spec;
if (Array.isArray(spec) && spec[1]?.forceInput) continue;
if (Array.isArray(type)) {
names.push(name);
} else if (typeof type === "string") {
const upper = type.toUpperCase();
if (upper === "INT" || upper === "FLOAT" || upper === "STRING" || upper === "BOOLEAN" || upper === "COMFY_DYNAMICCOMBO_V3") {
names.push(name);
}
}
if (_resolveWidgetType(type, spec)) names.push(name);
}
return names;
@@ -133,26 +147,14 @@ function _getWidgetInputTypes(objectInfo, classType) {
for (const [name, spec] of Object.entries(required)) {
const type = Array.isArray(spec) ? spec[0] : spec;
if (Array.isArray(spec) && spec[1]?.forceInput) continue;
if (Array.isArray(type)) {
types.push("COMBO");
} else if (typeof type === "string") {
const upper = type.toUpperCase();
if (upper === "INT" || upper === "FLOAT" || upper === "STRING" || upper === "BOOLEAN" || upper === "COMBO" || upper === "COMFY_DYNAMICCOMBO_V3") {
types.push(upper);
}
}
const resolved = _resolveWidgetType(type, spec);
if (resolved) types.push(resolved);
}
for (const [name, spec] of Object.entries(optional)) {
const type = Array.isArray(spec) ? spec[0] : spec;
if (Array.isArray(spec) && spec[1]?.forceInput) continue;
if (Array.isArray(type)) {
types.push("COMBO");
} else if (typeof type === "string") {
const upper = type.toUpperCase();
if (upper === "INT" || upper === "FLOAT" || upper === "STRING" || upper === "BOOLEAN" || upper === "COMBO" || upper === "COMFY_DYNAMICCOMBO_V3") {
types.push(upper);
}
}
const resolved = _resolveWidgetType(type, spec);
if (resolved) types.push(resolved);
}
return types;
}
@@ -962,6 +964,14 @@ export const comfyWorkflow = {
if (Array.isArray(inputs.positive)) samplerPositiveRef[inputs.positive[0]] = true;
if (Array.isArray(inputs.negative)) samplerNegativeRef[inputs.negative[0]] = true;
}
// LTXVDualCFGGuider (LTX-2.5's video+audio guider) — positive/negative both
// commonly point at the *same* LTXVConditioning node (different output slots),
// so this only seeds the role on that node; LTXVConditioning below splits it
// back out per-slot onto its own positive/negative inputs.
if (ct === "LTXVDualCFGGuider") {
if (Array.isArray(inputs.positive)) samplerPositiveRef[inputs.positive[0]] = true;
if (Array.isArray(inputs.negative)) samplerNegativeRef[inputs.negative[0]] = true;
}
}
// === Pass 1b: Expand refs through CONDITIONING graph (BFS, 5 iterations) ===
@@ -1038,6 +1048,13 @@ export const comfyWorkflow = {
if (isPos && Array.isArray(inputs.positive)) samplerPositiveRef[inputs.positive[0]] = true;
if (isNeg && Array.isArray(inputs.negative)) samplerNegativeRef[inputs.negative[0]] = true;
}
// LTXVConditioning (LTX-2.5) — same shape as InstructPixToPixConditioning:
// separate positive/negative inputs feeding separate outputs consumed by
// LTXVDualCFGGuider, so each role must route only to its own input.
if (ct === "LTXVConditioning") {
if (isPos && Array.isArray(inputs.positive)) samplerPositiveRef[inputs.positive[0]] = true;
if (isNeg && Array.isArray(inputs.negative)) samplerNegativeRef[inputs.negative[0]] = true;
}
// ComfySwitchNode ("If/Else Switch", on_false/on_true/switch) — used by Ernie
// Image's prompt-enhancement toggle to pick between the raw PrimitiveStringMultiline
// text and an LLM-generated (TextGenerate) rewrite. The rewrite can't be known
@@ -1363,6 +1380,21 @@ export const comfyWorkflow = {
});
}
// Video latent nodes (Wan2.2's EmptyHunyuanLatentVideo, LTX-2.5's
// EmptyLTXVLatentVideo) — same width/height/batch_size shape as EmptyLatentImage
// plus a frame-count "length" input, usually linked to a duration*fps expression
// (see video-tab.js's own Wan2.2/LTX-2.5 handling) rather than a literal number —
// left undefined in that case so the settings-tab UI shows "linked".
if (ct === "EmptyHunyuanLatentVideo" || ct === "EmptyLTXVLatentVideo") {
result.latent_nodes.push({
id, type: ct, title, isVideoLatent: true,
width: typeof inputs.width === "number" ? inputs.width : undefined,
height: typeof inputs.height === "number" ? inputs.height : undefined,
batch_size: inputs.batch_size,
length: typeof inputs.length === "number" ? inputs.length : undefined,
});
}
// ResolutionSelector (ComfyUI core, comfy_extras.nodes_resolution): typically
// feeds an EmptyLatentImage's width/height rather than being a latent node
// itself. aspect_ratio is a fixed-choice COMBO (e.g. "3:2 (Photo)") — its exact
@@ -1537,7 +1569,12 @@ export const comfyWorkflow = {
// generation timeout (video generation runs far longer than a still image) — see
// generate-tab.js _coreGenerate and lab-tab.js _runLabBatch.
isVideoWorkflow(analysis) {
return (analysis?.prompt_nodes || []).some((n) => /ImageToVideo|TextToVideo/.test(n.type));
if ((analysis?.prompt_nodes || []).some((n) => /ImageToVideo|TextToVideo/.test(n.type))) return true;
// LTX-2.5/Wan2.2: no all-in-one *ToVideo node — detected instead via their
// EmptyHunyuanLatentVideo/EmptyLTXVLatentVideo latent node (see analyzeWorkflow)
// or a SaveVideo/CreateVideo node anywhere in the flattened graph.
if ((analysis?.latent_nodes || []).some((n) => n.isVideoLatent)) return true;
return (analysis?.all_nodes || []).some((n) => n.type === "SaveVideo" || n.type === "CreateVideo");
},
applyParams(workflow, params) {
+16 -1
View File
@@ -14,6 +14,7 @@ import { comfyEditor } from "./comfyui-editor.js";
import { callLLM, loadAiSettings, isValidBackendUrl } from "./ai-tab.js";
import { initImagePromptTab, activateImagePromptTab } from "./image-prompt-tab.js";
import { initStyleCatalogTab, activateStyleCatalogTab } from "./style-catalog-tab.js";
import { applyStoredVideoVolume } from "./settings-tab.js";
// ── 定数 ─────────────────────────────────────────────────────
@@ -467,6 +468,16 @@ function renderTreeNode(node, container, depth, isRoot) {
container.appendChild(item);
container.appendChild(childContainer);
// root フォルダはデフォルトで展開状態にする(フォルダスキャン高速化により
// サブフォルダの内容もすぐ確認できるようになったため、折りたたみ初期状態だと
// 気付きにくい)
if (isRoot) {
arrow.dataset.expanded = "true";
arrow.textContent = "▼";
childContainer.style.display = "";
node.children.forEach(child => renderTreeNode(child, childContainer, depth + 1, false));
}
} else {
container.appendChild(item);
}
@@ -910,7 +921,9 @@ async function loadImageDetail(img) {
${mediaHtml}
</div>
`;
preview.querySelector(isVideo ? "video" : "img").addEventListener("dblclick", () => openLightbox(img));
const previewMediaEl = preview.querySelector(isVideo ? "video" : "img");
previewMediaEl.addEventListener("dblclick", () => openLightbox(img));
if (isVideo) applyStoredVideoVolume(previewMediaEl);
// ファイル名
document.getElementById("wfm-gallery-detail-filename").textContent = img.filename;
@@ -1647,6 +1660,7 @@ function openLightbox(img) {
}
});
document.body.appendChild(overlay);
if (isVideoFile(img)) applyStoredVideoVolume(overlay.querySelector("video"));
}
// ── 画像比較ライトボックス ─────────────────────────────────────
@@ -1682,6 +1696,7 @@ function openCompare(paths) {
}
});
document.body.appendChild(overlay);
overlay.querySelectorAll("video").forEach(applyStoredVideoVolume);
}
// ── outputパス取得 ────────────────────────────────────────────
+11 -3
View File
@@ -293,6 +293,13 @@ export async function loadWorkflowIntoEditor(workflow, filename) {
refreshFeederNodeList();
// Lab subtab may already be the active one (e.g. it was active when this workflow
// was loaded) — the subtab-click handler that normally triggers this refresh never
// fires in that case, leaving Setting 1's live-reflected cells showing the previous
// workflow until the user clicks a cell or revisits the subtab.
const activeSubtab = document.querySelector(".wfm-gen-subtab-btn.active")?.dataset.subtab;
if (activeSubtab === "lab") refreshLabLiveDefaults();
if (ckptWarning) {
showToast(ckptWarning, "error");
} else {
@@ -2284,10 +2291,11 @@ export async function initGenerateTab() {
});
searchOverlay.innerHTML = html + "\n";
// Scroll editor to current match
// Scroll editor to current match. フォーカス/selectionRangeは意図的に設定しない
// (テキストエリアにカーソルが当たった状態になり、検索直後のキー入力が選択範囲を
// 上書きして不意にJSONを編集してしまうため)。ハイライトはsearchOverlayの<mark>
// 表示のみで行い、編集はユーザーが明示的にエディタをクリックした場合に限る。
const pos = matchPositions[currentMatchIndex];
editor.focus();
editor.setSelectionRange(pos, pos + term.length);
const lineNum = (text.slice(0, pos).match(/\n/g) || []).length;
const lineH = parseFloat(getComputedStyle(editor).lineHeight) || 18;
editor.scrollTop = Math.max(0, lineH * lineNum - editor.clientHeight / 2);
+75 -45
View File
@@ -329,6 +329,8 @@ const LANGUAGES = {
textSizeLabel: "Text Size",
textSizeTextarea: "Prompt / Chat Textarea",
textSizeHint: "Applies to: Generate UI prompts, AI Assistant chat, Preset prompts, Wildcard textarea, Metadata prompt preview",
videoVolumeLabel: "Video Volume",
videoVolumeHint: "Applies to: Video tab preview, Gallery detail/lightbox/compare video players — the level you set here (or adjust via any video's own controls) carries over to the next video opened anywhere in the app.",
jsonColorsSection: "RAW JSON Colors",
jsonColorBase: "Base text",
jsonColorYellow: "Names / Scheduler",
@@ -646,7 +648,7 @@ const LANGUAGES = {
taggerThreshold: "Threshold",
taggerCharThreshold: "Char Thr.",
taggerGenerateTags: "Generate Tags",
taggerOllamaEnable: "Ollama VLM",
taggerOllamaEnable: "VLM Tagging",
taggerOllamaUrl: "API URL",
taggerOllamaModel: "Model",
taggerOllamaPrompt: "Prompt",
@@ -715,6 +717,12 @@ const LANGUAGES = {
aiSettingsInputLang: "Input",
aiSettingsOutputLang: "Output",
aiSettingsSaveBtn: "Save Settings",
aiUnloadModel: "Unload Model",
aiUnloading: "Unloading...",
aiUnloadDone: "Model unloaded",
aiUnloadFailed: "Unload failed: ",
aiUnloadUnsupported: "This backend does not support unloading via API",
aiUnloadNoModel: "Select a model first",
aiToastNoText: "Please enter text",
aiToastNoModel: "Please select a model in the Settings tab",
aiToastInvalidUrl: "URL must start with http:// or https://",
@@ -785,7 +793,8 @@ const LANGUAGES = {
helpGen5: "Model tab: Checkpoint, VAE, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors) are always shown; ControlNet and Hypernetwork (with Strength field) are collapsed by default since they're used less often — click their header to expand; LoRA (Single/Stack tabs) has its own column to the right; all selectors have a filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones",
helpGen28: "Model tab — Highlight color: the label of each model type (Checkpoint, VAE, Diffusion Model, Text Encoder, ControlNet, Hypernetwork) and the LoRA column header turn a distinct color (default bright green) when the loaded workflow actually contains that type of node; this stays visible even while ControlNet/Hypernetwork are collapsed, so you can tell at a glance whether they're in use without expanding them; the color is customizable in the Settings tab",
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
helpGen7: "Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow; if the loaded workflow has Bypass or Mute nodes, a note listing them appears above the search bar (Bypass nodes are excluded with their wires reconnected around them; Mute nodes are excluded with no reconnection, matching ComfyUI itself)",
helpGen31: "LTX-2.5 and Wan2.2 video workflows also work when loaded as regular workflows in this tab (not just the dedicated Video tab): Positive/Negative Prompt detection follows LTX-2.5's LTXVDualCFGGuider / LTXVConditioning nodes to find the actual prompt text, and the Settings tab's Latent Image section recognizes Wan2.2's EmptyHunyuanLatentVideo and LTX-2.5's EmptyLTXVLatentVideo nodes (with an added Length (frames) field) instead of showing \"No EmptyLatentImage node found\"; generating from these workflows also gets the same extended timeout as MiniMax H3 video generations",
helpGen7: "Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow; if the loaded workflow has Bypass or Mute nodes, a note listing them appears above the search bar (Bypass nodes are excluded with their wires reconnected around them; Mute nodes are excluded with no reconnection, matching ComfyUI itself); the search bar highlights matches and scrolls to them without moving the cursor into the editor, so typing right after a search can't accidentally overwrite the JSON — click into the editor first to actually edit",
helpGen8: "Seed control: random, fixed, increment, decrement",
helpGen9: "Generate, progress display, stop, and view results",
helpGen10: "Eagle integration: auto-save generated images to Eagle (SVG output supported too — both the standard SaveSVGNode and comfyui-tosvg's Save SVG String node)",
@@ -867,7 +876,7 @@ const LANGUAGES = {
helpLabResults3: "Loading a saved plan restores its Results grid from the image list recorded in the plan file",
helpSearchPlaceholder: "Search help...",
helpPrompt1: "AI assistant (Ollama / LM Studio / Lemonade): model selection, chat for prompt consultation, image attachment (vision models); backend and URL configured in Settings tab",
helpPrompt1: "AI assistant (Ollama / LM Studio / Lemonade / Unsloth): chat for prompt consultation, image attachment (vision models); click the ⚙ Settings button to choose backend, connection URL, model, Thinking mode, Max tokens, and unload the loaded model — settings are independent from the AI TOOL and Tagger tabs",
helpPrompt2: "Apply AI responses to GenerateUI prompts",
helpPrompt3: "Translation: JA\u2194EN, ZH\u2194EN",
helpPrompt4: "Preset management: create, edit, positive/negative prompt clipboard copy (PP/NP)",
@@ -897,7 +906,7 @@ const LANGUAGES = {
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",
helpSettings4: "ComfyUI connection URL and test",
helpSettings5: "AI Assistant (Prompt Tab): backend (Ollama / LM Studio / Lemonade), API URL, default model, and connection test",
helpSettings5: "AI Assistant settings have moved out of this tab — the Prompt tab, Tagger tab, and AI TOOL tab each have their own ⚙ Settings button (backend, URL, model, Thinking mode, Max tokens, unload model), saved independently",
helpSettings6: "Default workflow setting",
helpSettings7: "Eagle integration URL and auto-save toggle",
helpSettings8: "Data Management: export core settings, metadata, and prompts to a JSON file, or import to restore. After importing, restart ComfyUI.",
@@ -959,13 +968,13 @@ const LANGUAGES = {
// -- Tagger Tab --
helpTaggerTitle: "Tagger Tab",
helpTagger1: "Automatic image tagging using WD Tagger (ONNX), SwinV2, DeepDanbooru (.h5), and Ollama VLM — 3 sub-tabs: Single / Batch / DB",
helpTagger1: "Automatic image tagging using WD Tagger (ONNX), SwinV2, DeepDanbooru (.h5), and VLM (Ollama / LM Studio / Lemonade / Unsloth) — 3 sub-tabs: Single / Batch / DB",
helpTagger2: "Model placement: put each model in its own subfolder under ComfyUI/models/tagger/<model-name>/; the folder must contain a .onnx file + selected_tags.csv (or .h5 + label file for DeepDanbooru)",
helpTagger3: "Single tab: drag & drop an image onto the preview area, or click Upload to pick a file; the Tagger button in the Gallery detail panel opens the selected image directly here",
helpTagger4: "Threshold slider: minimum confidence score for general tags (default 0.35); Character Threshold: separate threshold for character: prefix tags (default 0.85)",
helpTagger5: "Ollama VLM: enable the checkbox to run a vision model alongside WD Tagger; set API URL, select model (click ↻ to refresh), and customize the prompt; results from both models are merged",
helpTagger5: "VLM Tagging: enable the checkbox to run a vision model alongside WD Tagger; click the ⚙ Settings button to choose backend (Ollama / LM Studio / Lemonade / Unsloth), URL, model, Thinking mode, Max tokens, and unload the model — independent from the Prompt tab's own AI settings; customize the prompt and Max Tags inline; results from both models are merged",
helpTagger6: "Result tags can be sent to: (1) GenUI:P — appended to the GenerateUI tab's positive prompt textarea and applied to the loaded workflow immediately; (2) Send to Prompt — appended to the Prompt tab's positive textarea; (3) Save to Gallery — saved to Gallery image metadata (requires image opened from Gallery); (4) Write to File — embedded into JPEG EXIF (ImageDescription) or PNG tEXt (Tags key); (5) Save to DB — stored in the internal SQLite database",
helpTagger7: "Batch tab: enter a folder path, configure WD Tagger and Ollama settings; output options: Save to DB (default on), Write to File (EXIF/PNG metadata), Write .txt (creates <filename>.txt alongside each image); click Start Batch to process all images in the folder; progress bar and log are updated in real time; Stop cancels after the current image",
helpTagger7: "Batch tab: enter a folder path, configure WD Tagger and enable VLM tagging (uses the same ⚙ Settings as the Single tab); output options: Save to DB (default on), Write to File (EXIF/PNG metadata), Write .txt (creates <filename>.txt alongside each image); click Start Batch to process all images in the folder; progress bar and log are updated in real time; Stop cancels after the current image",
helpTagger8: "DB tab: searchable database of all tagged images; click a row to open the edit panel and modify WD Tags / VLM Tags; Save updates the record, Delete removes it; Export CSV downloads all records as a CSV file",
helpTagger9: "Install dependencies into ComfyUI's embedded Python: python_embeded\\python.exe -m pip install -r requirements.txt; for GPU ONNX inference install onnxruntime-gpu instead of onnxruntime; TensorFlow (for DeepDanbooru) is commented out by default due to size",
@@ -992,7 +1001,7 @@ const LANGUAGES = {
helpAi2: "Translation pane: translate between Japanese, English, Chinese, or Free language using Ollama, LM Studio, Lemonade, or Unsloth; ⇄ swap button swaps both language selectors and text content; selections are saved automatically",
helpAi3: "Chat pane: multi-turn conversation with the LLM; Enter to send a message, Shift+Enter for a newline; Clear button resets the conversation history; if the model supports tool calling and asks for an image (\"generate a cat picture\", etc.) it will run generation on the workflow currently loaded in GenerateUI and show the result inline; the \"Allow image generation\" checkbox in the pane header toggles this on/off; if an image is attached (dropped in the TOOLS pane) it is sent to the LLM as vision input and, when generate_image is called, used as the base for image-to-image generation instead of text-to-image; generate_image also accepts optional generation parameters the model can fill in from the request — steps, cfg, sampler_name, scheduler, denoise, seed, width, height, batch_size (number of images produced in that one call), and aspect_ratio (a ratio preset like \"3:2\", applied only if the workflow has a Resolution Selector node feeding width/height — ignored otherwise); anything the model doesn't supply keeps whatever the loaded workflow already has set; models verified to work well for tool calling and vision: Gemma 4:e4b, Qwen 3.5:9b, Ministral 3:3b (Ollama)",
helpAi4: "TOOLS pane — VLM: drop an image (PNG/JPG/WebP) and select a task (Describe Image, Create Prompt, Create Tags), click Run; or select \"Create wildcards\", enter a category name and count to generate plain-text entries one per line; the dropped image is also shared with the Chat pane as its attachment (shown there and used for image-to-image generation) until cleared with the ✕ button",
helpAi6: "Settings pane: choose backend (Ollama / LM Studio / Lemonade / Unsloth), set API URL, test connection, select model; Unsloth always requires an API key even for local access — set UNSLOTH_API_KEY in a .env file in the plugin folder (copy .env.example) and restart ComfyUI, the key is read server-side and never sent to the browser; Unsloth also requires \"Auto model switching (OpenAI API)\" to be turned ON in the Unsloth Desktop app itself (its own Settings screen) — without it, requests fail with HTTP 404 unless a model was already manually loaded in the Unsloth Studio UI; Unsloth reasoning models return their thinking in a separate reasoning_content field rather than inline <think> tags, so a low Max tokens can make the model spend its whole budget reasoning and return an empty reply — increase Max tokens (2048+) if replies come back blank; Generation section — Thinking mode toggle (off by default; Ollama receives a think flag, and regardless of backend any <think>...</think> block is stripped from the output when off, so reasoning models don't clutter Translation/Chat/TOOLS results) and Max tokens (Ollama: num_predict, LM Studio/Lemonade/Unsloth: max_tokens; 0 = unlimited); configure Free language names; Chat Image Generation section lets you enable a dedicated workflow for Chat-triggered text-to-image generation instead of the one currently loaded in GenerateUI; Chat I2I Generation section is the same but for image-to-image generation when an image is attached; settings are shared with the Library panel's A tab via localStorage",
helpAi6: "Settings pane: choose backend (Ollama / LM Studio / Lemonade / Unsloth), set API URL, test connection, select model, and use the Unload Model button (next to Test connection) to free the loaded model from VRAM/memory — Ollama uses keep_alive:0, LM Studio uses /api/v1/models/unload, Lemonade uses /api/v1/unload; Unsloth has no unload API, so this shows an unsupported message for it; Unsloth always requires an API key even for local access — set UNSLOTH_API_KEY in a .env file in the plugin folder (copy .env.example) and restart ComfyUI, the key is read server-side and never sent to the browser; Unsloth also requires \"Auto model switching (OpenAI API)\" to be turned ON in the Unsloth Desktop app itself (its own Settings screen) — without it, requests fail with HTTP 404 unless a model was already manually loaded in the Unsloth Studio UI; Unsloth reasoning models return their thinking in a separate reasoning_content field rather than inline <think> tags, so a low Max tokens can make the model spend its whole budget reasoning and return an empty reply — increase Max tokens (2048+) if replies come back blank; Generation section — Thinking mode toggle (off by default; Ollama receives a think flag, and regardless of backend any <think>...</think> block is stripped from the output when off, so reasoning models don't clutter Translation/Chat/TOOLS results) and Max tokens (Ollama: num_predict, LM Studio/Lemonade/Unsloth: max_tokens; 0 = unlimited); configure Free language names; Chat Image Generation section lets you enable a dedicated workflow for Chat-triggered text-to-image generation instead of the one currently loaded in GenerateUI; Chat I2I Generation section is the same but for image-to-image generation when an image is attached; settings are shared with the Library panel's A tab via localStorage",
helpAi7: "Chat pane — SVG: the LLM can also produce SVG graphics directly as text, with no ComfyUI workflow involved; ask it to draw something in SVG and, if the reply contains SVG code, it is rendered inline as a preview with a \"Save to Gallery\" button that writes it as a .svg file to the Gallery tab's output folder; this does not use tool calling, so it works with any model regardless of tool-calling support",
helpAi8: "Chat pane — Skills: pick a skill from the dropdown above the message list to prepend its instructions to the conversation as a system prompt (not shown in the visible chat log); use the pencil button to open the skill manager and create, edit, or delete .md skill files, stored in user/default/Workflow-Studio/ai_skills/; a file's first line block between --- markers can define name/description shown in the dropdown; two starter skills are included by default: \"SVG Icon Generator\" (decomposes the subject into parts before drawing, for more recognizable SVG output) and \"Skill Creator\" (interviews you conversationally and drafts a new skill file, ready to save); when a reply contains a ```skill code block, a \"Save as new skill\" button appears below it that opens the manager with the draft pre-filled",
helpAi9: "Tips for writing your own skills: give a clear frontmatter name/description so it reads well in the dropdown and tooltip; state the exact output format you want and, if there is a deliverable to extract later (like SVG or another skill file), wrap it in a distinctive fenced code block; write concrete, imperative instructions rather than vague ones - smaller local models follow explicit rules and a short worked example far better than general guidance; state hard constraints (forbidden content, security, length limits) explicitly rather than assuming they are implied; when in doubt, select the \"Skill Creator\" skill in the dropdown and describe what you want - it will interview you and draft the file for you",
@@ -1315,10 +1324,10 @@ const LANGUAGES = {
helpMetadata5: "Supported: ComfyUI PNG/WebP/MP4/JSON (standard + Flux.2 / Qwen-Image / Z-Image / Mage-Flow / LongCat / Boogu / HiDream E1 / FireRed / Ernie Image subgraph workflows; MP4 reads the workflow/prompt container tags written by SaveVideo, including all-in-one video nodes like MiniMax H3 ImageToVideo), SD WebUI, SD Forge, Fooocus.",
helpMetadata6: "This is now a sub-tab inside the Gallery tab (to the right of Style_Catalog), rather than its own top-level tab — everything else about it works exactly the same",
// -- Video Tab (MiniMax H3, independent of GenerateUI) --
// -- Video Tab (MiniMax H3 / LTX-2.5 / Wan2.2, independent of GenerateUI) --
tabVideo: "Video",
loadInVideo: "Load in Video",
videoTitle: "Video (MiniMax H3)",
videoTitle: "Video",
videoFirstFrame: "First Frame (optional)",
videoLastFrame: "Last Frame (optional)",
videoDropOrClick: "Drop image or click to select",
@@ -1332,7 +1341,7 @@ const LANGUAGES = {
videoGenerate: "Generate",
videoEditPlaceholder: "Editing tools coming soon",
videoNoWorkflowLoaded: "No workflow loaded",
videoUnsupportedWorkflow: "This workflow does not contain a MiniMax H3 Image-to-Video node",
videoUnsupportedWorkflow: "This workflow does not contain a supported video model node (MiniMax H3, LTX-2.5 Text/Image/First&Last-Frame to Video, or Wan2.2 Text to Video)",
videoWorkflowLoaded: (name) => `Workflow loaded: ${name}`,
videoGenerateSuccess: "Video generated",
videoDoneCount: (n) => `Done (${n} file${n === 1 ? "" : "s"})`,
@@ -1357,14 +1366,15 @@ const LANGUAGES = {
videoGifSaved: (name) => `GIF saved: ${name}`,
videoNoSourceLoaded: "Load a video first (generate one, or drop a file into Video Source)",
helpVideoTitle: "Video Tab",
helpVideoDesc: "A dedicated video generation tab for the MiniMax H3 (Image to Video) workflow, independent of the GenerateUI tab.",
helpVideoDesc: "A dedicated video generation tab for MiniMax H3 (Image to Video), LTX-2.5 (Text / Image / First & Last Frame to Video), and Wan2.2 (Text to Video) workflows, independent of the GenerateUI tab.",
helpVideo1: "Set first_frame (optional) / last_frame (optional) images, prompt, aspect_ratio / megapixels / multiple (resolution), duration (seconds), and noise_seed, then click Generate. Leaving first_frame empty runs the workflow text-only (bypassed), and workflows with no LoadImage node at all are also supported.",
helpVideo2: "Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults and cannot be changed from this tab.",
helpVideo3: "Use the \"Load in Video\" button in the Workflow tab's detail modal to load a workflow containing a MiniMax H3 Image-to-Video node. Unsupported workflows show an error instead.",
helpVideo2: "Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults and cannot be changed from this tab. For workflows with no ResolutionSelector node (e.g. Wan2.2), resolution also stays fixed to the loaded workflow's defaults and the Aspect Ratio / Megapixels / Multiple fields are disabled.",
helpVideo3: "Use the \"Load in Video\" button in the Workflow tab's detail modal to load a workflow containing a MiniMax H3 Image-to-Video node, an LTX-2.5 Text/Image/First&Last-Frame-to-Video node, or a Wan2.2 Text-to-Video node. Unsupported workflows show an error instead.",
helpVideo4: "Generated videos (mp4) can also be browsed and played back in the Gallery tab.",
helpVideo5: "The Video Source panel next to the preview lets you drop or pick any local video (not just a generated one) to use the Frame/GIF tools below without running MiniMax H3 first; Clear resets it back to empty.",
helpVideo5: "The Video Source panel next to the preview lets you drop or pick any local video (not just a generated one) to use the Frame/GIF tools below without running the loaded video workflow first; Clear resets it back to empty.",
helpVideo6: "Frame tab (right panel): play/seek the preview video to the position you want, click Capture Frame to grab that frame client-side, then Save to Output to write it as a PNG into ComfyUI's output folder.",
helpVideo7: "GIF tab (right panel): set Start/End (seconds), FPS, and an optional Max Width, then Convert to GIF — the server decodes the video and encodes an animated GIF into ComfyUI's output folder.",
helpVideo8: "Highlight color: the Prompt / Duration / First Frame / Last Frame / Aspect Ratio / Megapixels / Multiple labels turn the same highlight color as the GenerateUI Model tab (customizable in the Settings tab) when the loaded workflow actually supports that field — e.g. for a Wan2.2 workflow (no ResolutionSelector node), the Aspect Ratio / Megapixels / Multiple labels stay unhighlighted since those fields are disabled.",
},
ja: {
@@ -1690,6 +1700,8 @@ const LANGUAGES = {
textSizeLabel: "文字サイズ",
textSizeTextarea: "プロンプト / チャット入力欄",
textSizeHint: "適用対象: 生成UIプロンプト、AIアシスタントチャット、プリセットプロンプト、ワイルドカード編集、Metadataプロンプトプレビュー",
videoVolumeLabel: "動画の音量",
videoVolumeHint: "適用対象: Videoタブのプレビュー、Galleryタブの詳細/ライトボックス/比較動画プレーヤー。ここで設定した音量(または各動画自身のコントロールで変更した音量)は、アプリ内のどこで次に動画を開いても引き継がれます。",
jsonColorsSection: "RAW JSON 文字色",
jsonColorBase: "通常テキスト",
jsonColorYellow: "名前 / スケジューラ",
@@ -2007,7 +2019,7 @@ const LANGUAGES = {
taggerThreshold: "閾値",
taggerCharThreshold: "キャラ閾値",
taggerGenerateTags: "タグ生成",
taggerOllamaEnable: "Ollama VLM",
taggerOllamaEnable: "VLMタグ付け",
taggerOllamaUrl: "API URL",
taggerOllamaModel: "モデル",
taggerOllamaPrompt: "プロンプト",
@@ -2076,6 +2088,12 @@ const LANGUAGES = {
aiSettingsInputLang: "入力言語",
aiSettingsOutputLang: "翻訳言語",
aiSettingsSaveBtn: "設定を保存",
aiUnloadModel: "モデルをアンロード",
aiUnloading: "アンロード中...",
aiUnloadDone: "モデルをアンロードしました",
aiUnloadFailed: "アンロード失敗: ",
aiUnloadUnsupported: "このバックエンドはAPI経由のアンロードに未対応です",
aiUnloadNoModel: "先にモデルを選択してください",
aiToastNoText: "テキストを入力してください",
aiToastNoModel: "設定タブでモデルを選択してください",
aiToastInvalidUrl: "URLは http:// または https:// で始まる必要があります",
@@ -2146,7 +2164,8 @@ const LANGUAGES = {
helpGen5: "Modelタブ:Checkpoint/VAE/Diffusion Model(UNETLoader / UnetLoaderGGUF / LoaderGGUF対応)/Text Encoder(CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF対応 — typeおよびdevice選択付き、DualCLIPは2段モデル選択)は常時表示;ControlNetとHypernetwork(Strength入力付き)は使用頻度が低いためデフォルトで折りたたみ — 見出しをクリックで展開;LoRA(Single/Stackタブ)は右側に独立した列を表示;すべてのセレクタにフィルタ検索付き;LoRA Stack — Applyで有効な全LoRAを対象ノードに書き込み、同時にLoRA構文とCivitAIトリガーワードをPositiveプロンプトへ挿入;再Applyでは非アクティブなLoRAを削除し、アクティブなLoRAを再追加してプロンプトを更新",
helpGen28: "Modelタブ — ハイライト色:読み込んだワークフローに実際に該当ノードが含まれる場合、各モデル種別(Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork)のラベルとLoRA列見出しが指定色(デフォルトは明るい緑)で表示される;ControlNet/Hypernetworkが折りたたまれた状態でも色は見えるため、展開しなくても使用有無が一目で分かる;色はSettingsタブでカスタマイズ可能",
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
helpGen7: "Raw JSONを各タブの右列に常時表示 — 直接編集してApplyでワークフロー即時反映;読み込んだワークフローにBypass/Muteノードがある場合、検索バー上部に一覧が表示される(Bypassは除外され配線が再接続される、Muteは除外されるが再接続はされない点はComfyUI本体と同じ)",
helpGen31: "LTX-2.5とWan2.2の動画ワークフローも、専用のVideoタブだけでなく本タブに通常ワークフローとして読み込んだ場合に対応 — Positive/Negative PromptはLTX-2.5のLTXVDualCFGGuider / LTXVConditioningノードをたどって実際のプロンプト文を検出し、SettingsタブのLatent ImageはWan2.2のEmptyHunyuanLatentVideoとLTX-2.5のEmptyLTXVLatentVideoノードを認識(Length(フレーム数)欄も追加表示)して「No EmptyLatentImage node found」にならない;これらのワークフローからの生成もMiniMax H3の動画生成と同じ延長タイムアウトが適用される",
helpGen7: "Raw JSONを各タブの右列に常時表示 — 直接編集してApplyでワークフロー即時反映;読み込んだワークフローにBypass/Muteノードがある場合、検索バー上部に一覧が表示される(Bypassは除外され配線が再接続される、Muteは除外されるが再接続はされない点はComfyUI本体と同じ);検索バーはヒット箇所をハイライト表示してスクロールするだけでエディタにカーソルを移動しないため、検索直後にキー入力してもJSONが誤って書き換わることはない — 編集する際はエディタ内をクリックしてから行う",
helpGen8: "シード管理:ランダム / 固定 / 増加 / 減少",
helpGen9: "画像生成、進捗表示、生成停止、結果表示",
helpGen10: "Eagle連携:生成画像をEagleへ自動保存(SVG出力にも対応 — 標準SaveSVGNodeおよびcomfyui-tosvgのSave SVG Stringノードの両方)",
@@ -2228,7 +2247,7 @@ const LANGUAGES = {
helpLabResults3: "保存済みプランを読み込むと、プランファイルに記録された画像一覧からResultsの表示が復元されます",
helpSearchPlaceholder: "ヘルプを検索...",
helpPrompt1: "AIアシスタント(Ollama / LM Studio / Lemonade):モデル選択、チャットでプロンプト相談、画像添付(ビジョンモデル対応);バックエンドとURLは設定タブで設定",
helpPrompt1: "AIアシスタント(Ollama / LM Studio / Lemonade / Unsloth):チャットでプロンプト相談、画像添付(ビジョンモデル対応);⚙ 設定ボタンからバックエンド・接続URL・モデル・Thinking mode・Max tokensの選択とロード中モデルのアンロードが可能——設定はAI TOOLタブ・Taggerタブとは独立して保存される",
helpPrompt2: "AIの応答をGenerateUIのプロンプトに適用",
helpPrompt3: "翻訳機能:日⇔英、中⇔英",
helpPrompt4: "プリセット管理:作成・編集、ポジティブ/ネガティブプロンプトのクリップボードコピー(PP/NP)",
@@ -2258,7 +2277,7 @@ const LANGUAGES = {
helpSettings2: "テーマ選択(13種プリセット)+カスタマイズ:カラー調整、背景パターン(ストライプ、ポルカドット、チェック、SVGタイリング)、フォント選択(日本語デザインフォント含む16種のGoogle Fonts)",
helpSettings3: "ワークフローデータフォルダのパス変更・リセット",
helpSettings4: "ComfyUI接続URL設定と接続テスト",
helpSettings5: "AI Assistant(プロンプトタブ):バックエンド(Ollama / LM Studio / Lemonade)・API URL・デフォルトモデル・接続テスト",
helpSettings5: "AI Assistant設定はこのタブから移動しました——Promptタブ・Taggerタブ・AI TOOLタブそれぞれが独自の⚙設定ボタン(バックエンド・URL・モデル・Thinking mode・Max tokens・モデルのアンロード)を持ち、個別に保存されます",
helpSettings6: "デフォルトワークフローの設定・解除",
helpSettings7: "Eagle連携URL、自動保存の有効/無効",
helpSettings8: "データ管理:設定・メタデータ・プロンプトなど主要データをJSONにエクスポート、またはインポートして復元。インポート後はComfyUIを再起動してください。",
@@ -2319,13 +2338,13 @@ const LANGUAGES = {
// -- Tagger Tab --
helpTaggerTitle: "Taggerタブ",
helpTagger1: "WD Tagger(ONNX)・SwinV2・DeepDanbooru(.h5)・Ollama VLMによる自動タグ付け — サブタブ: Single / Batch / DB",
helpTagger1: "WD Tagger(ONNX)・SwinV2・DeepDanbooru(.h5)・VLM(Ollama / LM Studio / Lemonade / Unsloth)による自動タグ付け — サブタブ: Single / Batch / DB",
helpTagger2: "モデル配置:ComfyUI/models/tagger/<モデル名>/ 以下に各モデルのフォルダを作成し、.onnx + selected_tags.csv(DeepDanbooruは .h5 + ラベルファイル)を格納",
helpTagger3: "Singleタブ:プレビューエリアへ画像をドラッグ&ドロップ、またはUploadボタンでファイルを選択;GalleryタブのTaggerボタンで選択画像を直接開くことも可能",
helpTagger4: "閾値スライダー:一般タグの信頼スコア下限(デフォルト0.35);キャラ閾値:character: プレフィックス付きタグ専用の閾値(デフォルト0.85)",
helpTagger5: "Ollama VLM:チェックボックスをオンにするとWD Taggerと並行してビジョンモデルを実行;API URLとモデルを設定(↻で一覧更新)、プロンプトを編集可能;両モデルの結果はマージされる",
helpTagger5: "VLMタグ付け:チェックボックスをオンにするとWD Taggerと並行してビジョンモデルを実行;⚙設定ボタンからバックエンド(Ollama / LM Studio / Lemonade / Unsloth)・URL・モデル・Thinking mode・Max tokensの選択とモデルのアンロードが可能——Promptタブ独自のAI設定とは別管理;プロンプトとMax Tagsはインラインで編集可能;両モデルの結果はマージされる",
helpTagger6: "生成タグの送信先:(1) GenUI:P — 生成UIタブのポジティブプロンプトに追記し、読み込み中のワークフローへ即時適用;(2) プロンプトに送信 — Promptタブの正プロンプトテキストエリアに追記;(3) Galleryに保存 — ギャラリーの画像メタデータに保存(Galleryから開いた画像のみ有効);(4) ファイルに書込 — JPEGはEXIF(ImageDescription)、PNGはtEXt(Tagsキー)に書き込み;(5) DBに保存 — 内蔵SQLiteデータベースに保存",
helpTagger7: "Batchタブ:処理対象フォルダパスを入力してWD Tagger・Ollamaの設定を行い、出力オプション(DBに保存〈デフォルトON〉・ファイルに書込〈EXIF/PNGメタデータ〉・.txt出力〈画像と同フォルダに <ファイル名>.txt を生成〉)を選択;バッチ開始で指定フォルダ内の全画像を処理;進行状況バーとログがリアルタイム更新;停止ボタンは現在の画像処理完了後にキャンセル",
helpTagger7: "Batchタブ:処理対象フォルダパスを入力してWD Taggerを設定し、VLMタグ付けを有効化(Singleタブと同じ⚙設定を使用);出力オプション(DBに保存〈デフォルトON〉・ファイルに書込〈EXIF/PNGメタデータ〉・.txt出力〈画像と同フォルダに <ファイル名>.txt を生成〉)を選択;バッチ開始で指定フォルダ内の全画像を処理;進行状況バーとログがリアルタイム更新;停止ボタンは現在の画像処理完了後にキャンセル",
helpTagger8: "DBタブ:タグ付けした画像の検索可能データベース;行をクリックすると編集パネルでWDタグ・VLMタグを編集可能;保存で更新、削除でレコード削除;CSV出力で全レコードをダウンロード",
helpTagger9: "依存パッケージのインストール:python_embeded\\python.exe -m pip install -r requirements.txt;GPU推論にはonnxruntimeの代わりにonnxruntime-gpuをインストール;TensorFlow(DeepDanbooru用)はサイズ大のためデフォルトではコメントアウト",
@@ -2352,7 +2371,7 @@ const LANGUAGES = {
helpAi2: "翻訳ペイン:Ollama、LM Studio、Lemonade、または Unsloth を使って日本語・英語・中国語・カスタム言語(Free)間でテキストを翻訳;⇄ ボタンで言語とテキストを同時入替;選択は自動保存",
helpAi3: "Chat ペイン:LLM とのマルチターン会話;Enter で送信、Shift+Enter で改行;Clear ボタンで会話履歴をリセット;モデルがtool callingに対応している場合、「猫の画像を作って」のように頼むとGenerateUIに読み込み中のワークフローで生成を実行し、結果をチャット内に表示する;ペインヘッダーの「画像生成を許可する」チェックボックスでこの機能のON/OFFを切り替えられる;画像が添付されている場合(TOOLSペインにドロップした画像)はLLMにもビジョン入力として送信され、generate_image呼び出し時はT2Iの代わりにI2I(image-to-image)の元画像として使われる;generate_image呼び出しにはsteps・cfg・sampler_name・scheduler・denoise・seed、width・height、batch_size(その1回の呼び出しで生成する枚数)、aspect_ratio(\"3:2\"のような比率プリセット。ワークフローにwidth/heightを供給するResolution Selectorノードがある場合のみ適用され、それ以外は無視される)といった任意の生成パラメータも指定できる;モデルが指定しなかった項目は読み込み中のワークフローの現在の設定がそのまま使われる;tool callingとビジョンの動作を確認済みのモデル: Gemma 4:e4b、Qwen 3.5:9b、Ministral 3:3b(Ollama)",
helpAi4: "TOOLS ペイン — VLM:画像(PNG/JPG/WebP)をドロップしてタスク(画像解説 / プロンプト作成 / タグ作成)を選んで Run;または「Create wildcards」を選んでカテゴリ名と件数を入力すると1行1エントリのワイルドカードを生成;ドロップした画像はChatペインの添付としても共有され(Chat側にも表示、I2I生成に使用)、✕ボタンでクリアするまで保持される",
helpAi6: "Settings ペイン:バックエンド(Ollama / LM Studio / Lemonade / Unsloth)の選択、APIのURL設定、接続テスト、モデル選択;Unslothはローカルアクセスでも常にAPIキー認証が必須——プラグインフォルダの .env.example を .env にコピーして UNSLOTH_API_KEY を設定し ComfyUI を再起動する(キーはサーバー側でのみ読み込まれ、ブラウザには一切送信されない);Unsloth Desktopアプリ側の設定画面で「モデル自動切り替え (OpenAI API)」もONにする必要がある——OFFのままだと、Unsloth Studio上で事前にモデルを手動ロードしていない限り HTTP 404 で接続に失敗する;Unslothのreasoningモデルは思考内容をインラインの<think>タグではなく別のreasoning_contentフィールドで返すため、Max tokensが少ないとモデルが思考だけでトークンを使い切り、空の返信になることがある——返信が空になる場合はMax tokensを増やす(2048以上を推奨);Generationセクション — Thinking modeトグル(デフォルトOFF;OllamaにはthinkフラグとしてOFF/ONを送信、バックエンドを問わずOFF時は出力中の<think>...</think>ブロックをクライアント側で除去するため、推論モデルの思考過程がTranslation/Chat/TOOLSの結果に混入しない)とMax tokens(Ollama: num_predict、LM Studio/Lemonade/Unsloth: max_tokens;0で無制限);Free言語名の設定;Chat Image Generationセクションでは、ChatからのT2I画像生成にGenerateUIの現在の読み込みワークフローの代わりに専用ワークフローを使うよう設定できる;Chat I2I Generationセクションは同様の設定を画像添付時のI2I生成向けに提供する;設定は localStorage に保存され、Library パネルの A タブと共有される",
helpAi6: "Settings ペイン:バックエンド(Ollama / LM Studio / Lemonade / Unsloth)の選択、APIのURL設定、接続テスト、モデル選択、および「Test connection」の右隣にある「Unload Model」ボタンでロード中のモデルをVRAM/メモリから解放——Ollamaは keep_alive:0、LM Studioは /api/v1/models/unload、Lemonadeは /api/v1/unload を使用;Unslothにはアンロード用APIが存在しないため未対応メッセージが表示される;Unslothはローカルアクセスでも常にAPIキー認証が必須——プラグインフォルダの .env.example を .env にコピーして UNSLOTH_API_KEY を設定し ComfyUI を再起動する(キーはサーバー側でのみ読み込まれ、ブラウザには一切送信されない);Unsloth Desktopアプリ側の設定画面で「モデル自動切り替え (OpenAI API)」もONにする必要がある——OFFのままだと、Unsloth Studio上で事前にモデルを手動ロードしていない限り HTTP 404 で接続に失敗する;Unslothのreasoningモデルは思考内容をインラインの<think>タグではなく別のreasoning_contentフィールドで返すため、Max tokensが少ないとモデルが思考だけでトークンを使い切り、空の返信になることがある——返信が空になる場合はMax tokensを増やす(2048以上を推奨);Generationセクション — Thinking modeトグル(デフォルトOFF;OllamaにはthinkフラグとしてOFF/ONを送信、バックエンドを問わずOFF時は出力中の<think>...</think>ブロックをクライアント側で除去するため、推論モデルの思考過程がTranslation/Chat/TOOLSの結果に混入しない)とMax tokens(Ollama: num_predict、LM Studio/Lemonade/Unsloth: max_tokens;0で無制限);Free言語名の設定;Chat Image Generationセクションでは、ChatからのT2I画像生成にGenerateUIの現在の読み込みワークフローの代わりに専用ワークフローを使うよう設定できる;Chat I2I Generationセクションは同様の設定を画像添付時のI2I生成向けに提供する;設定は localStorage に保存され、Library パネルの A タブと共有される",
helpAi7: "Chat ペイン — SVG:LLMはComfyUIワークフローを一切使わず、SVGグラフィックをテキストとして直接生成することもできる;「SVGで〜を描いて」のように頼み、応答にSVGコードが含まれていれば自動でインラインプレビュー表示され、「Galleryに保存」ボタンでGalleryタブの出力フォルダに.svgファイルとして保存できる;tool calling(function calling)を使用しないため、tool calling非対応のモデルでも動作する",
helpAi8: "Chat ペイン — スキル:メッセージ一覧上部のドロップダウンでスキルを選ぶと、その指示内容が system prompt として会話の先頭に付加される(表示上のチャット履歴には含まれない);鉛筆ボタンでスキル管理パネルを開き、.mdスキルファイルを作成・編集・削除できる(保存先: user/default/Workflow-Studio/ai_skills/);ファイル先頭の---で囲まれた部分にname/descriptionを書くとドロップダウンの表示に反映される;初期状態で2つのスキルを同梱: 「SVG Icon Generator」(描く前に対象を部位分解することで認識しやすいSVGを生成)と「Skill Creator」(対話形式で質問しながら新しいスキルファイルを下書きする);応答に```skillコードブロックが含まれる場合、メッセージ下部に「スキルとして保存」ボタンが表示され、内容が入った状態で管理パネルが開く",
helpAi9: "スキル作成のヒント:ドロップダウンやツールチップで分かりやすいよう、frontmatterのname/descriptionは明確に書く;期待する出力形式を具体的に指示し、SVGや別のスキルファイルのように後で抽出したい成果物がある場合は専用のコードフェンスで囲むよう指示する;曖昧な指示より具体的で命令形の指示の方がローカルの小型モデルには効きやすく、短い実例を1つ添えるとさらに効果的;禁止事項(不適切な内容、セキュリティ、文字数制限など)は暗黙に期待せず明示的に書く;迷ったらドロップダウンで「Skill Creator」スキルを選び、作りたいスキルの概要を伝えれば対話形式で下書きしてくれる",
@@ -2674,10 +2693,10 @@ const LANGUAGES = {
helpMetadata5: "対応フォーマット: ComfyUI PNG/WebP/MP4/JSON(標準形式 + Flux.2 / Qwen-Image / Z-Image / Mage-Flow / LongCat / Boogu / HiDream E1 / FireRed / Ernie Image サブグラフ形式;MP4はSaveVideoが書き込むworkflow/promptコンテナタグを読み取り、MiniMax H3 ImageToVideoのようなオールインワン動画ノードにも対応)・SD WebUI・SD Forge・Fooocus。",
helpMetadata6: "現在は Gallery タブ内のサブタブ(Style_Catalog の右隣)になっており、独立したトップレベルタブではありません — それ以外の動作は全く同じです",
// -- Video タブ(MiniMax H3専用、GenerateUIタブとは独立) --
// -- Video タブ(MiniMax H3 / LTX-2.5 / Wan2.2対応、GenerateUIタブとは独立) --
tabVideo: "Video",
loadInVideo: "Videoに読み込み",
videoTitle: "Video (MiniMax H3)",
videoTitle: "Video",
videoFirstFrame: "First Frame(任意)",
videoLastFrame: "Last Frame(任意)",
videoDropOrClick: "画像をドロップまたはクリックして選択",
@@ -2691,7 +2710,7 @@ const LANGUAGES = {
videoGenerate: "Generate",
videoEditPlaceholder: "編集機能は今後追加予定",
videoNoWorkflowLoaded: "ワークフローが読み込まれていません",
videoUnsupportedWorkflow: "このワークフローにはMiniMax H3のImage to Videoノードが含まれていません",
videoUnsupportedWorkflow: "このワークフローには対応する動画モデルノード(MiniMax H3、LTX-2.5のText/Image/First&Last-Frame to Video、またはWan2.2のText to Video)が含まれていません",
videoWorkflowLoaded: (name) => `ワークフローを読み込みました: ${name}`,
videoGenerateSuccess: "動画を生成しました",
videoDoneCount: (n) => `完了(${n}件)`,
@@ -2716,14 +2735,15 @@ const LANGUAGES = {
videoGifSaved: (name) => `GIFを保存しました: ${name}`,
videoNoSourceLoaded: "先に動画を用意してください(生成するか、動画ソースにファイルをドロップ)",
helpVideoTitle: "Video タブ",
helpVideoDesc: "MiniMax H3 (Image to Video) ワークフロー専用の動画生成タブ。GenerateUIタブとは独立して動作します。",
helpVideoDesc: "MiniMax H3 (Image to Video)、LTX-2.5 (Text / Image / First & Last Frame to Video)、Wan2.2 (Text to Video) ワークフロー対応の動画生成タブ。GenerateUIタブとは独立して動作します。",
helpVideo1: "first_frame(任意)/last_frame(任意)の画像、prompt、aspect_ratio/megapixels/multiple(解像度)、duration(秒)、noise_seedを指定してGenerateをクリックします。first_frameを未指定にするとテキストのみでバイパス実行され、LoadImageノード自体が無いワークフローにも対応しています。",
helpVideo2: "モデル選択(UNet/CLIP/VAE/Audio VAE)は読み込んだワークフローの既定値に固定され、このタブでは変更できません。",
helpVideo3: "Workflowタブの詳細モーダルにある「Videoに読み込み」ボタンから、MiniMax H3のImage to Videoノードを含むワークフローを読み込めます。対応していないワークフローはエラー表示になります。",
helpVideo2: "モデル選択(UNet/CLIP/VAE/Audio VAE)は読み込んだワークフローの既定値に固定され、このタブでは変更できません。ResolutionSelectorノードを持たないワークフロー(Wan2.2など)は解像度も既定値に固定され、Aspect Ratio/Megapixels/Multiple欄は無効化されます。",
helpVideo3: "Workflowタブの詳細モーダルにある「Videoに読み込み」ボタンから、MiniMax H3のImage to Videoノード、LTX-2.5のText/Image/First&Last-Frame to Videoノード、またはWan2.2のText to Videoノードを含むワークフローを読み込めます。対応していないワークフローはエラー表示になります。",
helpVideo4: "生成した動画(mp4)はGalleryタブでも閲覧・再生できます。",
helpVideo5: "プレビューの横にある「Video Source」パネルでは、生成した動画に限らず任意のローカル動画をドロップ/選択して、下のFrame/GIF機能をMiniMax H3を実行せずに使えます。Clearで選択をリセットできます。",
helpVideo5: "プレビューの横にある「Video Source」パネルでは、生成した動画に限らず任意のローカル動画をドロップ/選択して、下のFrame/GIF機能を読み込んだワークフローを実行せずに使えます。Clearで選択をリセットできます。",
helpVideo6: "Frameタブ(右パネル): プレビュー動画を再生・シークして止めたい位置で「Capture Frame」を押すとその場でフレームをキャプチャし、「Save to Output」でPNGとしてComfyUIのOutputフォルダに保存します。",
helpVideo7: "GIFタブ(右パネル): Start/End(秒)・FPS・Max Width(任意)を指定して「Convert to GIF」を押すと、サーバー側で動画をデコードしアニメーションGIFとしてComfyUIのOutputフォルダに保存します。",
helpVideo8: "ハイライト色: 読み込んだワークフローが実際に対応する項目(Prompt・Duration・First Frame・Last Frame・Aspect Ratio・Megapixels・Multiple)のラベルが、生成UIタブのModelタブと同じハイライト色(設定タブでカスタマイズ可能)で表示されます — 例えばWan2.2ワークフロー(ResolutionSelectorノードなし)ではAspect Ratio/Megapixels/Multipleのラベルは非表示のままです(それらの項目は操作不可のため)。",
},
zh: {
@@ -3049,6 +3069,8 @@ const LANGUAGES = {
textSizeLabel: "文字大小",
textSizeTextarea: "提示词 / 聊天输入框",
textSizeHint: "适用于:生成UI提示词、AI助手聊天、预设提示词、通配符编辑、Metadata提示词预览",
videoVolumeLabel: "视频音量",
videoVolumeHint: "适用于:Video 标签页预览、Gallery 标签页详情/灯箱/对比视频播放器。在此设置的音量(或在任意视频自身控件中调整的音量)会在应用内下次打开任意视频时保留。",
jsonColorsSection: "RAW JSON 文字颜色",
jsonColorBase: "普通文本",
jsonColorYellow: "名称 / 调度器",
@@ -3366,7 +3388,7 @@ const LANGUAGES = {
taggerThreshold: "阈值",
taggerCharThreshold: "角色阈值",
taggerGenerateTags: "生成标签",
taggerOllamaEnable: "Ollama VLM",
taggerOllamaEnable: "VLM打标",
taggerOllamaUrl: "API URL",
taggerOllamaModel: "模型",
taggerOllamaPrompt: "提示词",
@@ -3435,6 +3457,12 @@ const LANGUAGES = {
aiSettingsInputLang: "输入语言",
aiSettingsOutputLang: "翻译语言",
aiSettingsSaveBtn: "保存设置",
aiUnloadModel: "卸载模型",
aiUnloading: "卸载中...",
aiUnloadDone: "模型已卸载",
aiUnloadFailed: "卸载失败: ",
aiUnloadUnsupported: "此后端不支持通过API卸载",
aiUnloadNoModel: "请先选择模型",
aiToastNoText: "请输入文字",
aiToastNoModel: "请在设置标签中选择模型",
aiToastInvalidUrl: "URL必须以 http:// 或 https:// 开头",
@@ -3505,7 +3533,8 @@ const LANGUAGES = {
helpGen5: "Model标签:Checkpoint/VAE/Diffusion Model(支持UNETLoader / UnetLoaderGGUF / LoaderGGUF)/Text Encoder(支持CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — 含type和device选择器,DualCLIP显示两段模型选择)始终显示;ControlNet和Hypernetwork(带Strength输入)因使用频率较低默认折叠 — 点击标题展开;LoRA(Single/Stack标签)拥有独立的列;所有选择器均含筛选;LoRA Stack — 点击Apply会将所有启用的LoRA写入目标节点,并同时将LoRA语法和CivitAI触发词插入Positive提示词;再次Apply会移除未启用的LoRA并重新添加启用的LoRA以更新提示词",
helpGen28: "Model标签 — 高亮颜色:当前工作流实际包含某类型节点时(Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork),对应标签及LoRA列标题会以指定颜色(默认亮绿色)显示;即使ControlNet/Hypernetwork处于折叠状态该颜色依然可见,无需展开即可判断是否在使用;颜色可在Settings标签中自定义",
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
helpGen7: "Raw JSON在每个标签右列常驻显示 — 直接编辑并Apply即时重载工作流;如果加载的工作流包含Bypass或Mute节点,搜索栏上方会显示列表(Bypass节点会被排除但其连线会重新连接;Mute节点会被排除且不重新连接,与ComfyUI本体行为一致)",
helpGen31: "LTX-2.5和Wan2.2视频工作流在本标签中作为普通工作流加载时(不仅限于专用的Video标签)也可正常使用 — Positive/Negative Prompt会沿LTX-2.5的LTXVDualCFGGuider / LTXVConditioning节点追溯找到实际提示词文本,Settings标签的Latent Image部分能识别Wan2.2的EmptyHunyuanLatentVideo和LTX-2.5的EmptyLTXVLatentVideo节点(并新增Length(帧数)字段),不再显示\"No EmptyLatentImage node found\";从这些工作流生成时也会应用与MiniMax H3视频生成相同的延长超时",
helpGen7: "Raw JSON在每个标签右列常驻显示 — 直接编辑并Apply即时重载工作流;如果加载的工作流包含Bypass或Mute节点,搜索栏上方会显示列表(Bypass节点会被排除但其连线会重新连接;Mute节点会被排除且不重新连接,与ComfyUI本体行为一致);搜索栏只会高亮匹配项并滚动到该位置,不会将光标移入编辑器,因此搜索后立即按键不会意外覆盖JSON — 需要先点击编辑器内部才能实际编辑",
helpGen8: "种子管理:随机/固定/递增/递减",
helpGen9: "生成图片、进度显示、停止生成、查看结果",
helpGen10: "Eagle集成:自动保存生成图片到Eagle(也支持SVG输出 — 标准SaveSVGNode节点和comfyui-tosvg的Save SVG String节点均可)",
@@ -3587,7 +3616,7 @@ const LANGUAGES = {
helpLabResults3: "加载已保存的方案时,会根据方案文件中记录的图片列表恢复Results网格",
helpSearchPlaceholder: "搜索帮助...",
helpPrompt1: "AI助手(Ollama / LM Studio / Lemonade):模型选择、聊天咨询提示词、图片附件(视觉模型);后端和URL在设置标签页配置",
helpPrompt1: "AI助手(Ollama / LM Studio / Lemonade / Unsloth):聊天咨询提示词、图片附件(视觉模型);点击⚙设置按钮可选择后端、连接URL、模型、Thinking mode、Max tokens,并卸载已加载的模型——设置与AI TOOL标签页、Tagger标签页相互独立",
helpPrompt2: "将AI回复应用到生成UI的提示词",
helpPrompt3: "翻译功能:日\u2194英、中\u2194英",
helpPrompt4: "预设管理:创建、编辑、正面/负面提示词剪贴板复制(PP/NP)",
@@ -3617,7 +3646,7 @@ const LANGUAGES = {
helpSettings2: "主题选择(13种预设)+ 自定义:颜色调整、背景图案(条纹、波点、棋盘格、SVG平铺)、字体选择(含日文显示字体在内的16种Google Fonts)",
helpSettings3: "工作流数据文件夹路径更改/重置",
helpSettings4: "ComfyUI连接URL设置和测试",
helpSettings5: "AI助手(提示词标签页):后端(Ollama / LM Studio / Lemonade)、API URL、默认模型、连接测试",
helpSettings5: "AI助手设置已从此标签页移出——Prompt标签页、Tagger标签页、AI TOOL标签页现在各自拥有独立的⚙设置按钮(后端、URL、模型、Thinking mode、Max tokens、卸载模型),分别单独保存",
helpSettings6: "默认工作流设置/取消",
helpSettings7: "Eagle集成URL、自动保存开关",
helpSettings8: "数据管理:将设置、元数据、提示词等主要数据导出为JSON文件,或导入以恢复。导入后请重启ComfyUI。",
@@ -3679,13 +3708,13 @@ const LANGUAGES = {
// -- Tagger Tab --
helpTaggerTitle: "Tagger标签",
helpTagger1: "使用WD Tagger(ONNX)、SwinV2、DeepDanbooru(.h5)和Ollama VLM进行自动图像标注 — 子标签:Single / Batch / DB",
helpTagger1: "使用WD Tagger(ONNX)、SwinV2、DeepDanbooru(.h5)和VLM(Ollama / LM Studio / Lemonade / Unsloth)进行自动图像标注 — 子标签:Single / Batch / DB",
helpTagger2: "模型放置:在ComfyUI/models/tagger/<模型名>/ 下为每个模型创建单独子文件夹,必须包含 .onnx + selected_tags.csv(DeepDanbooru为 .h5 + 标签文件)",
helpTagger3: "Single标签:将图像拖放到预览区域,或点击Upload选择文件;图库详情面板的Tagger按钮可直接在此处打开所选图像",
helpTagger4: "阈值滑块:一般标签的最低置信度(默认0.35);角色阈值:character: 前缀标签的独立阈值(默认0.85)",
helpTagger5: "Ollama VLM:勾选复选框可与WD Tagger并行运行视觉模型;设置API URL、选择模型(点击↻刷新列表)并自定义提示词;两个模型的结果将合并",
helpTagger5: "VLM打标:勾选复选框可与WD Tagger并行运行视觉模型;点击⚙设置按钮可选择后端(Ollama / LM Studio / Lemonade / Unsloth)、URL、模型、Thinking mode、Max tokens,并卸载模型——与Prompt标签页自身的AI设置相互独立;提示词和Max Tags可在标签页内直接编辑;两个模型的结果将合并",
helpTagger6: "生成标签的发送目标:(1) GenUI:P — 追加到生成UI标签的正向提示词并立即应用到已加载工作流;(2) 发送到提示词 — 追加到提示词标签的正向文本区;(3) 保存到图库 — 保存到图库图像元数据(仅限从图库打开的图像);(4) 写入文件 — JPEG写入EXIF(ImageDescription)、PNG写入tEXt(Tags键);(5) 保存到DB — 存入内置SQLite数据库",
helpTagger7: "Batch标签:输入目标文件夹路径并配置WD Tagger和Ollama设置,选择输出选项(保存DB〈默认开启〉、写入文件〈EXIF/PNG元数据〉、输出.txt〈在图像同目录生成 <文件名>.txt〉);开始批处理后将处理文件夹内所有图像;进度条和日志实时更新;停止按钮在当前图像处理完成后取消",
helpTagger7: "Batch标签:输入目标文件夹路径并配置WD Tagger,启用VLM打标(与Single标签使用相同的⚙设置);选择输出选项(保存DB〈默认开启〉、写入文件〈EXIF/PNG元数据〉、输出.txt〈在图像同目录生成 <文件名>.txt〉);开始批处理后将处理文件夹内所有图像;进度条和日志实时更新;停止按钮在当前图像处理完成后取消",
helpTagger8: "DB标签:所有已标注图像的可搜索数据库;点击行可在编辑面板中修改WD标签/VLM标签;保存更新记录,删除移除记录;导出CSV可下载所有记录",
helpTagger9: "安装依赖包:python_embeded\\python.exe -m pip install -r requirements.txt;GPU推理请安装onnxruntime-gpu替代onnxruntime;TensorFlow(用于DeepDanbooru)因体积较大默认已注释",
@@ -3712,7 +3741,7 @@ const LANGUAGES = {
helpAi2: "翻译面板:使用 Ollama、LM Studio、Lemonade 或 Unsloth 在日语、英语、中文或自定义语言(Free)之间翻译;⇄ 按钮同时互换语言和文本内容;选择自动保存",
helpAi3: "Chat 面板:与 LLM 进行多轮对话;Enter 发送消息,Shift+Enter 换行;Clear 按钮重置对话历史;如果模型支持 tool calling,当你要求生成图像(例如\"生成一张猫的图片\")时,会使用 GenerateUI 中当前加载的工作流执行生成,并在对话中显示结果;面板标题栏的\"允许生成图像\"复选框可开关此功能;如果附加了图像(在 TOOLS 面板中拖放的图像),该图像会作为视觉输入发送给 LLM,调用 generate_image 时会以该图像为基础执行图生图(I2I),而不是文生图;generate_image 还接受可选的生成参数——steps、cfg、sampler_name、scheduler、denoise、seed、width、height、batch_size(该次调用生成的图像数量),以及 aspect_ratio(形如\"3:2\"的比例预设,仅当工作流中存在向 width/height 供值的 Resolution Selector 节点时才会生效,否则忽略);模型未提供的参数将保留当前已加载工作流的设置;已验证可正常支持 tool calling 与视觉功能的模型:Gemma 4:e4b、Qwen 3.5:9b、Ministral 3:3b(Ollama)",
helpAi4: "TOOLS 面板 — VLM:拖放图像(PNG/JPG/WebP)并选择任务(图像描述 / 提示词生成 / 标签生成),点击 Run;或选择「Create wildcards」,输入类别名称和数量生成纯文本通配符条目(每行一条);拖放的图像也会作为 Chat 面板的附件共享(在该处显示并用于图生图生成),直到点击 ✕ 按钮清除",
helpAi6: "Settings 面板:选择后端(Ollama / LM Studio / Lemonade / Unsloth)、设置 API URL、测试连接、选择模型;Unsloth 即使在本地访问时也始终需要 API 密钥认证——将插件文件夹中的 .env.example 复制为 .env 并设置 UNSLOTH_API_KEY,然后重启 ComfyUI(密钥仅在服务器端读取,绝不会发送到浏览器);还需要在 Unsloth Desktop 应用自身的设置界面中开启「Auto model switching (OpenAI API)」——若保持关闭,除非已在 Unsloth Studio 中手动加载过模型,否则请求会以 HTTP 404 失败;Unsloth 的推理模型会将思考内容放在单独的 reasoning_content 字段中,而不是内联的 <think> 标签里,因此 Max tokens 太小会导致模型把全部配额都用在思考上,返回空白回复——如果回复为空,请调高 Max tokens(建议 2048 以上);Generation 部分 — Thinking mode 开关(默认关闭;Ollama会收到think标志,无论使用哪个后端,关闭时都会从输出中去除<think>...</think>思考块,避免推理模型的思考过程混入Translation/Chat/TOOLS的结果)以及 Max tokens(Ollama: num_predict,LM Studio/Lemonade/Unsloth: max_tokens;0为不限);配置 Free 语言名称;Chat 图像生成部分可让 Chat 触发的文生图使用专用工作流,而不是 GenerateUI 中当前加载的工作流;Chat I2I 生成部分提供相同设置,用于附加图像时的图生图生成;设置保存至 localStorage,并与 Library 面板的 A 标签共享",
helpAi6: "Settings 面板:选择后端(Ollama / LM Studio / Lemonade / Unsloth)、设置 API URL、测试连接、选择模型,以及使用「Test connection」右侧的「Unload Model」按钮将已加载的模型从显存/内存中卸载——Ollama 使用 keep_alive:0,LM Studio 使用 /api/v1/models/unload,Lemonade 使用 /api/v1/unload;Unsloth 没有卸载 API,因此会显示不支持的提示;Unsloth 即使在本地访问时也始终需要 API 密钥认证——将插件文件夹中的 .env.example 复制为 .env 并设置 UNSLOTH_API_KEY,然后重启 ComfyUI(密钥仅在服务器端读取,绝不会发送到浏览器);还需要在 Unsloth Desktop 应用自身的设置界面中开启「Auto model switching (OpenAI API)」——若保持关闭,除非已在 Unsloth Studio 中手动加载过模型,否则请求会以 HTTP 404 失败;Unsloth 的推理模型会将思考内容放在单独的 reasoning_content 字段中,而不是内联的 <think> 标签里,因此 Max tokens 太小会导致模型把全部配额都用在思考上,返回空白回复——如果回复为空,请调高 Max tokens(建议 2048 以上);Generation 部分 — Thinking mode 开关(默认关闭;Ollama会收到think标志,无论使用哪个后端,关闭时都会从输出中去除<think>...</think>思考块,避免推理模型的思考过程混入Translation/Chat/TOOLS的结果)以及 Max tokens(Ollama: num_predict,LM Studio/Lemonade/Unsloth: max_tokens;0为不限);配置 Free 语言名称;Chat 图像生成部分可让 Chat 触发的文生图使用专用工作流,而不是 GenerateUI 中当前加载的工作流;Chat I2I 生成部分提供相同设置,用于附加图像时的图生图生成;设置保存至 localStorage,并与 Library 面板的 A 标签共享",
helpAi7: "Chat 面板 — SVG:LLM 还可以直接以文本形式生成 SVG 图形,完全不涉及 ComfyUI 工作流;只需要求它用 SVG 绘制内容,如果回复中包含 SVG 代码,会自动渲染为内嵌预览,并提供\"保存到图库\"按钮,将其保存为 .svg 文件到 Gallery 标签页的输出文件夹;该功能不使用 tool calling(函数调用),因此不支持 tool calling 的模型也可以使用",
helpAi8: "Chat 面板 — 技能:在消息列表上方的下拉菜单中选择一个技能,其内容会作为 system prompt 添加到对话开头(不会显示在可见的聊天记录中);点击铅笔按钮打开技能管理面板,可创建、编辑、删除 .md 技能文件(保存路径:user/default/Workflow-Studio/ai_skills/);文件开头 --- 之间的 name/description 字段会显示在下拉菜单中;默认内置两个技能:「SVG Icon Generator」(在绘制前先将对象拆解为多个部件,以生成更易识别的 SVG)和「Skill Creator」(通过对话向你提问并起草新的技能文件);当回复中包含```skill代码块时,消息下方会出现「保存为技能」按钮,点击后会打开管理面板并预填内容",
helpAi9: "编写技能的小贴士:为 frontmatter 的 name/description 写清楚的内容,便于在下拉菜单和提示中阅读;明确说明期望的输出格式,如果有需要后续提取的成果物(如 SVG 或另一个技能文件),指示它用专门的代码围栏包裹;具体、祈使句式的指令比笼统的说明对本地小模型更有效,附上一个简短示例效果更佳;明确写出硬性约束(禁止内容、安全性、长度限制等),不要指望模型会自行推断;如果不确定怎么写,可以在下拉菜单中选择「Skill Creator」技能并描述你想要的技能,它会通过提问帮你起草",
@@ -4034,10 +4063,10 @@ const LANGUAGES = {
helpMetadata5: "支持格式:ComfyUI PNG/WebP/MP4/JSON(标准格式 + Flux.2 / Qwen-Image / Z-Image / Mage-Flow / LongCat / Boogu / HiDream E1 / FireRed / Ernie Image 子图工作流;MP4读取SaveVideo写入的workflow/prompt容器标签,也支持MiniMax H3 ImageToVideo等一体化视频节点)、SD WebUI、SD Forge、Fooocus。",
helpMetadata6: "现在它是 Gallery 标签页内的一个子标签(位于 Style_Catalog 右侧),不再是独立的顶层标签页 — 其余操作方式完全相同",
// -- Video 标签页(MiniMax H3 专用,独立于 GenerateUI) --
// -- Video 标签页(支持 MiniMax H3 / LTX-2.5 / Wan2.2,独立于 GenerateUI) --
tabVideo: "Video",
loadInVideo: "加载到Video",
videoTitle: "Video (MiniMax H3)",
videoTitle: "Video",
videoFirstFrame: "First Frame(可选)",
videoLastFrame: "Last Frame(可选)",
videoDropOrClick: "拖放图片或点击选择",
@@ -4051,7 +4080,7 @@ const LANGUAGES = {
videoGenerate: "Generate",
videoEditPlaceholder: "编辑功能即将推出",
videoNoWorkflowLoaded: "尚未加载工作流",
videoUnsupportedWorkflow: "该工作流不包含 MiniMax H3 的 Image to Video 节点",
videoUnsupportedWorkflow: "该工作流不包含受支持的视频模型节点(MiniMax H3、LTX-2.5 的 Text/Image/First&Last-Frame to Video,或 Wan2.2 的 Text to Video)",
videoWorkflowLoaded: (name) => `已加载工作流: ${name}`,
videoGenerateSuccess: "视频已生成",
videoDoneCount: (n) => `完成(${n} 个文件)`,
@@ -4076,14 +4105,15 @@ const LANGUAGES = {
videoGifSaved: (name) => `已保存GIF: ${name}`,
videoNoSourceLoaded: "请先准备视频(生成一个,或将文件拖入视频来源)",
helpVideoTitle: "Video 标签页",
helpVideoDesc: "MiniMax H3(Image to Video)工作流专用的视频生成标签页,独立于 GenerateUI 标签页运行。",
helpVideoDesc: "支持 MiniMax H3(Image to Video)、LTX-2.5(Text / Image / First & Last Frame to Video)、Wan2.2(Text to Video)工作流的视频生成标签页,独立于 GenerateUI 标签页运行。",
helpVideo1: "设置 first_frame(可选)/last_frame(可选)图片、prompt、aspect_ratio/megapixels/multiple(分辨率)、duration(秒)和 noise_seed,然后点击 Generate。不指定 first_frame 时将以纯文本方式绕过执行,也支持完全没有 LoadImage 节点的工作流。",
helpVideo2: "模型选择(UNet/CLIP/VAE/Audio VAE)固定为所加载工作流的默认值,无法在此标签页中修改。",
helpVideo3: "可通过 Workflow 标签页详情弹窗中的「加载到Video」按钮,加载包含 MiniMax H3 Image to Video 节点的工作流。不支持的工作流会显示错误。",
helpVideo2: "模型选择(UNet/CLIP/VAE/Audio VAE)固定为所加载工作流的默认值,无法在此标签页中修改。没有 ResolutionSelector 节点的工作流(如 Wan2.2)分辨率也固定为默认值,Aspect Ratio/Megapixels/Multiple 字段会被禁用。",
helpVideo3: "可通过 Workflow 标签页详情弹窗中的「加载到Video」按钮,加载包含 MiniMax H3 Image to Video 节点、LTX-2.5 Text/Image/First&Last-Frame to Video 节点,或 Wan2.2 Text to Video 节点的工作流。不支持的工作流会显示错误。",
helpVideo4: "生成的视频(mp4)也可以在 Gallery 标签页中浏览和播放。",
helpVideo5: "预览旁边的「Video Source」面板可以拖放或选择任意本地视频(不仅限于生成的视频),无需先运行MiniMax H3即可使用下方的Frame/GIF工具。点击Clear可重置选择。",
helpVideo5: "预览旁边的「Video Source」面板可以拖放或选择任意本地视频(不仅限于生成的视频),无需先运行已加载的视频工作流即可使用下方的Frame/GIF工具。点击Clear可重置选择。",
helpVideo6: "Frame标签页(右侧面板):播放/拖动预览视频到想要的位置,点击「Capture Frame」在客户端截取该帧,再点击「Save to Output」将其保存为PNG到ComfyUI的输出文件夹。",
helpVideo7: "GIF标签页(右侧面板):设置Start/End(秒)、FPS和可选的Max Width,点击「Convert to GIF」后,服务器会解码视频并将动画GIF保存到ComfyUI的输出文件夹。",
helpVideo8: "高亮颜色:当加载的工作流实际支持某个字段时(Prompt、Duration、First Frame、Last Frame、Aspect Ratio、Megapixels、Multiple),对应标签会以与生成UI标签Model页相同的高亮颜色显示(可在设置标签中自定义)——例如Wan2.2工作流(没有ResolutionSelector节点)中,Aspect Ratio/Megapixels/Multiple标签保持不高亮,因为这些字段处于禁用状态。",
},
};
+70 -105
View File
@@ -1,10 +1,11 @@
/**
* Prompt Tab - AI Assistant (Ollama / LM Studio chat, translate, apply to GenerateUI)
* Prompt Tab - AI Assistant (Ollama / LM Studio / Lemonade / Unsloth chat, translate, apply to GenerateUI)
*/
import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { getAiBackendDefaultUrl } from "./util.js";
import { unslothProxy } from "./util.js";
import { openAiBackendSettingsModal, getAiBackendConfig } from "./ai-settings-modal.js";
// ============================================
// State
@@ -17,64 +18,73 @@ const ollamaState = {
const PROMPT_AI_KEY = "wfm_prompt_ai_settings";
function loadPromptAiSettings() {
try { return JSON.parse(localStorage.getItem(PROMPT_AI_KEY) || "{}"); } catch { return {}; }
}
// バックエンド変更検知用: モデル一覧を取得した時点のバックエンド名を記録
let _promptAiBackendForModels = null;
export function getPromptAiConfig() {
const s = loadPromptAiSettings();
const backend = s.backend || "ollama";
const url = (s.backendUrl || getAiBackendDefaultUrl(backend)).replace(/\/$/, "");
return { backend, url };
return getAiBackendConfig(PROMPT_AI_KEY);
}
export async function fetchAiModels() {
const { backend, url } = getPromptAiConfig();
// Ollama-style messages (with .images) → OpenAI互換 content 配列に変換
function _toOpenAiMessages(messages) {
return messages.map(msg => {
if (msg.images?.length) {
return {
role: msg.role,
content: [
{ type: "text", text: msg.content },
...msg.images.map(b64 => ({ type: "image_url", image_url: { url: `data:image/jpeg;base64,${b64}` } })),
],
};
}
return { role: msg.role, content: msg.content };
});
}
function _stripThinkingTags(text) {
return (text || "")
.replace(/<think>[\s\S]*?<\/think>/gi, "")
.replace(/<thinking>[\s\S]*?<\/thinking>/gi, "")
.trim();
}
// Ollamaは `think` (bool) と `options.num_predict`、OpenAI互換は `max_tokens` で制御
function _applyGenOptions(body, backend, cfg) {
if (backend === "ollama") {
const res = await fetch(`${url}/api/tags`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return (await res.json()).models?.map(m => m.name) || [];
} else {
const res = await fetch(`${url}/v1/models`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return ((await res.json()).data || []).map(m => m.id);
body.think = !!cfg.thinkingMode;
if (cfg.maxTokens > 0) body.options = { ...(body.options || {}), num_predict: cfg.maxTokens };
} else if (cfg.maxTokens > 0) {
body.max_tokens = cfg.maxTokens;
}
return body;
}
async function chatWithAi(model, messages) {
const { backend, url } = getPromptAiConfig();
const cfg = getPromptAiConfig();
const { backend, url } = cfg;
if (backend === "ollama") {
const res = await fetch(`${url}/api/chat`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ model, messages, stream: false }),
body: JSON.stringify(_applyGenOptions({ model, messages, stream: false }, backend, cfg)),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return (await res.json()).message?.content || "";
const text = (await res.json()).message?.content || "";
return cfg.thinkingMode ? text : _stripThinkingTags(text);
} else if (backend === "unsloth") {
const body = _applyGenOptions({ model, messages: _toOpenAiMessages(messages), stream: false }, backend, cfg);
const data = await unslothProxy(url, "/v1/chat/completions", "POST", body);
const msg = data.choices?.[0]?.message;
// Unslothはreasoningを別フィールドで返すため<think>タグに畳んで表示に混ぜる
const text = (msg?.reasoning_content ? `<think>${msg.reasoning_content}</think>` : "") + (msg?.content || "");
return cfg.thinkingMode ? text : _stripThinkingTags(text);
} else {
// LM Studio / Lemonade (OpenAI-compatible): convert Ollama-style messages (with .images) to OpenAI content arrays
const openAiMessages = messages.map(msg => {
if (msg.images?.length) {
return {
role: msg.role,
content: [
{ type: "text", text: msg.content },
...msg.images.map(b64 => ({ type: "image_url", image_url: { url: `data:image/jpeg;base64,${b64}` } })),
],
};
}
return { role: msg.role, content: msg.content };
});
// LM Studio / Lemonade (OpenAI-compatible)
const res = await fetch(`${url}/v1/chat/completions`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ model, messages: openAiMessages, stream: false }),
body: JSON.stringify(_applyGenOptions({ model, messages: _toOpenAiMessages(messages), stream: false }, backend, cfg)),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return (await res.json()).choices?.[0]?.message?.content || "";
const text = (await res.json()).choices?.[0]?.message?.content || "";
return cfg.thinkingMode ? text : _stripThinkingTags(text);
}
}
@@ -192,37 +202,30 @@ function updateAttachmentDisplay() {
container.appendChild(item);
}
// ============================================
// Status label (設定モーダルで選択中のbackend/modelを表示)
// ============================================
function _updateStatusLabel() {
const status = document.getElementById("wfm-ollama-status");
if (!status) return;
const { backend, model } = getPromptAiConfig();
status.textContent = model ? `${backend}: ${model}` : `${backend}: ${t("selectModelFirst")}`;
status.className = model ? "wfm-ollama-status connected" : "wfm-ollama-status error";
}
// ============================================
// Send Message
// ============================================
async function sendMessage() {
const input = document.getElementById("wfm-ollama-input");
const modelSelect = document.getElementById("wfm-ollama-model");
if (!input || !modelSelect) return;
if (!input) return;
const message = input.value.trim();
if (!message) return;
// バックエンドが変更されていたらモデル一覧を自動更新
const { backend } = getPromptAiConfig();
if (backend !== _promptAiBackendForModels) {
const status = document.getElementById("wfm-ollama-status");
if (status) { status.textContent = `Switching to ${backend}...`; status.className = "wfm-ollama-status"; }
try {
const models = await fetchAiModels();
const savedModel = loadPromptAiSettings().model || "";
modelSelect.innerHTML = models.length
? models.map(name => `<option value="${name}" ${name === savedModel ? "selected" : ""}>${name}</option>`).join("")
: `<option value="">${t("noModelsFound")}</option>`;
_promptAiBackendForModels = backend;
if (status) { status.textContent = `${models.length} models [${backend}]`; status.className = "wfm-ollama-status connected"; }
} catch {
if (status) { status.textContent = t("failedConnect"); status.className = "wfm-ollama-status error"; }
}
}
const model = modelSelect.value;
const { model } = getPromptAiConfig();
if (!model) {
showToast(t("selectModelFirst"), "error");
return;
@@ -259,13 +262,12 @@ async function sendMessage() {
async function sendTranslate(direction) {
const input = document.getElementById("wfm-ollama-input");
const modelSelect = document.getElementById("wfm-ollama-model");
if (!input || !modelSelect) return;
if (!input) return;
const text = input.value.trim();
if (!text) return;
const model = modelSelect.value;
const { model } = getPromptAiConfig();
if (!model) {
showToast(t("selectModelFirst"), "error");
return;
@@ -318,48 +320,11 @@ function applyToGenerateUI(text) {
// ============================================
export function initAiChatUI() {
// AI model refresh
async function refreshModels() {
const select = document.getElementById("wfm-ollama-model");
const status = document.getElementById("wfm-ollama-status");
const { backend } = getPromptAiConfig();
try {
const models = await fetchAiModels();
const savedModel = loadPromptAiSettings().model || "";
if (select) {
select.innerHTML = models.length
? models.map(name => `<option value="${name}" ${name === savedModel ? "selected" : ""}>${name}</option>`).join("")
: `<option value="">${t("noModelsFound")}</option>`;
}
_promptAiBackendForModels = backend;
if (status) {
status.textContent = `${models.length} models [${backend}]`;
status.className = "wfm-ollama-status connected";
}
} catch {
if (status) {
status.textContent = t("failedConnect");
status.className = "wfm-ollama-status error";
}
}
}
_updateStatusLabel();
// Auto-load models on init
refreshModels();
document.getElementById("wfm-ollama-refresh-btn")?.addEventListener("click", refreshModels);
// Test connection
document.getElementById("wfm-ollama-test-btn")?.addEventListener("click", async () => {
const status = document.getElementById("wfm-ollama-status");
if (status) { status.textContent = "Testing..."; status.className = "wfm-ollama-status"; }
try {
await fetchAiModels();
if (status) { status.textContent = t("connectedCheck"); status.className = "wfm-ollama-status connected"; }
await refreshModels();
} catch {
if (status) { status.textContent = t("failedConnect"); status.className = "wfm-ollama-status error"; }
}
// Settings modal
document.getElementById("wfm-ollama-settings-btn")?.addEventListener("click", () => {
openAiBackendSettingsModal(PROMPT_AI_KEY, t("settings"), _updateStatusLabel);
});
// Send message
+58 -126
View File
@@ -6,7 +6,7 @@ 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, getAiBackendDefaultUrl } from "./util.js";
import { getSettings, readJsonStorage } from "./util.js";
const SETTINGS_KEY = "wfm_settings";
@@ -336,6 +336,34 @@ export function applyTextareaFontSize(size) {
el.textContent = `${TEXTAREA_FONT_SIZE_TARGETS} { font-size: ${px}px !important; }`;
}
// Video playback volume — shared by every <video> player in the app (Video tab preview,
// Gallery detail/lightbox/compare). The browser default for a freshly created <video> element
// is always 100%, and Gallery's players are recreated from scratch each time a different video
// is opened, so without this the volume silently jumps back to max on every video switch.
const VIDEO_VOLUME_DEFAULT = 1;
export function getVideoVolume() {
const v = loadLocalSettings().videoVolume;
return typeof v === "number" && v >= 0 && v <= 1 ? v : VIDEO_VOLUME_DEFAULT;
}
function setVideoVolume(volume) {
const clamped = Math.max(0, Math.min(1, volume));
saveLocalSettings({ videoVolume: clamped });
return clamped;
}
// Applies the saved volume to a <video> element, and keeps it in sync with any further change
// the user makes via that element's own native controls — so adjusting the volume on any video
// player anywhere in the app is remembered for the next video opened anywhere else.
export function applyStoredVideoVolume(videoEl) {
if (!videoEl) return;
videoEl.volume = getVideoVolume();
if (videoEl.dataset.wfmVolumeWired) return;
videoEl.dataset.wfmVolumeWired = "1";
videoEl.addEventListener("volumechange", () => setVideoVolume(videoEl.volume));
}
// JSON highlight color settings
const JSON_COLOR_STYLE_ID = "wfm-json-color-style";
@@ -378,7 +406,7 @@ export function applyModelTabActiveColor(color) {
el.id = MODEL_ACTIVE_COLOR_STYLE_ID;
document.head.appendChild(el);
}
el.textContent = `.wfm-form-group label.wfm-model-label-active,\n.wfm-settings-summary.wfm-model-label-active,\n#wfm-gen-lora-col-title.wfm-model-label-active,\n.wfm-lab-model-view-btn.wfm-model-label-active { color: ${val}; }`;
el.textContent = `.wfm-form-group label.wfm-model-label-active,\n.wfm-settings-summary.wfm-model-label-active,\n#wfm-gen-lora-col-title.wfm-model-label-active,\n.wfm-lab-model-view-btn.wfm-model-label-active,\n.wfm-video-form-panel label.wfm-model-label-active { color: ${val}; }`;
}
export function applyTheme(themeId) {
@@ -575,6 +603,24 @@ export async function initSettingsTab() {
</div>
</details>
<!-- Video Volume -->
<details class="wfm-settings-section" open>
<summary class="wfm-settings-summary">${t("videoVolumeLabel") || "Video Volume"}</summary>
<div class="wfm-form-group">
<label style="display:flex;align-items:center;justify-content:space-between;">
<span>${t("videoVolumeLabel") || "Video Volume"}</span>
<span id="wfm-video-volume-val" style="font-size:12px;color:var(--wfm-text-secondary);">${Math.round(getVideoVolume() * 100)}%</span>
</label>
<input type="range" class="wfm-range" id="wfm-video-volume"
min="0" max="100" step="1"
value="${Math.round(getVideoVolume() * 100)}"
style="width:100%;margin-top:4px;">
<small style="color:var(--wfm-text-secondary);font-size:11px;display:block;margin-top:4px;">
${t("videoVolumeHint") || "Applies to: Video tab preview, Gallery detail/lightbox/compare video players"}
</small>
</div>
</details>
<!-- RAW JSON Colors -->
<details class="wfm-settings-section" open>
<summary class="wfm-settings-summary">${t("jsonColorsSection") || "RAW JSON Colors"}</summary>
@@ -691,44 +737,6 @@ export async function initSettingsTab() {
<button class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-settings-default-ckpt-save">${t("save")}</button>
</details>
<!-- AI Assistant Settings (Prompt Tab) -->
<details class="wfm-settings-section">
<summary class="wfm-settings-summary">${t("ollamaSettings")}</summary>
<div class="wfm-form-group">
<label>${t("aiSettingsBackend")}</label>
<div class="wfm-ai-backend-row">
<label class="wfm-ai-radio-label">
<input type="radio" name="wfm-prompt-ai-backend" value="ollama"> Ollama
</label>
<label class="wfm-ai-radio-label">
<input type="radio" name="wfm-prompt-ai-backend" value="lmstudio"> LM Studio
</label>
<label class="wfm-ai-radio-label">
<input type="radio" name="wfm-prompt-ai-backend" value="lemonade"> Lemonade
</label>
</div>
</div>
<div class="wfm-form-group">
<label>${t("ollamaUrl")}</label>
<input type="text" class="wfm-input" id="wfm-settings-prompt-ai-url"
placeholder="http://localhost:11434">
</div>
<div class="wfm-form-group">
<label>${t("ollamaDefaultModel")}</label>
<div style="display:flex;gap:8px;">
<select class="wfm-select" id="wfm-settings-prompt-ai-model" style="flex:1;">
<option value="">${t("selectModel")}</option>
</select>
<button class="wfm-btn wfm-btn-sm" id="wfm-settings-prompt-ai-refresh">${t("refresh")}</button>
</div>
</div>
<div style="display:flex;gap:8px;margin-top:8px;">
<button class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-settings-prompt-ai-save">${t("saveOllama")}</button>
<button class="wfm-btn wfm-btn-sm" id="wfm-settings-prompt-ai-test">${t("testConnection")}</button>
<span id="wfm-settings-prompt-ai-status" style="font-size:12px;line-height:28px;"></span>
</div>
</details>
<!-- CivitAI Settings -->
<details class="wfm-settings-section">
<summary class="wfm-settings-summary">${t("civitaiApiKeySetting")}</summary>
@@ -1158,92 +1166,6 @@ export async function initSettingsTab() {
}
});
// --- AI Assistant (Prompt Tab) settings ---
const PROMPT_AI_KEY = "wfm_prompt_ai_settings";
const loadPromptAiCfg = () => {
try { return JSON.parse(localStorage.getItem(PROMPT_AI_KEY) || "{}"); } catch { return {}; }
};
const savePromptAiCfg = (patch) => {
const data = { ...loadPromptAiCfg(), ...patch };
localStorage.setItem(PROMPT_AI_KEY, JSON.stringify(data));
};
// Restore saved values into UI
const promptAiSaved = loadPromptAiCfg();
const promptAiBackendSaved = promptAiSaved.backend || "ollama";
document.querySelectorAll('input[name="wfm-prompt-ai-backend"]').forEach(r => {
r.checked = r.value === promptAiBackendSaved;
});
const promptAiUrlEl = document.getElementById("wfm-settings-prompt-ai-url");
if (promptAiUrlEl) {
promptAiUrlEl.value = promptAiSaved.backendUrl || "";
promptAiUrlEl.placeholder = getAiBackendDefaultUrl(promptAiBackendSaved);
}
// Backend change → switch URL to the new backend's default
document.querySelectorAll('input[name="wfm-prompt-ai-backend"]').forEach(r => {
r.addEventListener("change", () => {
const backend = document.querySelector('input[name="wfm-prompt-ai-backend"]:checked')?.value || "ollama";
if (promptAiUrlEl) promptAiUrlEl.value = getAiBackendDefaultUrl(backend);
});
});
// Load models directly from the selected backend
async function loadPromptAiModels() {
const select = document.getElementById("wfm-settings-prompt-ai-model");
if (!select) return;
const backend = document.querySelector('input[name="wfm-prompt-ai-backend"]:checked')?.value || "ollama";
const url = (promptAiUrlEl?.value.trim() || getAiBackendDefaultUrl(backend)).replace(/\/$/, "");
try {
let models = [];
if (backend === "ollama") {
const res = await fetch(`${url}/api/tags`);
models = (await res.json()).models?.map(m => m.name) || [];
} else {
const res = await fetch(`${url}/v1/models`);
models = ((await res.json()).data || []).map(m => m.id);
}
const saved = loadPromptAiCfg().model || "";
select.innerHTML = models.length
? models.map(name => `<option value="${name}" ${name === saved ? "selected" : ""}>${name}</option>`).join("")
: `<option value="">${t("noModelsFound")}</option>`;
} catch {
select.innerHTML = `<option value="">${t("failedLoadModels")}</option>`;
}
}
await loadPromptAiModels();
document.getElementById("wfm-settings-prompt-ai-refresh")?.addEventListener("click", loadPromptAiModels);
document.getElementById("wfm-settings-prompt-ai-test")?.addEventListener("click", async () => {
const statusEl = document.getElementById("wfm-settings-prompt-ai-status");
const backend = document.querySelector('input[name="wfm-prompt-ai-backend"]:checked')?.value || "ollama";
const url = (promptAiUrlEl?.value.trim() || getAiBackendDefaultUrl(backend)).replace(/\/$/, "");
if (statusEl) { statusEl.textContent = t("aiStatusConnecting"); statusEl.style.color = "var(--wfm-text-secondary)"; }
try {
let count = 0;
if (backend === "ollama") {
const res = await fetch(`${url}/api/tags`);
count = ((await res.json()).models || []).length;
} else {
const res = await fetch(`${url}/v1/models`);
count = ((await res.json()).data || []).length;
}
if (statusEl) { statusEl.textContent = `${t("ollamaConnected")} (${count} models)`; statusEl.style.color = "var(--wfm-success)"; }
await loadPromptAiModels();
} catch (err) {
if (statusEl) { statusEl.textContent = `${t("ollamaFailed")}: ${err.message}`; statusEl.style.color = "var(--wfm-danger)"; }
}
});
document.getElementById("wfm-settings-prompt-ai-save")?.addEventListener("click", () => {
const backend = document.querySelector('input[name="wfm-prompt-ai-backend"]:checked')?.value || "ollama";
const url = promptAiUrlEl?.value.trim() || "";
const model = document.getElementById("wfm-settings-prompt-ai-model")?.value || "";
savePromptAiCfg({ backend, backendUrl: url, model });
showToast(t("ollamaSaved"), "success");
});
// CivitAI host select
document.getElementById("wfm-settings-civitai-host")?.addEventListener("change", async (e) => {
const host = e.target.value;
@@ -1361,6 +1283,16 @@ export async function initSettingsTab() {
applyTextareaFontSize(px);
});
// --- Video volume slider (auto-saves immediately, no "Save" click needed — a dragged
// slider that silently didn't persist would defeat the whole point of this setting) ---
document.getElementById("wfm-video-volume")?.addEventListener("input", (e) => {
const pct = parseInt(e.target.value) || 0;
const valEl = document.getElementById("wfm-video-volume-val");
if (valEl) valEl.textContent = `${pct}%`;
const volume = setVideoVolume(pct / 100);
document.querySelectorAll("video").forEach((v) => { v.volume = volume; });
});
// --- JSON highlight color pickers ---
document.getElementById("wfm-json-color-grid")?.addEventListener("input", (e) => {
if (e.target.type !== "color") return;
+42 -77
View File
@@ -1,10 +1,16 @@
/**
* Tagger Tab
* Handles WD Tagger / DeepDanbooru + Ollama VLM single/batch tagging.
* Handles WD Tagger / DeepDanbooru + VLM (Ollama/LM Studio/Lemonade/Unsloth) single/batch tagging.
*/
import { t } from "./i18n.js";
import { showToast } from "./app.js";
import { openAiBackendSettingsModal, getAiBackendConfig } from "./ai-settings-modal.js";
const TAGGER_AI_KEY = "wfm_tagger_ai_settings";
function getTaggerAiConfig() {
return getAiBackendConfig(TAGGER_AI_KEY);
}
// ── 状態 ────────────────────────────────────────────────────────
@@ -32,7 +38,7 @@ export function initTaggerTab() {
_setupBatchActions();
_setupDbActions();
_loadModels();
_loadSettings();
_updateVlmBackendIndicators();
}
/** GalleryタブからTaggerタブへ画像を渡す */
@@ -74,8 +80,6 @@ function _applyI18n() {
"wfm-tagger-char-threshold-label": "taggerCharThreshold",
"wfm-tagger-generate-btn": "taggerGenerateTags",
"wfm-tagger-ollama-header-label": "taggerOllamaEnable",
"wfm-tagger-ollama-url-label": "taggerOllamaUrl",
"wfm-tagger-ollama-model-label": "taggerOllamaModel",
"wfm-tagger-ollama-prompt-label": "taggerOllamaPrompt",
"wfm-tagger-ollama-max-label": "taggerOllamaMaxTags",
"wfm-tagger-result-header": "taggerResult",
@@ -87,8 +91,7 @@ function _applyI18n() {
"wfm-tagger-batch-folder-header": "taggerBatchFolder",
"wfm-tagger-batch-threshold-label": "taggerThreshold",
"wfm-tagger-batch-char-threshold-label": "taggerCharThreshold",
"wfm-tagger-batch-url-label": "taggerOllamaUrl",
"wfm-tagger-batch-model-label": "taggerOllamaModel",
"wfm-tagger-batch-ollama-header-label": "taggerOllamaEnable",
"wfm-tagger-batch-prompt-label": "taggerOllamaPrompt",
"wfm-tagger-batch-output-header": "taggerBatchOutput",
"wfm-tagger-batch-save-db-label": "taggerSaveToDB",
@@ -113,6 +116,11 @@ function _applyI18n() {
if (el) el.textContent = t(key);
}
["wfm-tagger-ollama-settings-btn", "wfm-tagger-batch-ollama-settings-btn"].forEach(id => {
const el = document.getElementById(id);
if (el) el.title = t("settings");
});
// サブタブボタン
const subtabKeys = ["taggerSingleTab", "taggerBatchTab", "taggerDbTab"];
document.querySelectorAll(".wfm-tagger-subtab-btn").forEach((btn, i) => {
@@ -168,6 +176,24 @@ function _setupOllamaToggle() {
});
wrap.style.display = chk.checked ? "" : "none";
}
document.getElementById("wfm-tagger-ollama-settings-btn")?.addEventListener("click", () => {
openAiBackendSettingsModal(TAGGER_AI_KEY, t("settings"), _updateVlmBackendIndicators);
});
document.getElementById("wfm-tagger-batch-ollama-settings-btn")?.addEventListener("click", () => {
openAiBackendSettingsModal(TAGGER_AI_KEY, t("settings"), _updateVlmBackendIndicators);
});
}
// ── VLMバックエンド表示 (Taggerタブ独自のAI設定を参照) ────────────
function _updateVlmBackendIndicators() {
const { backend, model } = getTaggerAiConfig();
const label = `${backend}: ${model || t("taggerNoModel")}`;
const singleEl = document.getElementById("wfm-tagger-ollama-backend-value");
if (singleEl) singleEl.textContent = label;
const batchEl = document.getElementById("wfm-tagger-batch-backend-value");
if (batchEl) batchEl.textContent = label;
}
// ── モデル一覧ロード ─────────────────────────────────────────────
@@ -188,61 +214,6 @@ async function _loadModels() {
}
}
// ── Ollamaモデル一覧ロード ───────────────────────────────────────
async function _loadOllamaModels(urlId, selId) {
const urlEl = document.getElementById(urlId);
const selEl = document.getElementById(selId);
if (!urlEl || !selEl) return;
const api = urlEl.value || "http://127.0.0.1:11434";
try {
const res = await fetch(`/wfm/tagger/ollama/models?api_url=${encodeURIComponent(api)}`);
const data = await res.json();
const models = data.models || [];
if (models.length === 0) {
selEl.innerHTML = `<option value="">(${t("taggerNoModel")})</option>`;
} else {
selEl.innerHTML = models.map(m => `<option value="${m}">${m}</option>`).join("");
}
} catch {
selEl.innerHTML = `<option value="">(${t("taggerNoModel")})</option>`;
}
}
// ── 設定の読み込み/保存 ─────────────────────────────────────────
async function _loadSettings() {
try {
const res = await fetch("/wfm/tagger/settings");
const data = await res.json();
if (data.ollama_url) {
const el = document.getElementById("wfm-tagger-ollama-url");
if (el) el.value = data.ollama_url;
}
if (data.batch_ollama_url) {
const el = document.getElementById("wfm-tagger-batch-ollama-url");
if (el) el.value = data.batch_ollama_url;
}
} catch {
// 初回は無視
}
}
async function _saveSettings() {
try {
await fetch("/wfm/tagger/settings", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ollama_url: document.getElementById("wfm-tagger-ollama-url")?.value || "",
batch_ollama_url: document.getElementById("wfm-tagger-batch-ollama-url")?.value || "",
}),
});
} catch {
// サイレントに失敗
}
}
// ── Single サブタブ ─────────────────────────────────────────────
function _setupSingleActions() {
@@ -279,11 +250,6 @@ function _setupSingleActions() {
// タグ生成
document.getElementById("wfm-tagger-generate-btn")?.addEventListener("click", _generateTags);
// Ollamaリフレッシュ
document.getElementById("wfm-tagger-ollama-refresh-btn")?.addEventListener("click", () => {
_loadOllamaModels("wfm-tagger-ollama-url", "wfm-tagger-ollama-model");
});
// 結果アクション
document.getElementById("wfm-tagger-send-genui-btn")?.addEventListener("click", _sendToGenUI);
document.getElementById("wfm-tagger-send-prompt-btn")?.addEventListener("click", _sendToPrompt);
@@ -321,8 +287,7 @@ async function _generateTags() {
const threshold = parseFloat(document.getElementById("wfm-tagger-threshold")?.value || "0.35");
const charThreshold = parseFloat(document.getElementById("wfm-tagger-char-threshold")?.value || "0.85");
const useOllama = document.getElementById("wfm-tagger-ollama-enable")?.checked || false;
const ollamaUrl = document.getElementById("wfm-tagger-ollama-url")?.value || "http://127.0.0.1:11434";
const ollamaModel = document.getElementById("wfm-tagger-ollama-model")?.value || "";
const { backend: vlmBackend, url: vlmUrl, model: ollamaModel, thinkingMode, maxTokens } = getTaggerAiConfig();
const ollamaPrompt = document.getElementById("wfm-tagger-ollama-prompt")?.value || "";
const maxTags = parseInt(document.getElementById("wfm-tagger-ollama-max-tags")?.value || "40");
@@ -344,12 +309,13 @@ async function _generateTags() {
}
if (useOllama && ollamaModel) {
const res2 = await fetch("/wfm/tagger/ollama/predict", {
const res2 = await fetch("/wfm/tagger/vlm/predict", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
image_b64: state.imageB64, api_url: ollamaUrl,
image_b64: state.imageB64, backend: vlmBackend, api_url: vlmUrl,
model: ollamaModel, prompt: ollamaPrompt, max_tags: maxTags,
thinking_mode: thinkingMode, max_tokens: maxTokens,
}),
});
const data2 = await res2.json();
@@ -361,7 +327,6 @@ async function _generateTags() {
if (!tags) { showToast(t("taggerNoTags"), "warning"); return; }
document.getElementById("wfm-tagger-result").value = tags;
showToast(t("taggerDone"), "success");
_saveSettings();
} catch (e) {
showToast(e.message, "error");
} finally {
@@ -453,10 +418,6 @@ async function _saveToDb() {
// ── Batch サブタブ ───────────────────────────────────────────────
function _setupBatchActions() {
document.getElementById("wfm-tagger-batch-ollama-refresh-btn")?.addEventListener("click", () => {
_loadOllamaModels("wfm-tagger-batch-ollama-url", "wfm-tagger-batch-ollama-model");
});
document.getElementById("wfm-tagger-batch-start-btn")?.addEventListener("click", _batchStart);
document.getElementById("wfm-tagger-batch-stop-btn")?.addEventListener("click", _batchStop);
}
@@ -465,15 +426,19 @@ async function _batchStart() {
const folder = document.getElementById("wfm-tagger-batch-folder")?.value || "";
if (!folder) { showToast(t("taggerBatchFolder"), "warning"); return; }
const { backend: vlmBackend, url: vlmUrl, model: vlmModel, thinkingMode, maxTokens } = getTaggerAiConfig();
const body = {
folder,
model: document.getElementById("wfm-tagger-batch-model")?.value || "",
threshold: parseFloat(document.getElementById("wfm-tagger-batch-threshold")?.value || "0.35"),
char_threshold: parseFloat(document.getElementById("wfm-tagger-batch-char-threshold")?.value || "0.85"),
use_ollama: document.getElementById("wfm-tagger-batch-ollama-enable")?.checked || false,
ollama_api: document.getElementById("wfm-tagger-batch-ollama-url")?.value || "http://127.0.0.1:11434",
ollama_model: document.getElementById("wfm-tagger-batch-ollama-model")?.value || "",
vlm_backend: vlmBackend,
vlm_api_url: vlmUrl,
ollama_model: vlmModel,
ollama_prompt: document.getElementById("wfm-tagger-batch-ollama-prompt")?.value || "",
thinking_mode: thinkingMode,
max_tokens: maxTokens,
save_db: document.getElementById("wfm-tagger-batch-save-db")?.checked ?? true,
write_file: document.getElementById("wfm-tagger-batch-write-file")?.checked || false,
write_txt: document.getElementById("wfm-tagger-batch-write-txt")?.checked || false,
+46
View File
@@ -109,6 +109,52 @@ export function getAiBackendDefaultUrl(backend) {
return AI_BACKEND_DEFAULT_URLS[backend] || AI_BACKEND_DEFAULT_URLS.ollama;
}
// Unslothはローカルでも常にAPIキーが必要なため、フロントから直接叩かず
// サーバー側プロキシ(/api/wfm/unsloth/proxy)経由でキーを付与して中継する
// (see py/routes/unsloth_routes.py)
export async function unslothProxy(baseUrl, path, method, payload) {
const res = await fetch("/api/wfm/unsloth/proxy", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ baseUrl, path, method, payload }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.message || `HTTP ${res.status}`);
return data;
}
// ローカルVLM/LLMバックエンドからモデルをVRAM/メモリからアンロードする。
// 公式APIが存在しない場合(Unsloth)は "UNSUPPORTED" エラーを投げる。
export async function unloadAiModel(url, backend, model) {
if (!model) throw new Error("No model selected");
if (backend === "ollama") {
// keep_alive:0 + 空プロンプトが公式に文書化されたアンロード方法
// (専用エンドポイントは存在しない) https://docs.ollama.com/api
const res = await fetch(`${url}/api/generate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ model, prompt: "", keep_alive: 0 }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
} else if (backend === "lmstudio") {
const res = await fetch(`${url}/api/v1/models/unload`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ instance_id: model }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
} else if (backend === "lemonade") {
const res = await fetch(`${url}/api/v1/unload`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ model_name: model }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
} else {
throw new Error("UNSUPPORTED");
}
}
// ============================================
// Eagle Auto-Save
// ============================================
+152 -61
View File
@@ -1,8 +1,8 @@
/**
* Video Tab - MiniMax H3 (Image to Video) 専用の動画生成UI
* GenerateUIタブとは完全に独立。UI形式ワークフローJSONを直接編集し、
* comfyWorkflow.convertUiToApi() でAPI形式に変換して実行する。
* 状態は「テンプレートJSON+フォーム値」のみ保持し、生成の都度
* Video Tab - MiniMax H3 (Image to Video) / LTX-2.5 (Text・Image・First&Last-Frame to
* Video) / Wan2.2 (Text to Video) 対応の動画生成UI。GenerateUIタブとは完全に独立。
* UI形式ワークフローJSONを直接編集し、comfyWorkflow.convertUiToApi() でAPI形式に
* 変換して実行する。状態は「テンプレートJSON+フォーム値」のみ保持し、生成の都度
* structuredClone() したコピーに書き込む(複数回生成をまたいだID不整合を防ぐ)。
*/
@@ -11,8 +11,7 @@ import { t } from "./i18n.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyWorkflow } from "./comfyui-workflow.js";
import { escapeHtml } from "./util.js";
const DEFAULT_WORKFLOW_FILENAME = "minimax_test.json";
import { applyStoredVideoVolume } from "./settings-tab.js";
const state = {
templateWorkflow: null,
@@ -29,62 +28,111 @@ const state = {
};
// ============================================
// ワークフロー取得
// 動画モデルノードの動的特定(ノードIDをハードコードしない)
// MiniMax H3 / LTX-2.5 (Text・Image・First&Last-Frame to Video) / Wan2.2 (Text to Video)
// に対応。サブグラフの内部ノード型(Wan2.2のみサブグラフ名)で対象ワークフローの種類を
// 判定し、以降はサブグラフが公開する入力のlabel(無ければname)で意味的にスロットを
// 特定する。これによりLTX-2.5の3バリアント間で公開入力のname(text/value/value_1...)
// が揺れていても、label(prompt/duration/width...)は共通しているため同じロジックで
// 処理できる。
// ============================================
async function getRawWorkflow(filename) {
const res = await fetch(`/api/wfm/workflows/raw?filename=${encodeURIComponent(filename)}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return await res.json();
// ノードのinputs[]のうちwidgetキーを持つものだけを抽出した並び順で、指定した入力定義の
// インデックスを引く。widgets_values配列はこの並び順と1:1対応する(link接続されていても
// widgetキーを持つ入力はwidgets_valuesにスロットを持つ「legacy full」形式のため)。
function _widgetIndexOf(node, inputDef) {
if (!inputDef) return -1;
const widgetInputs = (node?.inputs || []).filter((inp) => inp.widget);
return widgetInputs.indexOf(inputDef);
}
// ============================================
// MiniMax H3ノードの動的特定(ノードIDをハードコードしない)
// ============================================
// ノードのinputs[]のうちwidgetキーを持つものだけを抽出した並び順で、名前からインデックスを引く。
// widgets_values配列はこの並び順と1:1対応する(link接続されていてもwidgetキーを持つ入力は
// widgets_valuesにスロットを持つ「legacy full」形式のため)。
// 上と同じ並び順ルールで、名前から直接インデックスを引く版(ResolutionSelectorや
// LoadImageなど、モデルファミリー間で入力名が揺れないノードに使う)。
function _widgetIndex(node, name) {
const widgetInputs = (node?.inputs || []).filter((inp) => inp.widget);
return widgetInputs.findIndex((inp) => inp.name === name);
}
function locateMiniMaxNodes(workflow) {
if (!Array.isArray(workflow?.nodes) || !Array.isArray(workflow?.links)) return null;
// サブグラフが公開する入力は、labelがあればlabel、無ければnameが意味的な役割を表す
// (例: MiniMax H3の"width"はlabel無しでname自体が"width"、LTX-2.5の"value_2"はlabelが
// "width")。
function _findInputByLabel(node, label) {
return (node?.inputs || []).find((inp) => (inp.label || inp.name) === label) || null;
}
const sgDef = (workflow.definitions?.subgraphs || [])
.find((sg) => (sg.nodes || []).some((n) => n.type === "MiniMaxH3ImageToVideo"));
if (!sgDef) return null;
function _detectVideoSubgraph(workflow) {
if (!Array.isArray(workflow?.nodes) || !Array.isArray(workflow?.links)) return null;
const subgraphs = workflow.definitions?.subgraphs || [];
const minimax = subgraphs.find((sg) => (sg.nodes || []).some((n) => n.type === "MiniMaxH3ImageToVideo"));
if (minimax) return { family: "minimax", sgDef: minimax };
// LTX-2.5のText/Image/First&Last-Frame to Videoはいずれも内部にLTXV*系ノードを持つ
// サブグラフとして配布される。バリアントごとにサブグラフの公開入力nameが異なるため、
// 内部ノード型のプレフィックスで検出する。
const ltx = subgraphs.find((sg) => (sg.nodes || []).some((n) => typeof n.type === "string" && n.type.startsWith("LTXV")));
if (ltx) return { family: "ltx25", sgDef: ltx };
// Wan2.2はUNETLoader/KSamplerAdvanced/EmptyHunyuanLatentVideoなど汎用ノードのみで
// 構成されており、MiniMax H3/LTX-2.5のような固有ノード型による検出ができない。
// そのためサブグラフ自体の名前(公式テンプレート由来の "...(Wan2.2)" 表記)で検出する。
const wan22 = subgraphs.find((sg) => /wan\s*2\.2/i.test(sg.name || ""));
if (wan22) return { family: "wan22", sgDef: wan22 };
return null;
}
function locateVideoModelNodes(workflow) {
const detected = _detectVideoSubgraph(workflow);
if (!detected) return null;
const { family, sgDef } = detected;
const instanceNode = workflow.nodes.find((n) => n.type === sgDef.id);
if (!instanceNode || !Array.isArray(instanceNode.widgets_values)) return null;
const firstFrameSlot = instanceNode.inputs.findIndex((inp) => inp.name === "first_frame");
const lastFrameSlot = instanceNode.inputs.findIndex((inp) => inp.name === "last_frame");
const widthSlot = instanceNode.inputs.findIndex((inp) => inp.name === "width");
if (firstFrameSlot === -1 || lastFrameSlot === -1 || widthSlot === -1) return null;
// Wan2.2の公開入力はプロンプトが label 無しの name="text" のまま(MiniMax H3の"prompt"や
// LTX-2.5の label="prompt" と異なる)ため、"prompt" が見つからない場合は "text" にフォール
// バックする。
const promptInput = _findInputByLabel(instanceNode, "prompt") || _findInputByLabel(instanceNode, "text");
const durationInput = _findInputByLabel(instanceNode, "duration");
const widthInput = _findInputByLabel(instanceNode, "width");
if (!promptInput || !durationInput || !widthInput) return null;
const promptIdx = _widgetIndexOf(instanceNode, promptInput);
const durationIdx = _widgetIndexOf(instanceNode, durationInput);
if (promptIdx === -1 || durationIdx === -1) return null;
const widthSlot = instanceNode.inputs.indexOf(widthInput);
const findLinkedNode = (targetSlot) => {
if (targetSlot === -1) return null;
const link = workflow.links.find((l) => l[3] === instanceNode.id && l[4] === targetSlot);
if (!link) return null;
return workflow.nodes.find((n) => n.id === link[1]) || null;
};
// first_frameはoptional入力のため、LoadImageノードが接続されていないワークフロー
// (テキストのみで動作するT2V構成など)もサポート対象とする。未接続の場合は
// loadImageNode: null のまま返し、必要ならrunGeneration側で動的にノードを注入する。
// 一部のLTX-2.5バリアント(First & Last Frame to Video等)はResolutionSelectorを介さず、
// width/heightをサブグラフの直接ウィジェット値として持つ。その場合はresolutionNode: null
// を返し、以降の処理ではaspect_ratio等の操作をスキップする(テンプレートのwidth/height値が
// そのまま使われる)。
const rawResolutionNode = findLinkedNode(widthSlot);
const resolutionNode = (rawResolutionNode && rawResolutionNode.type === "ResolutionSelector") ? rawResolutionNode : null;
// first_frame/last_frameはoptional入力のため、対応するLoadImageノードが接続されて
// いないワークフロー(テキストのみで動作するT2V構成など)もサポート対象とする。
// 未接続の場合はnullのまま返し、必要ならrunGeneration側で動的にノードを注入する。
const firstFrameInput = _findInputByLabel(instanceNode, "first_frame");
const lastFrameInput = _findInputByLabel(instanceNode, "last_frame");
const firstFrameSlot = firstFrameInput ? instanceNode.inputs.indexOf(firstFrameInput) : -1;
const lastFrameSlot = lastFrameInput ? instanceNode.inputs.indexOf(lastFrameInput) : -1;
const rawLoadImageNode = findLinkedNode(firstFrameSlot);
const loadImageNode = (rawLoadImageNode && rawLoadImageNode.type === "LoadImage") ? rawLoadImageNode : null;
const resolutionNode = findLinkedNode(widthSlot);
if (!resolutionNode || resolutionNode.type !== "ResolutionSelector") return null;
const promptIdx = _widgetIndex(instanceNode, "prompt");
const durationIdx = _widgetIndex(instanceNode, "value_1");
if (promptIdx === -1 || durationIdx === -1) return null;
const rawLastLoadImageNode = findLinkedNode(lastFrameSlot);
const lastLoadImageNode = (rawLastLoadImageNode && rawLastLoadImageNode.type === "LoadImage") ? rawLastLoadImageNode : null;
return {
sgDef, instanceNode, loadImageNode, resolutionNode,
family, sgDef, instanceNode, loadImageNode, lastLoadImageNode, resolutionNode,
firstFrameSlot, lastFrameSlot, promptIdx, durationIdx,
};
}
@@ -93,6 +141,40 @@ function locateMiniMaxNodes(workflow) {
// ワークフロー読み込み
// ============================================
// GenerateUIタブのModelタブが使う「ロードされたワークフローに該当する項目」ハイライト
// (wfm-model-label-active、色は設定のGenerateUI Modelタブ ハイライト色と共通) を、
// Videoタブの左パネルにも適用する。Wan2.2などResolutionSelectorを持たないファミリーは
// Aspect Ratio/Megapixels/Multipleが操作不可(既にdisabled)になるため、ここでも
// 該当なし扱いにしてハイライトしない。
const _VIDEO_FIELD_LABEL_IDS = [
"wfm-video-prompt-label",
"wfm-video-duration-label",
"wfm-video-first-frame-label",
"wfm-video-last-frame-label",
"wfm-video-aspect-ratio-label",
"wfm-video-megapixels-label",
"wfm-video-multiple-label",
];
function _setFieldActive(id, active) {
document.getElementById(id)?.classList.toggle("wfm-model-label-active", !!active);
}
function _updateFieldHighlights(nodes) {
if (!nodes) {
_VIDEO_FIELD_LABEL_IDS.forEach((id) => _setFieldActive(id, false));
return;
}
const hasResolution = !!nodes.resolutionNode;
_setFieldActive("wfm-video-prompt-label", true);
_setFieldActive("wfm-video-duration-label", true);
_setFieldActive("wfm-video-first-frame-label", nodes.firstFrameSlot !== -1);
_setFieldActive("wfm-video-last-frame-label", nodes.lastFrameSlot !== -1);
_setFieldActive("wfm-video-aspect-ratio-label", hasResolution);
_setFieldActive("wfm-video-megapixels-label", hasResolution);
_setFieldActive("wfm-video-multiple-label", hasResolution);
}
function _showFramePreview(which, filename) {
const previewImg = document.getElementById(`wfm-video-${which}-frame-preview`);
const wrap = document.getElementById(`wfm-video-${which}-frame-wrap`);
@@ -102,21 +184,26 @@ function _showFramePreview(which, filename) {
}
export async function loadWorkflowIntoVideoEditor(workflow, filename) {
const nodes = locateMiniMaxNodes(workflow);
const nodes = locateVideoModelNodes(workflow);
if (!nodes) {
showToast(t("videoUnsupportedWorkflow"), "error");
_updateFieldHighlights(null);
return false;
}
_updateFieldHighlights(nodes);
state.templateWorkflow = workflow;
state.templateFilename = filename || "";
state.firstFrameFilename = null;
state.lastFrameFilename = null;
// 前回読み込んだワークフローのFirst/Last Frameプレビューが残っていると、画像を使わない
// ワークフロー(T2V構成など)を読み込んだ際に誤って画像が使われるかのように見えてしまう。
// state自体は下で再設定されるが、プレビュー表示(DOM)側は明示的にクリアしないと残留する。
_clearFrame("first");
_clearFrame("last");
const nameEl = document.getElementById("wfm-video-wf-name");
if (nameEl) nameEl.textContent = filename || "Loaded Workflow";
const { instanceNode, resolutionNode, loadImageNode, promptIdx, durationIdx } = nodes;
const { instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx } = nodes;
const promptEl = document.getElementById("wfm-video-prompt");
if (promptEl) promptEl.value = instanceNode.widgets_values[promptIdx] ?? "";
@@ -135,27 +222,25 @@ export async function loadWorkflowIntoVideoEditor(workflow, filename) {
if (mpEl && mpIdx !== -1) mpEl.value = resolutionNode.widgets_values[mpIdx] ?? mpEl.value;
const multEl = document.getElementById("wfm-video-multiple");
if (multEl && multIdx !== -1) multEl.value = resolutionNode.widgets_values[multIdx] ?? multEl.value;
// ResolutionSelectorを介さないバリアント(width/heightが直接ウィジェット値)では
// aspect_ratio/megapixels/multipleを反映する先が無いため、操作できないことが分かるよう無効化する。
[aspectEl, mpEl, multEl].forEach((el) => { if (el) el.disabled = !resolutionNode; });
const fnIdx = _widgetIndex(loadImageNode, "image");
if (fnIdx !== -1 && loadImageNode.widgets_values[fnIdx]) {
state.firstFrameFilename = loadImageNode.widgets_values[fnIdx];
_showFramePreview("first", state.firstFrameFilename);
}
const lastFnIdx = _widgetIndex(lastLoadImageNode, "image");
if (lastFnIdx !== -1 && lastLoadImageNode.widgets_values[lastFnIdx]) {
state.lastFrameFilename = lastLoadImageNode.widgets_values[lastFnIdx];
_showFramePreview("last", state.lastFrameFilename);
}
showToast(t("videoWorkflowLoaded", filename || ""), "success");
return true;
}
async function loadDefaultWorkflow() {
try {
const wf = await getRawWorkflow(DEFAULT_WORKFLOW_FILENAME);
await loadWorkflowIntoVideoEditor(wf, DEFAULT_WORKFLOW_FILENAME);
} catch {
// 初回自動ロード失敗は静かに無視する(環境によってファイルが存在しないこともある)。
// Workflowタブの「Load in Video」ボタンから明示的に読み込める。
}
}
// ============================================
// Aspect Ratio 選択肢(object_infoから動的取得、ハードコードしない)
// ============================================
@@ -252,7 +337,7 @@ function _readFormValues() {
}
function _applyFormToWorkflow(nodes, form) {
const { instanceNode, resolutionNode, loadImageNode, promptIdx, durationIdx } = nodes;
const { instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx } = nodes;
instanceNode.widgets_values[promptIdx] = form.prompt;
instanceNode.widgets_values[durationIdx] = form.duration;
@@ -264,13 +349,17 @@ function _applyFormToWorkflow(nodes, form) {
if (mpIdx !== -1) resolutionNode.widgets_values[mpIdx] = form.megapixels;
if (multIdx !== -1) resolutionNode.widgets_values[multIdx] = form.multiple;
// first_frameは既存のLoadImageノードが接続されている場合のみここで書き換える。
// 接続が無い場合(loadImageNode: null)は、first_frameが新規指定された時だけ
// first_frame/last_frameは既存のLoadImageノードが接続されている場合のみここで書き換える。
// 接続が無い場合(loadImageNode/lastLoadImageNode: null)は、画像が新規指定された時だけ
// _injectFrameNode()でノードごと注入する(未指定ならバイパス=未接続のまま実行)。
if (loadImageNode) {
const fnIdx = _widgetIndex(loadImageNode, "image");
if (fnIdx !== -1) loadImageNode.widgets_values[fnIdx] = state.firstFrameFilename;
}
if (lastLoadImageNode) {
const fnIdx = _widgetIndex(lastLoadImageNode, "image");
if (fnIdx !== -1) lastLoadImageNode.widgets_values[fnIdx] = state.lastFrameFilename;
}
}
// first_frame/last_frameが未接続のワークフローに対して、画像が指定された時だけ
@@ -324,19 +413,19 @@ async function runGeneration() {
}
const clone = structuredClone(state.templateWorkflow);
const nodes = locateMiniMaxNodes(clone);
const nodes = locateVideoModelNodes(clone);
if (!nodes) {
showToast(t("videoUnsupportedWorkflow"), "error");
return;
}
_applyFormToWorkflow(nodes, _readFormValues());
// first_frame: 既存のLoadImageノードが無いワークフロー(T2V構成等)で、
// first_frame/last_frame: 既存のLoadImageノードが無いワークフロー(T2V構成等)で、
// ユーザーが新たに画像を指定した場合のみノードを注入する。未指定ならバイパス(未接続のまま実行)。
if (!nodes.loadImageNode && state.firstFrameFilename) {
_injectFrameNode(clone, nodes.instanceNode, nodes.firstFrameSlot, state.firstFrameFilename);
}
if (state.lastFrameFilename) {
if (!nodes.lastLoadImageNode && state.lastFrameFilename) {
_injectFrameNode(clone, nodes.instanceNode, nodes.lastFrameSlot, state.lastFrameFilename);
}
@@ -420,8 +509,8 @@ function _setPreviewMedia(url, source) {
}
function _renderResult(images) {
// MiniMax H3 always emits a single VIDEO output — but guard generically (prefer
// an mp4 if present) in case a future video workflow's SaveVideo/PreviewVideo
// Both MiniMax H3 and LTX-2.5 emit a single VIDEO output — but guard generically
// (prefer an mp4 if present) in case a future video workflow's SaveVideo/PreviewVideo
// ordering differs.
const media = (images || []).find((img) => img.filename.toLowerCase().endsWith(".mp4")) || images?.[0];
if (!media) {
@@ -517,7 +606,7 @@ function _applyVideoI18n() {
// ============================================
// Video Source panel — loads any local video into the preview frame, independent of
// generation, so Frame/GIF tools work without running MiniMax H3 first.
// generation, so Frame/GIF tools work without running the loaded video workflow first.
// ============================================
function _wireVideoSourcePanel() {
@@ -721,5 +810,7 @@ export function initVideoTab() {
_initFrameTab();
_initGifTab();
loadDefaultWorkflow();
// 保存済みの音量を適用し、以降ユーザーがネイティブコントロールで変更した音量も
// 自動保存する(要素自体は永続的なので初期化時に一度呼べば十分)。
applyStoredVideoVolume(document.getElementById("wfm-video-preview-video"));
}
+1 -1
View File
@@ -1378,7 +1378,7 @@ export function initWorkflowTab() {
}
});
// Toolbar: Load in Video button (MiniMax H3専用。非対応ワークフローはloadWorkflowIntoVideoEditor内でエラートースト表示済み)
// Toolbar: Load in Video button (MiniMax H3 / LTX-2.5 / Wan2.2対応。非対応ワークフローはloadWorkflowIntoVideoEditor内でエラートースト表示済み)
document.getElementById("wfm-list-load-video-btn")?.addEventListener("click", async () => {
if (!state.selectedWf) return;
try {
+22 -33
View File
@@ -951,12 +951,8 @@
<div class="wfm-prompt-split-header">AI Assistant</div>
<div class="wfm-ollama-assistant">
<div class="wfm-ollama-controls">
<select id="wfm-ollama-model" class="wfm-select" style="flex:1;min-width:120px;">
<option value="">Loading models...</option>
</select>
<button id="wfm-ollama-refresh-btn" class="wfm-btn wfm-btn-sm">Refresh</button>
<button id="wfm-ollama-test-btn" class="wfm-btn wfm-btn-sm">Test</button>
<span id="wfm-ollama-status" class="wfm-ollama-status">Disconnected</span>
<button id="wfm-ollama-settings-btn" class="wfm-btn wfm-btn-sm" style="margin-left:auto;" title="Settings">&#9881;</button>
</div>
<div class="wfm-ollama-controls" style="margin-top:6px;">
<button id="wfm-ollama-attach-btn" class="wfm-btn wfm-btn-sm">Attach Image</button>
@@ -1417,7 +1413,8 @@
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors) are always shown; ControlNet and Hypernetwork (with Strength field) are collapsed by default since they're used less often — click their header to expand; LoRA (Single/Stack tabs) has its own column to the right; all selectors have a filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
<li id="wfm-help-gen-28">Model tab — Highlight color: the label of each model type (Checkpoint, VAE, Diffusion Model, Text Encoder, ControlNet, Hypernetwork) and the LoRA column header turn a distinct color (default bright green) when the loaded workflow actually contains that type of node; this stays visible even while ControlNet/Hypernetwork are collapsed, so you can tell at a glance whether they're in use without expanding them; the color is customizable in the Settings tab</li>
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow; if the loaded workflow has Bypass or Mute nodes, a note listing them appears above the search bar (Bypass nodes are excluded with their wires reconnected around them; Mute nodes are excluded with no reconnection, matching ComfyUI itself)</li>
<li id="wfm-help-gen-31">LTX-2.5 and Wan2.2 video workflows also work when loaded as regular workflows in this tab (not just the dedicated Video tab): Positive/Negative Prompt detection follows LTX-2.5's LTXVDualCFGGuider / LTXVConditioning nodes to find the actual prompt text, and the Settings tab's Latent Image section recognizes Wan2.2's EmptyHunyuanLatentVideo and LTX-2.5's EmptyLTXVLatentVideo nodes (with an added Length (frames) field) instead of showing "No EmptyLatentImage node found"; generating from these workflows also gets the same extended timeout as MiniMax H3 video generations</li>
<li id="wfm-help-gen-7">Raw JSON always visible in the right column of each tab — edit directly and Apply to reload the workflow; if the loaded workflow has Bypass or Mute nodes, a note listing them appears above the search bar (Bypass nodes are excluded with their wires reconnected around them; Mute nodes are excluded with no reconnection, matching ComfyUI itself); the search bar highlights matches and scrolls to them without moving the cursor into the editor, so typing right after a search can't accidentally overwrite the JSON — click into the editor first to actually edit</li>
<li id="wfm-help-gen-30">The <b>Save</b> button (right end of the subtab bar) is hidden while the <b>Batch</b> or <b>Lab</b> subtab is active, since those work on workflow copies / their own Plan files rather than the currently loaded workflow; it reappears on Input/Model/Settings/Feeder</li>
</ul>
</div>
@@ -1571,7 +1568,7 @@
<div class="wfm-help-card">
<h3 id="wfm-help-prompt-card-ai-title">AI Assistant &amp; Translation</h3>
<ul>
<li id="wfm-help-prompt-1">AI assistant (Ollama): model selection, chat for prompt consultation, image attachment (vision models)</li>
<li id="wfm-help-prompt-1">AI assistant (Ollama / LM Studio / Lemonade / Unsloth): chat for prompt consultation, image attachment (vision models); click the &#9881; Settings button to choose backend, connection URL, model, Thinking mode, Max tokens, and unload the loaded model &mdash; settings are independent from the AI TOOL and Tagger tabs</li>
<li id="wfm-help-prompt-2">Apply AI responses to GenerateUI prompts</li>
<li id="wfm-help-prompt-3">Translation: JA&#8596;EN, ZH&#8596;EN</li>
</ul>
@@ -1666,7 +1663,7 @@
<h3 id="wfm-help-settings-card-connections-title">Connections</h3>
<ul>
<li id="wfm-help-settings-4">ComfyUI connection URL and test</li>
<li id="wfm-help-settings-5">Ollama URL, default model, and connection test</li>
<li id="wfm-help-settings-5">AI Assistant settings have moved out of this tab &mdash; the Prompt tab, Tagger tab, and AI TOOL tab each have their own &#9881; Settings button (backend, URL, model, Thinking mode, Max tokens, unload model), saved independently</li>
<li id="wfm-help-settings-7">Eagle integration URL and auto-save toggle</li>
</ul>
</div>
@@ -1922,7 +1919,7 @@
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-ai-card-settings-title">Settings pane</h3>
<p id="wfm-help-ai-6">Settings pane: choose backend (Ollama / LM Studio / Lemonade / Unsloth), set API URL, test connection, select model; Unsloth always requires an API key even for local access — set UNSLOTH_API_KEY in a .env file in the plugin folder (copy .env.example) and restart ComfyUI, the key is read server-side and never sent to the browser; Unsloth also requires "Auto model switching (OpenAI API)" to be turned ON in the Unsloth Desktop app itself (its own Settings screen) — without it, requests fail with HTTP 404 unless a model was already manually loaded in the Unsloth Studio UI; Unsloth reasoning models return their thinking in a separate reasoning_content field rather than inline &lt;think&gt; tags, so a low Max tokens can make the model spend its whole budget reasoning and return an empty reply — increase Max tokens (2048+) if replies come back blank; Generation section — Thinking mode toggle (off by default; Ollama receives a `think` flag, and regardless of backend any &lt;think&gt;...&lt;/think&gt; block is stripped from the output when off, so reasoning models don't clutter Translation/Chat/TOOLS results) and Max tokens (Ollama: num_predict, LM Studio/Lemonade/Unsloth: max_tokens; 0 = unlimited); configure Free language names; Chat Image Generation section lets you enable a dedicated workflow for Chat-triggered text-to-image generation instead of the one currently loaded in GenerateUI; Chat I2I Generation section is the same but for image-to-image generation when an image is attached; settings are shared with the Library panel's A tab via localStorage</p>
<p id="wfm-help-ai-6">Settings pane: choose backend (Ollama / LM Studio / Lemonade / Unsloth), set API URL, test connection, select model, and use the Unload Model button (next to Test connection) to free the loaded model from VRAM/memory &mdash; Ollama uses keep_alive:0, LM Studio uses /api/v1/models/unload, Lemonade uses /api/v1/unload; Unsloth has no unload API, so this shows an unsupported message for it; Unsloth always requires an API key even for local access — set UNSLOTH_API_KEY in a .env file in the plugin folder (copy .env.example) and restart ComfyUI, the key is read server-side and never sent to the browser; Unsloth also requires "Auto model switching (OpenAI API)" to be turned ON in the Unsloth Desktop app itself (its own Settings screen) — without it, requests fail with HTTP 404 unless a model was already manually loaded in the Unsloth Studio UI; Unsloth reasoning models return their thinking in a separate reasoning_content field rather than inline &lt;think&gt; tags, so a low Max tokens can make the model spend its whole budget reasoning and return an empty reply — increase Max tokens (2048+) if replies come back blank; Generation section — Thinking mode toggle (off by default; Ollama receives a `think` flag, and regardless of backend any &lt;think&gt;...&lt;/think&gt; block is stripped from the output when off, so reasoning models don't clutter Translation/Chat/TOOLS results) and Max tokens (Ollama: num_predict, LM Studio/Lemonade/Unsloth: max_tokens; 0 = unlimited); configure Free language names; Chat Image Generation section lets you enable a dedicated workflow for Chat-triggered text-to-image generation instead of the one currently loaded in GenerateUI; Chat I2I Generation section is the same but for image-to-image generation when an image is attached; settings are shared with the Library panel's A tab via localStorage</p>
</div>
</div>
@@ -1934,7 +1931,7 @@
<div class="wfm-help-card">
<h3 id="wfm-help-tagger-card-overview-title">Overview &amp; Setup</h3>
<ul>
<li id="wfm-help-tagger-1">Automatic image tagging using WD Tagger (ONNX), SwinV2, DeepDanbooru (.h5), and Ollama VLM — 3 sub-tabs: Single / Batch / DB</li>
<li id="wfm-help-tagger-1">Automatic image tagging using WD Tagger (ONNX), SwinV2, DeepDanbooru (.h5), and VLM (Ollama / LM Studio / Lemonade / Unsloth) — 3 sub-tabs: Single / Batch / DB</li>
<li id="wfm-help-tagger-2">Model placement: put each model in its own subfolder under ComfyUI/models/tagger/&lt;model-name&gt;/; the folder must contain a .onnx file + selected_tags.csv (or .h5 + label file for DeepDanbooru)</li>
<li id="wfm-help-tagger-9">Install dependencies into ComfyUI's embedded Python: python_embeded\python.exe -m pip install -r requirements.txt; for GPU ONNX inference install onnxruntime-gpu instead of onnxruntime; TensorFlow (for DeepDanbooru) is commented out by default due to size</li>
</ul>
@@ -1944,7 +1941,7 @@
<ul>
<li id="wfm-help-tagger-3">Single tab: drag &amp; drop an image onto the preview area, or click Upload to pick a file; the Tagger button in the Gallery detail panel opens the selected image directly here</li>
<li id="wfm-help-tagger-4">Threshold slider: minimum confidence score for general tags (default 0.35); Character Threshold: separate threshold for character: prefix tags (default 0.85)</li>
<li id="wfm-help-tagger-5">Ollama VLM: enable the checkbox to run a vision model alongside WD Tagger; set API URL, select model (click ↻ to refresh), and customize the prompt; results from both models are merged</li>
<li id="wfm-help-tagger-5">VLM Tagging: enable the checkbox to run a vision model alongside WD Tagger; click the &#9881; Settings button to choose backend (Ollama / LM Studio / Lemonade / Unsloth), URL, model, Thinking mode, Max tokens, and unload the model &mdash; independent from the Prompt tab's own AI settings; customize the prompt and Max Tags inline; results from both models are merged</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1956,7 +1953,7 @@
<div class="wfm-help-card">
<h3 id="wfm-help-tagger-card-batch-title">Batch &amp; DB Tabs</h3>
<ul>
<li id="wfm-help-tagger-7">Batch tab: enter a folder path, configure WD Tagger and Ollama settings; output options: Save to DB (default on), Write to File (EXIF/PNG metadata), Write .txt (creates &lt;filename&gt;.txt alongside each image); click Start Batch to process all images in the folder; progress bar and log are updated in real time; Stop cancels after the current image</li>
<li id="wfm-help-tagger-7">Batch tab: enter a folder path, configure WD Tagger and enable VLM tagging (uses the same &#9881; Settings as the Single tab); output options: Save to DB (default on), Write to File (EXIF/PNG metadata), Write .txt (creates &lt;filename&gt;.txt alongside each image); click Start Batch to process all images in the folder; progress bar and log are updated in real time; Stop cancels after the current image</li>
<li id="wfm-help-tagger-8">DB tab: searchable database of all tagged images; click a row to open the edit panel and modify WD Tags / VLM Tags; Save updates the record, Delete removes it; Export CSV downloads all records as a CSV file</li>
</ul>
</div>
@@ -2093,16 +2090,17 @@
<div class="wfm-help-page" id="wfm-help-page-video">
<h2 id="wfm-help-video-title">Video Tab</h2>
<p id="wfm-help-video-desc">A dedicated video generation tab for the MiniMax H3 (Image to Video) workflow, independent of the GenerateUI tab.</p>
<p id="wfm-help-video-desc">A dedicated video generation tab for MiniMax H3 (Image to Video), LTX-2.5 (Text / Image / First & Last Frame to Video), and Wan2.2 (Text to Video) workflows, independent of the GenerateUI tab.</p>
<div class="wfm-help-card">
<ul>
<li id="wfm-help-video-1">Set first_frame (optional) / last_frame (optional) images, prompt, aspect_ratio / megapixels / multiple (resolution), duration (seconds), and noise_seed, then click Generate. Leaving first_frame empty runs the workflow text-only (bypassed), and workflows with no LoadImage node at all are also supported.</li>
<li id="wfm-help-video-2">Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults and cannot be changed from this tab.</li>
<li id="wfm-help-video-3">Use the "Load in Video" button in the Workflow tab's detail modal to load a workflow containing a MiniMax H3 Image-to-Video node. Unsupported workflows show an error instead.</li>
<li id="wfm-help-video-2">Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults and cannot be changed from this tab. For workflows with no ResolutionSelector node (e.g. Wan2.2), resolution also stays fixed to the loaded workflow's defaults and the Aspect Ratio / Megapixels / Multiple fields are disabled.</li>
<li id="wfm-help-video-3">Use the "Load in Video" button in the Workflow tab's detail modal to load a workflow containing a MiniMax H3 Image-to-Video node, an LTX-2.5 Text/Image/First&Last-Frame-to-Video node, or a Wan2.2 Text-to-Video node. Unsupported workflows show an error instead.</li>
<li id="wfm-help-video-4">Generated videos (mp4) can also be browsed and played back in the Gallery tab.</li>
<li id="wfm-help-video-5">The Video Source panel next to the preview lets you drop or pick any local video (not just a generated one) to use the Frame/GIF tools below without running MiniMax H3 first; Clear resets it back to empty.</li>
<li id="wfm-help-video-5">The Video Source panel next to the preview lets you drop or pick any local video (not just a generated one) to use the Frame/GIF tools below without running the loaded video workflow first; Clear resets it back to empty.</li>
<li id="wfm-help-video-6">Frame tab (right panel): play/seek the preview video to the position you want, click Capture Frame to grab that frame client-side, then Save to Output to write it as a PNG into ComfyUI's output folder.</li>
<li id="wfm-help-video-7">GIF tab (right panel): set Start/End (seconds), FPS, and an optional Max Width, then Convert to GIF — the server decodes the video and encodes an animated GIF into ComfyUI's output folder.</li>
<li id="wfm-help-video-8">Highlight color: the Prompt / Duration / First Frame / Last Frame / Aspect Ratio / Megapixels / Multiple labels turn the same highlight color as the GenerateUI Model tab (customizable in the Settings tab) when the loaded workflow actually supports that field — e.g. for a Wan2.2 workflow (no ResolutionSelector node), the Aspect Ratio / Megapixels / Multiple labels stay unhighlighted since those fields are disabled.</li>
</ul>
</div>
<button class="wfm-help-jump-btn wfm-btn wfm-btn-sm" data-jump-tab="video">Go to Video Tab</button>
@@ -2687,12 +2685,12 @@
</div>
</section>
<!-- Video Tab (MiniMax H3専用・GenerateUIタブとは独立) -->
<!-- Video Tab (MiniMax H3 / LTX-2.5対応・GenerateUIタブとは独立) -->
<section id="wfm-tab-video" class="wfm-tab-content">
<div class="wfm-video-layout">
<div class="wfm-video-form-panel">
<div class="wfm-video-header">
<h3 id="wfm-video-title-label">Video (MiniMax H3)</h3>
<h3 id="wfm-video-title-label">Video</h3>
<span id="wfm-video-wf-name" class="wfm-video-wf-name">No workflow loaded</span>
</div>
@@ -2907,13 +2905,8 @@
</div>
<div id="wfm-tagger-ollama-settings" style="display:none">
<div class="wfm-form-row wfm-tagger-form-row">
<label class="wfm-tagger-label" id="wfm-tagger-ollama-url-label"></label>
<input type="text" id="wfm-tagger-ollama-url" class="wfm-search-input" value="http://127.0.0.1:11434" style="flex:1;">
</div>
<div class="wfm-form-row wfm-tagger-form-row">
<label class="wfm-tagger-label" id="wfm-tagger-ollama-model-label"></label>
<select id="wfm-tagger-ollama-model" class="wfm-select wfm-tagger-select"></select>
<button id="wfm-tagger-ollama-refresh-btn" class="wfm-btn wfm-btn-sm" title="Refresh models">↻</button>
<span id="wfm-tagger-ollama-backend-value" style="flex:1;color:var(--wfm-text-secondary);font-size:12px;"></span>
<button id="wfm-tagger-ollama-settings-btn" class="wfm-btn wfm-btn-sm" title="Settings">&#9881;</button>
</div>
<div class="wfm-form-row wfm-tagger-form-row" style="align-items:flex-start">
<label class="wfm-tagger-label" id="wfm-tagger-ollama-prompt-label" style="padding-top:4px;"></label>
@@ -2975,18 +2968,13 @@
<div class="wfm-tagger-section-header">
<label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:600;">
<input type="checkbox" id="wfm-tagger-batch-ollama-enable">
Ollama VLM
<span id="wfm-tagger-batch-ollama-header-label">VLM Tagging</span>
</label>
</div>
<div id="wfm-tagger-batch-ollama-settings">
<div class="wfm-form-row wfm-tagger-form-row">
<label class="wfm-tagger-label" id="wfm-tagger-batch-url-label"></label>
<input type="text" id="wfm-tagger-batch-ollama-url" class="wfm-search-input" value="http://127.0.0.1:11434" style="flex:1;">
</div>
<div class="wfm-form-row wfm-tagger-form-row">
<label class="wfm-tagger-label" id="wfm-tagger-batch-model-label"></label>
<select id="wfm-tagger-batch-ollama-model" class="wfm-select wfm-tagger-select"></select>
<button id="wfm-tagger-batch-ollama-refresh-btn" class="wfm-btn wfm-btn-sm">↻</button>
<span id="wfm-tagger-batch-backend-value" style="flex:1;color:var(--wfm-text-secondary);font-size:12px;"></span>
<button id="wfm-tagger-batch-ollama-settings-btn" class="wfm-btn wfm-btn-sm" title="Settings">&#9881;</button>
</div>
<div class="wfm-form-row wfm-tagger-form-row" style="align-items:flex-start">
<label class="wfm-tagger-label" id="wfm-tagger-batch-prompt-label" style="padding-top:4px;"></label>
@@ -3214,6 +3202,7 @@
</div>
<div class="wfm-ai-settings-row">
<button id="wfm-ai-test-btn" class="wfm-btn">Test connection</button>
<button id="wfm-ai-unload-btn" class="wfm-btn">Unload Model</button>
<span id="wfm-ai-test-result" class="wfm-ai-test-result"></span>
</div>
</div>