Compare commits

...
5 Commits
Author SHA1 Message Date
ketle-manandClaude Sonnet 5 1155cf1233 release: v0.5.7 — Video Planタブの設定項目レイアウト刷新(MiniMax H3 Turbo/LTX-2.5 Prompt Enhance/Wan2.2 Turbo対応) + フルバックアップのドキュメント修正
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-31 22:00:36 +09:00
ketle-manandClaude Sonnet 5 5aef634115 fix(tagger): WD Tagger系ONNXモデルの画像前処理をWD Tagger標準に修正
wd-swinv2-tagger-v3等で画像内容と一致しない不自然なタグが出力される問題を修正(Issue #1)。
単純リサイズ+RGBのまま0.0-1.0正規化だった前処理を、WD Tagger系標準の
アスペクト比維持パディング+RGB→BGR+0-255のfloat32のまま、に変更した。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-31 16:54:27 +09:00
ketle-manandClaude Sonnet 5 b09cd2ef90 release: v0.5.5 — Videoタブ全面刷新(Plan/Asset/Editバッチ生成 + Projectサブタブ + プレビュー2ペイン化) + Video Assets/Video Temp運用整理 + Galleryメタデータ消失バグ根本修正
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-31 15:30:28 +09:00
ketle-manandClaude Sonnet 5 426f27c05a Video: __VideoAssets__グループがGallery再起動後に消えるバグを修正
__VideoAssets__はバッチ実行側からensure_groupを呼ぶコードが無く、一度削除されると
add_to_groupが個別画像への書き込みのみ行いレジストリを再登録しないため二度と一覧・
詳細パネルに出てこなくなっていた。ensureFeederGroup()と同型のensureVideoGroup()を
新設し、Video AssetタブのInitで確実に再登録するよう修正。詳細はDEVLOG.md参照。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-31 00:30:22 +09:00
ketle-manandClaude Sonnet 5 336e37724f Video: Plan/Asset/Editタブによるバッチ動画生成機能を追加
タイムラインブロック単位でFirst/Last画像・プロンプトを設定しバッチ生成するPlanタブ、
Galleryのグループ機能を再利用したAssetタブ(__VideoAssets__/__vtemp__)を新設。
調査過程でGalleryのジャンクションフォルダ環境でのパス不一致バグ、グループフィルタの
非再帰スキャンバグ、convertUiToApi()のCOMBO無警告フォールバックによるチェイン画像
すり替えバグの3件も修正。詳細はDEVLOG.md参照。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 22:15:01 +09:00
28 changed files with 3096 additions and 796 deletions
+3
View File
@@ -2,6 +2,9 @@
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.7** — 設定エクスポート/フルバックアップのドキュメント修正: v0.5.5のVideo Plan機能追加分の言及漏れ
- **v0.5.6** — バグ修正: WD Taggerで不正確なタグが生成される問題を修正(GitHub Issue #1)
- **v0.5.5** — Videoタブ全面刷新: Plan/Asset/Editバッチ生成 + Projectサブタブ + プレビュー2ペイン化 + Video Assets/Video Temp運用整理 + Galleryメタデータ消失バグ根本修正
- **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統一
+82
View File
@@ -2,6 +2,88 @@
---
## v0.5.7
### 設定エクスポート/フルバックアップのドキュメント修正: v0.5.5のVideo Plan機能追加分の言及漏れ
「Videoプランの追加で設定のエクスポート、バックアップ機能の更新が必要では」との確認依頼を受けて調査。v0.5.5で追加された`video_plan/`ディレクトリ(Plan JSON+インデックスPNG、`lab_plan/`と同構造)が、フルバックアップZIP機能の説明文言から漏れていないか確認した。実装(`_build_full_backup_zip`)自体は`DATA_DIR`配下のトップレベルエントリを汎用的に走査する設計(除外リスト`_FULL_BACKUP_EXCLUDE_NAMES`は`gmic_temp`/`thumb_cache`/`wildcard`の3つのみ)のため、`video_plan/`は既存コードの変更なしに自動的にバックアップ対象へ含まれていた——つまり機能的な欠陥は無かった。一方、ユーザー向け説明文(`fullBackupHint`/`helpSettings15`のi18n.js3言語、README.mdのFull Backup説明、`settings_routes.py`のコード内コメント)は「AI Skills、Lab Plans、Style presets」という列挙のままVideo Plan機能追加時に更新されておらず、実際にバックアップされるデータの説明として不正確になっていた。該当6箇所+READMEを「Video Plans」を含む形に修正。
### Video Plan (Planサブタブ) 中央パネルの設定項目レイアウト刷新 + MiniMax H3 Turbo/LTX-2.5 Prompt Enhance/Wan2.2 Turbo対応
「Duration・Noise SeedをMultipleの右隣に移動し、その下に新しい行でWidth/Height/MiniMaxのturbo_mode/strength/steps・LTX-2.5のprompt_enhance・Wan2.2のenable_turbo_mode(MiniMaxのturbo_modeと兼用)を追加したい」との要望。着手前にComfyUI_5環境の直近保存ワークフロー(`minimax_turbo.json`、LTX-2.5の`ltx_25_test`/`test2`/`test3`、Wan2.2の`wan22_test`/`test2`/`test3_i`)を実際にPythonでパースしてサブグラフの公開入力を調査し、対応可否を事前検証してから実装した。
調査で判明した構造: MiniMax H3は`turbo_mode`(BOOLEAN)/`turbo_model_strength`(FLOAT、LoRA強度)/`turbo_steps`(INT)をサブグラフの直接ウィジェットとして公開しており、これらがユーザーの言う「strength」「steps」に対応する。LTX-2.5は3バリアントとも`prompt_enhance`(BOOLEAN)を公開。Wan2.2は`enable_turbo_mode`(BOOLEAN)を公開しており、MiniMaxの`turbo_mode`と意味的に同一のためUI上は1つの「Turbo Mode」欄として兼用する設計にした。width/heightはMiniMax・LTX-2.5のText/Image版ではResolutionSelector経由(サブグラフ入力がリンク接続されている)だが、LTX-2.5のFirst & Last Frame版とWan2.2は全バリアントでResolutionSelectorを持たずサブグラフの直接ウィジェット値のまま——既存コードのコメント通りの構造を実データで確認できた。noise_seedは全ファミリーで`name="noise_seed"`に統一されている(LTX-2.5のText to Videoのみ`label="seed"`を持つため、ラベルではなくname直接一致で検索するヘルパーを新設)が、**Wan2.2のText to Videoだけサブグラフの公開入力に`noise_seed`が存在しない**(Image to Videoにはある)という非対称性を発見した。
実装は`video-workflow.js`の`locateVideoModelNodes()`を拡張し、上記7項目(width/height直接指定用インデックス、noise_seed、turbo_mode、turbo_strength、turbo_steps、prompt_enhance)のインデックスを検出して返すようにした(対応する入力が無ければ-1を返し、呼び出し側で無効化・非ハイライトの判断に使う)。既存のAspect Ratio/Megapixels/Multipleと全く同じ「ワークフローが対応する場合のみ入力可能+ラベルハイライト」の仕組みで新規7項目も統一し、新しい選択UIを作らず既存の`wfm-model-label-active`パターンを再利用した。noise_seedについては値の書き込みロジックをあえて追加しなかった——`comfyUI.generate()`がAPI変換後のワークフロー全体から`noise_seed`/`seed`キーを持つ全ノードを一括で上書きする既存の`applySeedToWorkflow()`が必ず後から実行されるため、`applyBlockToWorkflow()`側で書いても意味がなく、Plan全体のシード管理は引き続きそちらに一任する設計とした。
UI面ではDuration(元々ブロックごとの独立値)とNoise Seed(Plan全体で共有)を、機能的な性質は変えずにDOM位置だけtopbarのbasesettings行へ移動した。Durationはブロックエディタの`innerHTML`再生成に巻き込まれない固定要素にする必要があったため、change時のリスナー登録をブロック切替のたびに再アタッチする方式から、初期化時に一度だけ登録し値の同期のみブロック切替時に行う方式(`_initDurationControl()`新設)に変更した。新規7項目は`_plan.base_settings`に追加しPlan保存/読込(`_buildPlanData`/`_applyPlanData`)にも対応させた——Aspect Ratio等と同様Plan全体で共有する値とし、ブロックごとには持たせない設計とした。
実機検証はComfyUI_5(ユーザーが起動中のポート8189、8188に誤って重複起動してしまった分は作業後に停止)上でKaptureブラウザ操作により実施。MiniMax H3ワークフローで`Turbo Mode`/`Strength`/`Steps`が正しくハイライト・値反映され`Width`/`Height`は無効化されること、LTX-2.5 First & Last Frame版で`Width`/`Height`が有効化・ハイライトされること、Wan2.2 Text to Videoで`Noise Seed`のみ非ハイライト(disabled)になり`Turbo Mode`はハイライトされること、ブロック追加後にDurationがブロックごとに独立して保持される(1つ目=5秒のまま、2つ目=7秒に変更後も1つ目に戻ると5秒を維持)ことを、DOM要素のクラス・disabled状態を直接読み取って確認した。
ヘルプ文言は`helpVideo1`/`helpVideo2`/`helpVideo10`をindex.html・i18n.js(英日中3言語)・app.jsの`helpIdMap`の3点セットで更新——`helpIdMap`自体は既存のキーマッピングをそのまま流用でき変更不要だったが、`applyI18nToHtml`が起動時にi18n.jsの内容でDOM要素を上書きする一方でindex.html側の静的テキストが更新漏れになっていたため、ソース整合性のため合わせて修正した。README.mdのVideo Tabセクション(Plan/Edit subtabsの基本設定説明、Field highlight colorの対象フィールド一覧)も新規7項目を反映して更新した。
**検証**: `node --check`で変更した全JSファイルの構文確認。実機(ComfyUI_5、ポート8189)でMiniMax H3/LTX-2.5(First & Last Frame版)/Wan2.2(Text to Video版)の3ワークフローをKapture経由で実際にロードし、ハイライト・disabled状態・値反映・ブロックごとのDuration独立性をDOM評価で確認。開発元gitリポジトリと実行時`custom_nodes`フォルダは別実体のため([[project_dev_deploy_sync]]参照)、変更ファイル(`video-workflow.js`/`video-plan-tab.js`/`i18n.js`/`index.html`/`video-tab.css`)を都度両フォルダへ同期し`diff`で完全一致を確認。
**How to apply**: UIに新しい項目を追加する際、「ワークフローによって対応する場合のみ有効化・ハイライトする」という既存パターンが確立している画面では、新規に選択UIやトグルを作らず既存の仕組み(本プロジェクトでは`wfm-model-label-active`クラス+ラベルID登録)にそのまま乗せるのが一貫性を保ちやすい([[feedback_reuse_existing_ui_before_building_new]])。同系統に見えるモデルファミリー間でも、実際のワークフローJSONをパースして公開入力の有無を確認しないと「あるはず」の項目が無い非対称性(今回のWan2.2 Text to VideoのNoise Seed欠如)を見落とす——README/ヘルプ文言に「ワークフローXにはYが無い」という例外を書く前に、必ず実データで裏取りする。UI上は1つのフィールドとして統一表示しつつ、内部的には複数のワークフローファミリーそれぞれの異なる入力名(`turbo_mode`と`enable_turbo_mode`)にマッピングする「兼用フィールド」パターンは、意味が同じであることをコメントで明記した上でフォールバック演算子(`||`)で検出すればよく、UI側の分岐は不要になる。生成時に上流のAPI変換・送信処理(今回の`applySeedToWorkflow`)が特定のキーを一括で上書きする既存の仕組みがある場合、新規追加するフィールドの値が同じキーに書き込まれるなら、二重に値を設定するコードを書かず上流の処理に委ねる方が正確(後から上書きされる無駄なコードパスを残さない)。
関連: [[project_video_plan_asset_tab]], [[project_dev_deploy_sync]], [[feedback_reuse_existing_ui_before_building_new]]
---
## v0.5.6
### バグ修正: WD Taggerで不正確なタグが生成される問題を修正(GitHub Issue #1)
ユーザー(censor-ed氏)からのIssue報告: `wd-swinv2-tagger-v3`でタグ付けすると画像内容と一致しない不自然なタグが出力される。調査依頼者自身が原因を特定しており、`tagger_service.py`のONNX推論前処理がWD Tagger系モデルの学習時前処理と異なっていた(単純リサイズ+RGBのまま0.0〜1.0正規化)のに対し、WD Tagger系標準の前処理は「透過は白背景で合成→アスペクト比を維持したまま白背景で正方形にパディング→BICUBICリサイズ→RGB→BGR→0〜255のfloat32のまま(正規化なし)」であるとの具体的な指摘だった。`_predict_onnx()`をこの標準前処理に修正(本プラグインがサポートするONNXタガーはREADME記載の通りWD Tagger系のみのためパス全体を統一。DeepDanbooru用`_predict_dd()`は元々正しい前処理のため変更なし)。実機で`wd-eva02-large-tagger-v3`を使い、くまの着ぐるみパペットを持つ緑髪キャラクターのアニメ調画像でタグ付けを検証したところ、修正前は前処理が公式実装と異なる状態だったのに対し、修正後は`green_hair, bear_ears, bear_costume, paw_gloves, hoodie, animal_hood, animal_costume`など画像内容と高精度に一致する自然なタグが生成されることを確認した。
---
## v0.5.5
### Videoタブ全面刷新: Plan/Asset/Editバッチ生成 + Projectサブタブ + プレビュー2ペイン化 + Video Assets/Video Temp運用整理 + Galleryメタデータ消失バグ根本修正
「Videoタブにバッチ動画生成機能を追加したい。既存の生成UIタブのLab機能を動画生成用に整えたイメージ」との要望を起点に着手。従来のVideoタブ(単発生成フォーム)をPlan/Asset/Editの3タブ構成に再設計し、複数セッションにわたるユーザー実機確認・レイアウト調整・追加要望への対応、および調査の過程で発見した重大バグの根本修正までを1リリースにまとめた。
**1. Planタブ: タイムラインブロックによるバッチ動画生成**: 「基本設定→タイムラインをブロック分割→各ブロックにFirst/Last画像とプロンプトを設定→実行で順次バッチ生成」という要望を実装。LabタブがCheckpoint/LoRA/VAE/Prompt/Ksamplerそれぞれ独立したキーフレーム配列を持つ設計なのに対し、Video Planは「各ブロックが完結した1本の生成ジョブ」という単位でデータを持つ点が本質的に異なるため、Lab方式(`_buildWorkflowForIteration`によるキーフレーム解決)ではなく新規のデータモデル(`{id, color, duration, prompt, first_image_mode, first_image_filename, last_image_filename}`の配列)を設計した。First ImageはNone/画像を指定/前ブロックの最終フレームを使用の3択(`first_image_mode`)を持ち、chain_previous選択時は前ブロックに明示的なLast Imageがあればそれを直接使い(フレーム抽出不要)、無ければ前ブロックの生成動画から実際の最終フレームを`extractLastFrameBlob()`(Labのchain image機能で実績のある関数を再利用)でクライアント側抽出してアップロードする、という優先順位をユーザーと合意の上で実装した。Run/Pause/Cancelと進捗バーはLabタブの`_runLabBatch`と同じPromiseベースの一時停止機構を踏襲。ワークフロー操作(モデルファミリー自動判定・ノードへの値注入)はVideoタブの既存ロジックから`video-workflow.js`として抽出し、Plan/旧単発フォームの双方から呼べる純粋関数群にした。
**2. Plan永続化**: Labの`ws_labplan_`プレフィックス+PNGコンタクトシートへのiTXt埋め込み方式をそのまま踏襲し、`ws_videoplan_`プレフィックスでPlan JSON+インデックス画像を保存する仕組みを新規実装(`video_plan_service.py`はLabのサービスを複製、共通化はしない方針)。ブロックが1個のPlan=旧来の単発生成と等価になるよう設計し、「Load in Video」ボタンは常にブロック1個の新規Planを生成するようにした。
**3. Assetタブ: Galleryのグループ機能を再利用した素材管理**: 独自のフォルダブラウザを新規実装する代わりに、`feeder-tab.js`の「Galleryモード」(Gallery既存バックエンドをグループスコープで叩く軽量グリッド)と同じパターンを踏襲。当初は生成された動画を全て予約グループ`__VideoAssets__`へ自動追加する設計だったが、ユーザーからのフィードバックで用途を再定義:`__VideoAssets__`はユーザーがGalleryで手動キュレーションする「素材」グループとし、バッチ実行の自動追加先は新設の予約グループ`__vtemp__`(Planを保存していない生成物の一時置き場)に変更。Plan保存済みの場合は`VideoPlan:<name>`サブグループへ、未保存の場合は`__vtemp__`へ、という条件分岐にした。Assetタブのグループ選択には「All Video Assets」(`__VideoAssets__`+`__vtemp__`の合算、バックエンドに単一グループでの合算フィルタが無いため2回フェッチしてマージ)に加え、両グループの個別選択・Plan別サブグループ選択も追加。Galleryタブ側には`__vtemp__`用の🔒予約表示(`__Feeder__`と同様リネーム・削除不可)と、詳細パネルに`__vtemp__`をワンクリックでクリアする「VtC」ボタン(既存の`__Feeder__`用「FC」ボタンと同じ`groups/{name}/clear`APIを利用)を追加した。
**4. UIレイアウトの複数回反復**: 初回実装は左サイドバー(380px固定幅)にPlan/Asset/Editの3サブタブを縦積みする構成にしたが、実機確認で「Timeline+First/Last画像+Promptを横並びにしたい」という要望とレイアウト崩れの報告を受け、Planタブの中身を中央の広いプレビュー欄の下部に移動(ブロックエディタをFirst Image/Last Image/Prompt/Duration+colorスウォッチの横並び4カラムに再設計、実行系(Run/Pause/Cancel/進捗/Seed)とプラン管理系(Note/Save/Load)を「Run」「Plan」の2タブに整理)。続けて「これをPlanタブ化してEditタブを追加、左ペインのPlan/Editは削除」との指示で、中央パネルにPlan/Edit専用のタブナビを新設し、左サイドバーにはAssetのみを残した。この際、両タブナビが同じ`.wfm-video-subtab-btn`/`.wfm-video-subtab-panel`クラスを共有する実装だったため「Assetを選ぶと中央のPlan/Editも連動して消える」という不具合が発生 — 中央タブの切替処理を`.wfm-video-center-panel`スコープに限定したquerySelectorAllに変更し、サイドバーのAsset単独ボタンは独立したshow/hideトグルとして分離することで解消した。中央・右ペイン(プレビュー、Frame抽出/GIF変換/Video Source)はサブタブ切替と独立した常時表示パネルとして、レイアウト変更を通じて無改修のまま維持している。
**5. バグ修正: Galleryのグループ追加がジャンクションフォルダ環境で一覧に反映されない**: 「生成完了後に`__vtemp__`グループには入らない。Galleryで手動追加したコンテンツは表示される」との報告を受けた調査で発見。ユーザー環境の`ComfyUI_5\output`はStabilityMatrixの共有出力フォルダ機能によるWindowsジャンクション(実体は`StabilityMatrix\Images\Text2Img`)だった。`save_image_meta`(タグ/メモ保存)には既に「`get_image_metadata()`側はresolve()済みパスをキーにするため保存側も統一する」という同種バグの修正コメントがあったが、`add_to_group`/`remove_from_group`/`toggle_favorite`/`bulk_set_favorite`の4箇所には同じ修正が未適用のまま残っていた。そのためグループ追加自体はサーバー上で成功する(ジャンクション形式の未解決パスをキーに保存)が、一覧取得(`list_images`)はフォルダを`.resolve()`した実パスでスキャンするためキーが一致せず、「追加はされるが一覧に出てこない」というサイレント不具合になっていた。4箇所とも`save_image_meta`と同じresolve()統一パターンに修正。Video機能に限らずGallery全体(お気に入り・グループ機能)に影響していた既存バグで、今回の調査で偶然発見・修正できた。
**6. バグ修正: Galleryのグループフィルタがサブフォルダ内のファイルを見つけられない**: 5の修正後も「rootで`__VideoAssets__`フィルタ時は画像のみ、動画は表示されない」との報告。動画は`video/`サブフォルダに保存されるが、Galleryタブの`loadImages()`はグループフィルタの有無に関わらず常に非再帰スキャン(現在のフォルダ直下のみ)だったため、グループメンバーがサブフォルダにあると机上から漏れていた。グループフィルタが有効な時のみ`recursive=true`を付与するよう修正。
**7. バグ修正: チェイン画像が無関係な既存ファイルにすり替わる**: 「2ブロックのPlanで2つ目のFirst Imageを前ブロックの最終フレームに設定したが、生成された2つ目の動画は無関係な画像が使われている」との報告。調査の結果、`convertUiToApi()`(UI形式→API形式変換の共通処理)が持つ「COMBO項目の値がキャッシュ済み`/object_info`の選択肢に無い場合、無警告で選択肢の先頭に差し替える」というフォールバック機構(チェックポイント名の互換性対応が主目的で元々存在)が原因と判明。LoadImageノードの「image」もCOMBO型のため対象になり、バッチ実行中にアップロードした抽出フレーム画像のファイル名はその時点でキャッシュ済みの`/object_info`にまだ存在せず、無関係な既存ファイル(選択肢の先頭)に差し替えられていた。LabタブのchainImage機能がこの問題に遭遇しないのは、Labが既にAPI形式のワークフローを直接操作し`convertUiToApi()`を経由しないため。`comfyui-workflow.js`に`invalidateObjectInfoCache()`を新設し、チェイン用フレーム・ユーザーの手動画像アップロードの直後に呼んで次回変換時に最新の`/object_info`を再取得させるよう修正した。
**8. バグ修正: `__VideoAssets__`グループが再起動後に一覧・詳細パネルから消える**: 「再起動してギャラリーを確認したがグループに`__VideoAssets__`、`__vtemp__`が表示されなくなった」との報告。`gallery_metadata.json`を実データで直接確認したところ、`__vtemp__`はレジストリ・10件のメンバーシップとも正常だった一方、`__VideoAssets__`はグループレジストリ配列からも全画像のメンバーシップからも完全に消えていた(`delete_group()`はレジストリと全画像の`groups`配列を同時に消す実装で、症状と完全に一致)。原因は`__vtemp__`/`VideoPlan:<name>`と異なり、`__VideoAssets__`はバッチ実行側から`ensure_group`を呼ぶコードが一切無い設計だったこと — 3番で予約グループ保護(🔒表示・削除ボタン無効化)を追加する**前**の時点でManage Groupsから削除操作が可能だったため、その時点で削除され、以後`add_to_group`は個別画像への書き込みは成功してもレジストリを再登録しないため二度と一覧に出てこなくなっていた。`gallery-tab.js`に`ensureFeederGroup()`と同型の`ensureVideoGroup()`を新設し、VideoタブのAssetタブ初期化のたびに`__VideoAssets__`を確実に再登録するよう修正。削除時に失われた過去のメンバーシップ自体(開発中のテスト動画)はバックアップが無く復元不可能である旨をユーザーに報告した(このensure漏れが後に13番の伏線になる — `__VideoAssets__`側だけ直し`__vtemp__`側のensureが漏れていた)。
**9. Assetタブに保存済みPlan一覧を表示する「Project」サブタブを追加**: 「AssetタブにVideo Planを表示したい」との要望を起点に着手。何を指すか確認したところ「右ペインにプロジェクトタブを追加し、保存済み一覧、各動画のplan名表示としたい」との回答。調査の結果、バックエンドには`GET /api/wfm/video/plans`一覧APIと`/wfm_data/video_plan/{name}.png`サムネイル配信が2番のPlan永続化実装時から既に存在していたが、フロントエンドからは一度も呼ばれておらず丸ごと未使用のまま埋まっていたことが判明した。新規`video-project-tab.js`で保存済みPlan一覧(サムネイル・名前・ブロック数・更新日時)表示、クリックでのPlanエディタ読み込み(`video-plan-tab.js`に`openSavedVideoPlan()`をexport)、削除機能を実装し、Assetカードには生成元のPlan名をバッジ表示する機能(`img.groups`から`VideoPlan:<name>`グループを逆引き)も合わせて追加した。当初の指示通り右ペイン(Frame/GIFタブの隣)に実装したが、直後のフィードバックで「左ペインに変更したい」との指示を受け、左サイドバー(Assetタブの隣)へ丸ごと再配置した。この移動に伴い、左サイドバーのトグルロジックを「Assetボタン単体のshow/hide」から「クリックした方を開き他方を閉じる、同じボタンの再クリックで両方とも折りたたむ」という排他的トグルに拡張した。
**10. 中央下部のワークフロー名表示行を1行に統合**: 「Open Workflowボタン行を上段の現在読み込んでいるワークフロー名行と1行にしたい」との要望。`wfm-video-wf-name`(現在ロード中のワークフロー名)と`wfm-video-plan-workflow-row`(Planに記録されたワークフロー名+Open Workflowボタン)が縦に2行表示されていたのを、`.wfm-video-wf-row`という横並びflexコンテナでまとめ1行に統合した。
**11. ワークフロー設定可能項目ハイライト表示の復活**: 「以前の単発生成フォーム時の設定項目のハイライト表示を行いたい」との要望を受けて調査したところ、v0.5.4で一度実装されていた機能(`wfm-model-label-active`クラス、GenerateUI Modelタブと共通の設定色)が、4番のPlan/Asset/Edit再設計で単発フォームのコードごと失われ、ヘルプ文言だけが取り残されていたことが判明した。Planタブのブロックエディタ向けに`_updateFieldHighlights()`を再実装:Prompt/Duration/First Image/Last Image/Aspect Ratio/Megapixels/Multipleの各ラベルにIDを付与し、読み込んだワークフローが実際にそのフィールドをサポートしている場合のみハイライトする(Wan2.2のようにResolutionSelectorが無いワークフローではAspect Ratio/Megapixels/Multipleは非ハイライトのまま)。ワークフローロード時・Open Workflowボタン使用時・ブロック切り替え時(`_renderBlockEditor()`はブロック選択のたびにDOMを作り直すため都度再適用が必要)のいずれでも正しく再適用されるようにし、ハイライト色を注入するCSSセレクタ(`settings-tab.js`の`applyModelTabActiveColor()`)も旧レイアウトの`.wfm-video-form-panel`から新レイアウトの`.wfm-video-plan-content`に更新した(4番のレイアウト変更で参照先の無いセレクタになっていた)。この過程で、ヘルプ本文(`helpVideo8`)がHTML側とi18n.js側で別内容になっている既存の不整合(HTML側は旧ハイライト説明、i18n.js側はチェイン機能の説明で後者が実際に表示される)を発見し、ハイライト説明を新規`helpVideo10`として追加し直した。
**12. Video Assets/Video Tempグループの命名統一・自動登録の運用整理**: 「__vtempグループが消えてしまっている」という報告と、ユーザー自身による修正方針の提示(表示名をグループ名で統一、VideoPlan:自動登録を廃止し常にVideo Tempへ、VtCボタン名を「Clear __Video Temp__」に変更)を受けて実施。3番/8番で導入した`__VideoAssets__`/`__vtemp__`を`__Video Assets__`/`__Video Temp__`に改名し、Assetタブの表示名もグループ名からそのまま導出する形に統一(「Temporary (unsaved runs)」という独自表示名は廃止)。3番の「Plan保存済みなら`VideoPlan:<name>`サブグループへ」という自動振り分けは廃止し、Plan保存の有無に関わらず常に`__Video Temp__`へ登録するよう変更 — `__Video Assets__`への整理は完全にユーザー任意のタイミングに委ねる設計に転換した。対応してAssetタブの「VideoPlan:」動的取得・フィルタ表示ロジックと、9番で追加したAssetカードへのPlan名バッジ表示も、対応するグループ自体が無くなったため削除した。バックエンド予約グループリスト(`py/routes/gallery_routes.py`の`_RESERVED_GROUPS`)も新グループ名に追従させている。既存の`VideoPlan:`グループ自体はユーザー側で削除する前提で進めた。
**13. 重大バグ修正: `gallery_metadata.json`の非アトミック書き込みによるデータ消失(根本原因)**: 「再起動するとグループに登録した内容が消えます」との報告を受けた調査。まず8番の`ensureVideoGroup()`が実は`__VideoAssets__`(現`__Video Assets__`)しかensureしておらず`__vtemp__`(現`__Video Temp__`)はensureしていなかったという見落としを修正したが、実データ(`user/default/Workflow-Studio/gallery_metadata.json`、画像9,470件)を直接調べたところ、より深刻な問題が見つかった。`GalleryMetadataStore._save_to_disk()`が`open(path, "w")`による直接上書きの非アトミック書き込みで、バックグラウンドインデックス処理(`_bg_index_folder`、未キャッシュ画像10枚ごとに保存)が大量画像フォルダに対して極めて高頻度にこのファイルへ書き込み続けていた(実測でファイルサイズが0.5秒間隔で数百KB単位で変動し、外部プロセスから読むとタイミングによってJSONパースが失敗する状態だった)。この書き込みの最中にComfyUIプロセスが終了すると、ファイルが不完全なJSONのまま残り、次回起動時の`_load()`がパースに失敗して警告ログを出すだけで中身を空の`{"images": {}, "groups": []}`にリセットしてしまう — 以降1回でも保存が走ると、それまでの全グループ登録・タグ・メモが跡形もなく上書きされて消える、という構造だった。実際に確認したところ、グループの登録リスト自体(`__Feeder__`/`__Video Assets__`/`__Video Temp__`等)は残っていたが、動画がどのグループに属しているかという個々のメンバーシップ情報は失われていた。`_save_to_disk()`を一時ファイル書き込み+`Path.replace()`によるアトミックな置き換えに変更し、`_load()`がJSON破損を検出した場合は単に空データにするのではなく`.corrupt`ファイルとしてバックアップしてから起動するよう変更した(今後同様の事態が起きても手動復旧の余地を残す)。単体テスト(アトミック書き込み・破損時バックアップ・復旧後の再保存)で動作確認。今回失われた登録内容自体はバックアップが無く復元不可能である旨をユーザーに報告した。
**14. 中央プレビューの2ペイン化**: 手描きの構成図での要望「動画ソース・ファイルドロップエリアを左端に移動、プレビューを2つにして左はアセットの選択動画/ドロップされた動画のプレビュー兼用、右は生成された動画のプレビュー用」を実装。従来は単一のプレビュー(Video Sourceドロップの表示専用で、Assetタブの選択動画やPlan実行結果を自動表示する仕組み自体がそもそも存在しなかった)だったのを、3カラム構成(左: Video Sourceフォーム、中央: Asset選択/Sourceドロップ兼用プレビュー、右: 生成動画専用プレビュー、いずれも新規実装)に再構成した。`video-tab.js`・`video-asset-tab.js`(Asset選択)・`video-plan-tab.js`(バッチ実行結果)の3ファイルがプレビュー状態を共有する必要があったため、新規`video-preview.js`という共有モジュールに切り出した(video-tab.jsが既に他の2ファイルをimportしているため、逆方向のimportを追加すると循環参照になることを回避するため)。Frame/GIFツールは「直近にアクティブになった方のプレビュー」を対象に動作する設計にした。Asset選択時はGalleryの絶対パスをComfyUIのfilename/subfolder/type形式に変換する手間を避けるため、動画をBlobとしてfetchし「ローカルファイル」として扱うことで、GIF変換の既存アップロードロジックをそのまま流用できるようにした。Assetサイドバーの詳細パネルにあった動画プレビュー(`<video>`要素)は、中央プレビューに統合されたため削除した。
**15. ヘルプの整合性チェック**: リリース前の最終確認としてVideo Tabヘルプ全11項目(Title/Desc/1〜10)をHTML・i18n.js(3言語)・app.jsのhelpIdMapで突き合わせ、11番で発見した`helpVideo8`の不整合以外にも、`helpVideoDesc`(旧「Plan / Asset / Edit」の一括り記述が9番以降のサイドバー分離構造と食い違っていた)と`helpVideo1`/`helpVideo2`/`helpVideo3`(HTML側が旧単発フォーム時代の文言のまま放置され、実際に表示されるi18n.js側の内容と長年食い違っていた)を発見・修正した。README.mdのVideo Tabセクションも同様に、4番のPlan/Asset/Edit再設計自体が一切反映されないまま単発フォーム時代の説明で放置されていたことが判明し、9〜14番までの内容を反映して全面的に書き直した。
**16. `pyproject.toml`のlicense記述をComfy Registry仕様準拠の形式に修正**: リリース準備の一環で、`license = "MIT"`という単純文字列形式が、公式仕様(`license = {file = "LICENSE"}`または`{text = "..."}`のいずれか)に該当しない非推奨形式であり、`comfy env`実行時にcomfy-cliが警告を出していたことを確認した([[project_registry_flagged_versions]]で追跡しているv0.5.0〜v0.5.3の原因不明のFlagged/Pending状態の調査依頼を受けて着手)。合わせて、参照先の`LICENSE`ファイル自体がリポジトリに存在しなかった(README.mdの「MIT License」という一文のみ)ため新規作成し、`license = { file = "LICENSE" }`に修正した。調査の結果、Comfy Registryのセキュリティスキャンは主にAI+静的解析(Ruff)によるPythonコード内の危険なパターン検出(`eval`/`exec`/`subprocess`/`pickle.loads`/カスタムpip wheel等)が対象で、`pyproject.toml`のメタデータ自体(license記述含む)がスキャン対象になるという情報は見つからなかった — つまり今回の修正はComfy Registryの公式仕様に沿った改善ではあるが、Flagged/Banned問題の直接的な解決策である確証はない。一方で、他の開発者(GitHub issue経由)でも同様の原因不明なFlaggedステータスが複数報告されており、pyproject.tomlの記述とは無関係にRegistry側の自動スキャンが誤検知(false positive)を起こしている可能性が高いことが分かった。具体例として、外部バイナリをsubprocessで呼び出す正当なコード(GraphicsMagick連携)が誤検知された報告があり、本プロジェクトにも同種のパターン(`gmic_routes.py`の`subprocess.Popen`+Windows固有の`CREATE_NEW_CONSOLE`フラグ、`wildcard_service.py`の`["cmd", "/c", "mklink", ...]`)が存在するため、これらが誤検知の一因になっている可能性はあるが確証はない(いずれも正当な機能で、変更は行っていない)。
**検証**: 全JS/Pythonファイルを`node --check`/`python -m py_compile`で構文確認、`templates/index.html`はPythonの`html.parser`でタグ対応チェックとJinja2実レンダリングで検証。ジャンクションバグの調査・検証は、ユーザーが起動中のComfyUI_5(ポート8189で稼働)に対し`curl`でAPIを直接叩いて実施 — `os.path.realpath()`で実際にジャンクションであることを確認し、`groups/{name}/images`(生成成功)と`list_images`(グループフィルタで空)の食い違いを再現、修正版デプロイ後の再検証はユーザー自身の実機確認で完了。8番の`__VideoAssets__`消失バグは、実行中サーバーの`gallery_metadata.json`を直接読み込んで原因を特定した(読み取り中にサーバー側の`_save_to_disk()`と競合しJSONDecodeErrorになることがあったため、パース成功するまで数回リトライして実データを確認)。13番の根本原因調査では、同じファイルへの読み取りを連続実行してもファイルサイズと成否が毎回変わることを確認し、実データが継続的に高頻度書き込みされている実態そのものを証拠として特定に用いた。13番の修正自体は`tempfile`を使った独立テストスクリプトで正常保存・再ロード後のデータ保持・破損ファイル検出時のバックアップ・復旧後の再保存を単体検証(ComfyUI起動不要)。開発元gitリポジトリと実行時`custom_nodes`フォルダは別実体のため([[project_dev_deploy_sync]]参照)、変更・新規ファイルを都度両フォルダへ同期しCRLF/LF差異を除いた`diff`で完全一致を確認、Python変更(13番・12番の`gallery_routes.py`予約グループリスト)を含む回では実行時側の`__pycache__`もクリアした。各段階(レイアウト・Projectサブタブ追加・ハイライト復活・グループ運用整理・データ消失バグ・プレビュー2ペイン化・ヘルプ整合性)ともユーザー自身の実機確認・スクリーンショットや手描き構成図の提供を受けて次の修正に進む反復的な進め方で実施した。16番のRegistry仕様調査はWeb検索でComfy公式ドキュメント(`docs.comfy.org/registry/specifications`)とGitHub issue(Comfy-Org/ComfyUI-Manager #2927, #2997)を確認し、`pyproject.toml`の`license = { file = "LICENSE" }`変更後は`toml`パッケージでパース可能なことを確認した。
**How to apply**: 「◯◯機能では動くのに△△機能では動かない」という報告があった場合、両者の実行経路が本当に同じか(今回はLabがAPI形式を直接操作するのに対しVideoはUI形式から`convertUiToApi()`を経由する、という違い)を疑うと真因に早く到達できる。ComfyUIフロントエンドの`convertUiToApi()`のようなCOMBO値検証は「無警告でのフォールバック」を行う設計になっている場合があるため、実行時に動的アップロードした値をCOMBO項目に書き込む機能(画像チェイン等)を追加する際は、そのCOMBOの選択肢キャッシュが最新かどうかを必ず確認する必要がある。StabilityMatrixのような複数ComfyUIインスタンスでモデル/出力フォルダを共有するツールはジャンクション/シンボリックリンクを使うため、`Path.resolve()`をパスキーの一部に使うコードとファイルシステムスキャンで得たパスとの間に「解決する/しない」の不一致が生まれやすい — 同じ画像を指すパス文字列の保存/検索が全経路で一貫した規約(このプロジェクトでは「常にresolve()後の文字列で統一」)に従っているか、新しい書き込み経路を追加するたびに確認する価値がある。複数のタブ切替グループが同じCSSクラス/data属性を共有する実装は、後から片方だけ物理的に別の場所へ移動すると意図せず連動してしまうため、独立させたいグループは早い段階でクラス名やquerySelectorAllのスコープを分けておくとよい。予約グループ(`__Feeder__`のような「削除されると誰も自動で作り直さない」特別なグループ)を新設する際は、保護(削除禁止)の実装と同時に「常に存在することを保証する`ensure`呼び出し」もセットで用意しないと、保護を追加する前の空白期間や手違いで一度消えた場合に二度と復活しない — この2つは別々の対策であり、片方だけでは不十分。実行中サーバーが継続的に書き込んでいるJSONファイルを外部から直接読んで調査する際は、書き込みと衝突して不完全な内容を読んでしまうことがあるため、パースが安定して成功するまでリトライするのが安全。JSON等の設定/メタデータファイルへの永続化処理を新規実装・レビューする際は、単純な`open(path, "w")`による直接上書きになっていないか必ず確認する — 書き込み頻度が低いうちは問題が表面化しなくても、対象データ量が増えて書き込み回数が増えるほど「書き込み中のプロセス終了でファイルが壊れる」リスクが顕在化しやすく、かつ壊れたファイルのロード失敗を「空データにフォールバック」で処理していると、その後の1回の保存で過去の全データが消えるという最悪の組み合わせになる(一時ファイル+`Path.replace()`のアトミック置き換えと、破損検出時のバックアップ退避はセットで対策する)。UI再設計でコードごと削除した機能(今回のハイライト表示)は、対応するヘルプ文言だけが取り残されて「存在しない機能の説明」として残り続けることがあるため、大きめのUI再設計を行った際はヘルプ文言側の棚卸しも忘れずに行う。ユーザー向けドキュメント(README等)は実装が大きく変わった直後に更新を忘れると、次に触るまで長期間ズレたまま放置されやすい — 大規模なUI再設計コミットを作る際は、その場でREADMEの該当セクションも一緒に更新するのが安全(今回はPlan/Asset/Edit再設計そのものが数バージョン分READMEに未反映のまま残っていた)。
関連: [[project_v050_video_tab]], [[project_dev_deploy_sync]]
---
## v0.5.4
### 機能追加: Video/GenerateUIタブのLTX-2.5・Wan2.2対応拡大 + AI Assistant設定のUnsloth対応・独立モーダル化・モデルアンロード機能
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 ketle-man
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+3 -3
View File
@@ -26,7 +26,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- Built-in AI tools (translation and more)
![Workflow Studio](https://img.shields.io/badge/ComfyUI-Custom_Node-blue)
![Version](https://img.shields.io/badge/version-0.5.4-green)
![Version](https://img.shields.io/badge/version-0.5.7-green)
## Features (tab -> feature names)
@@ -75,8 +75,8 @@ Model Browser, Thumbnail / Table views, Table column sort, Search & Filter, User
### 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.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
### Video Tab (v0.5.0 – v0.5.7)
Dedicated video generation UI, independent of GenerateUI, Plan / Edit subtabs, Base settings row, Asset / Project subtabs, Two center previews, First Frame / Last Frame are both optional, Semantic node lookup, not hardcoded IDs, Field highlight color, Load in Video, 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, Model unload, Settings shared, Backend support, URL security, Lemonade's other endpoints (not integrated)
+13 -11
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.4-green)
![Version](https://img.shields.io/badge/version-0.5.7-green)
## Screenshots
@@ -231,7 +231,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- ~~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
- **Full Backup (ZIP)** (v0.5.2) — additionally covers what the JSON bundle can't represent: folder-based data (AI Skills, Lab Plans, Video 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`; the same color and mechanism also drives the Video tab's field highlighting (v0.5.4, see above)
@@ -404,18 +404,20 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
</details>
<details>
<summary><h3>Video Tab (v0.5.0 – v0.5.4)</h3></summary>
<summary><h3>Video Tab (v0.5.0 – v0.5.7)</h3></summary>
- **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 (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
- **Plan / Edit subtabs** (center panel, batch redesign in v0.5.5) — a **plan** is a sequence of timeline blocks, each a fully self-contained generation job with its own Prompt, Duration, and First/Last Image; split the timeline with **+ Split** / **+ Block** / **Delete**, then **Run** to generate every block in order (Pause/Cancel work mid-run) — a plan with a single block behaves exactly like the old one-shot form. First Image can be None, an explicit image, or "use previous block's last frame" (chaining — an explicit Last Image on the previous block always wins over extracting one from its generated output). Save / Save As / Clear a plan (`ws_videoplan_*.json`, with a PNG contact-sheet thumbnail that embeds the full plan data so dropping the image back on works too); Edit is reserved for future video-editing tools
- **Base settings row** (topbar, v0.5.7) — Aspect Ratio / Megapixels / Multiple / Duration (seconds) / Noise Seed on one row — Duration always reflects the currently selected block (each block keeps its own value), the rest are plan-wide — plus a second row of model-specific fields: Width / Height (become directly editable for workflows with no Resolution Selector node, e.g. Wan2.2 and LTX-2.5's First & Last Frame to Video), Turbo Mode / Strength / Steps (MiniMax H3's turbo LoRA — Turbo Mode doubles as Wan2.2's own turbo toggle, sharing one field), and Prompt Enhance (LTX-2.5 only). Every field in both rows is enabled only when the loaded workflow actually has it — see Field highlight color below (one exception: Wan2.2's Text-to-Video variant doesn't expose Noise Seed at all, so it alone leaves that field disabled)
- **Asset / Project subtabs** (sidebar, v0.5.5) — **Asset** browses generated videos through three groups: **Video Assets** (a manually-curated keeper group you organize yourself, on your own schedule), **Video Temp** (every plan run's output lands here automatically regardless of whether the plan itself was saved — a **Clear Video Temp** button in the Gallery tab's detail panel empties it in one click), and **All Video Assets** (the union of both); selecting a video shows it in the center panel's left preview and lets you tag/memo it or jump straight to the full Gallery tab. **Project** lists every saved plan file (thumbnail, block count, last updated) — click one to load it into the Plan editor, or delete it with the × button; either sidebar panel collapses back down when its own tab is clicked again
- **Two center previews** (v0.5.5) — the left preview shows either the video currently selected in the Asset subtab or whatever's dropped/picked in the **Video Source** panel to its left (**Clear** resets it to empty); the right preview always shows the most recently generated clip. The Frame/GIF tools act on whichever preview was touched most recently
- **First Frame / Last Frame are both optional** — leaving First Image 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
- **Field highlight color** — Prompt / Duration / First Image / Last Image / Aspect Ratio / Megapixels / Multiple / Noise Seed / Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance 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 while Width / Height light up instead
- **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) — starts a fresh single-block plan seeded from the workflow's own current values; unsupported workflows show an error toast instead of loading
- **Frame tab** (right panel) — captures the active preview'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** (right panel) — converts the active preview 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** — 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>
+1
View File
@@ -71,6 +71,7 @@ MODEL_METADATA_FILE = DATA_DIR / "model_metadata.json"
WILDCARD_DIR = DATA_DIR / "wildcard"
AI_SKILLS_DIR = DATA_DIR / "ai_skills"
LAB_PLAN_DIR = DATA_DIR / "lab_plan"
VIDEO_PLAN_DIR = DATA_DIR / "video_plan"
# Tagger
TAGGER_DB_FILE = DATA_DIR / "tagger.db"
+1 -1
View File
@@ -405,7 +405,7 @@ async def create_group(request: web.Request) -> web.Response:
return web.json_response({"error": str(e)}, status=500)
_RESERVED_GROUPS = {"__Feeder__"}
_RESERVED_GROUPS = {"__Feeder__", "__Video Assets__", "__Video Temp__"}
async def rename_group(request: web.Request) -> web.Response:
+2 -2
View File
@@ -255,8 +255,8 @@ async def handle_import(request: web.Request) -> web.Response:
# Full-backup (ZIP) export/import: unlike the flat _DATA_FILES JSON bundle above, this
# covers the whole DATA_DIR — directory-shaped data (ai_skills/, lab_plan/, style/) and
# the SQLite tagger.db that the JSON bundle can't represent. Excludes transient/cache
# covers the whole DATA_DIR — directory-shaped data (ai_skills/, lab_plan/, video_plan/,
# style/) and the SQLite tagger.db that the JSON bundle can't represent. Excludes transient/cache
# dirs, and wildcard/ specifically because it's typically a symlink into a *different*
# custom_node's folder (comfyui-impact-pack) rather than this plugin's own data.
_FULL_BACKUP_EXCLUDE_NAMES = {"gmic_temp", "thumb_cache", "wildcard"}
+75 -1
View File
@@ -1,21 +1,31 @@
"""Video tab utility API routes: last-frame capture, animated GIF conversion."""
"""Video tab API routes: last-frame capture, animated GIF conversion, and
Plan (batch timeline) file management."""
import asyncio
import logging
from aiohttp import web
from ..config import VIDEO_PLAN_DIR
from ..services.video_service import VideoService
from ..services.video_plan_service import VideoPlanService
logger = logging.getLogger(__name__)
_service = VideoService()
_plan_service = VideoPlanService(VIDEO_PLAN_DIR)
def setup_routes(app: web.Application):
app.router.add_post("/api/wfm/video/frame/save-to-output", handle_save_frame)
app.router.add_post("/api/wfm/video/to-gif", handle_to_gif)
app.router.add_get("/api/wfm/video/plans", handle_list_plans)
app.router.add_get("/api/wfm/video/plans/content", handle_get_plan_content)
app.router.add_post("/api/wfm/video/plans/save", handle_save_plan)
app.router.add_post("/api/wfm/video/plans/delete", handle_delete_plan)
app.router.add_post("/api/wfm/video/index-image/save-to-output", handle_save_index_to_output)
async def handle_save_frame(request: web.Request) -> web.Response:
try:
@@ -57,3 +67,67 @@ async def handle_to_gif(request: web.Request) -> web.Response:
except Exception as e:
logger.error("Error converting video to GIF: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_list_plans(request: web.Request) -> web.Response:
try:
result = await asyncio.to_thread(_plan_service.list_plans)
return web.json_response(result)
except Exception as e:
logger.error("Error listing video plans: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_get_plan_content(request: web.Request) -> web.Response:
filename = request.rel_url.query.get("filename", "")
try:
data = await asyncio.to_thread(_plan_service.get_plan, filename)
return web.json_response({"data": data})
except FileNotFoundError:
return web.json_response({"error": "not found"}, status=404)
except ValueError as e:
return web.json_response({"error": str(e)}, status=400)
except Exception as e:
logger.error("Error getting video plan content: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_save_plan(request: web.Request) -> web.Response:
try:
body = await request.json()
filename = body.get("filename", "")
data = body.get("data", {})
index_image_base64 = body.get("index_image_base64")
result = await asyncio.to_thread(_plan_service.save_plan, filename, data, index_image_base64)
return web.json_response({"status": "ok", **result})
except ValueError as e:
return web.json_response({"error": str(e)}, status=400)
except Exception as e:
logger.error("Error saving video plan: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_delete_plan(request: web.Request) -> web.Response:
try:
body = await request.json()
filename = body.get("filename", "")
await asyncio.to_thread(_plan_service.delete_plan, filename)
return web.json_response({"status": "ok"})
except ValueError as e:
return web.json_response({"error": str(e)}, status=400)
except Exception as e:
logger.error("Error deleting video plan: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def handle_save_index_to_output(request: web.Request) -> web.Response:
try:
body = await request.json()
image_base64 = body.get("image_base64", "")
if not image_base64:
return web.json_response({"error": "image_base64 required"}, status=400)
result = await asyncio.to_thread(_plan_service.save_index_image_to_output, image_base64)
return web.json_response({"status": "ok", **result})
except Exception as e:
logger.error("Error saving video index image to output: %s", e)
return web.json_response({"error": str(e)}, status=500)
+24 -2
View File
@@ -53,13 +53,35 @@ class GalleryMetadataStore:
}
except Exception as e:
logger.warning("GalleryMetadataStore: load error: %s", e)
# 破損ファイルをリネームしてバックアップしておく。ここでリネームせずに
# 空の self._data のまま次の save() が走ると、破損直前までの全メタデータ
# (タグ/メモ/グループ登録)が跡形もなく上書きされ、二度と復元できなくなる
# (実際に発生した不具合: _save_to_disk が非アトミック書き込みだったため、
# 大量画像フォルダのBGインデックス処理中の頻繁な保存とComfyUIの終了タイミング
# が重なるとファイルが不完全な状態のまま残ることがあった — _save_to_disk側は
# os.replace()によるアトミック書き込みに修正済みだが、過去に壊れたファイルや
# 他要因による破損に備えてここでも保護しておく)。
try:
backup_path = self.file_path.with_name(self.file_path.name + ".corrupt")
self.file_path.replace(backup_path)
logger.warning("GalleryMetadataStore: corrupt file backed up to %s", backup_path)
except Exception as backup_err:
logger.warning("GalleryMetadataStore: failed to back up corrupt file: %s", backup_err)
def _save_to_disk(self):
# 呼び出し元(save/create_group等)が既にself._lockを保持している前提の内部メソッド
# 呼び出し元(save/create_group等)が既にself._lockを保持している前提の内部メソッド。
# 一時ファイルに書き出してから置き換える(os.replace相当のPath.replace)ことで書き込みを
# アトミックにする。素朴な open(path, "w") での直接上書きだと、書き込み完了前に他プロセス
# が読むと不完全なJSONを掴む(torn read)うえ、書き込み中にComfyUIプロセスが終了すると
# ファイルが壊れたまま残る — 大量画像フォルダのBGインデックス処理(10枚ごとに保存)で
# 書き込み頻度が高い環境ほど発生しやすく、次回起動時のロード失敗→空データでの
# 全上書きという形でユーザーの登録済みグループ/タグ/メモが消失する原因になっていた。
try:
self.file_path.parent.mkdir(parents=True, exist_ok=True)
with open(self.file_path, "w", encoding="utf-8") as f:
tmp_path = self.file_path.with_name(self.file_path.name + ".tmp")
with open(tmp_path, "w", encoding="utf-8") as f:
json.dump(self._data, f, ensure_ascii=False, indent=2)
tmp_path.replace(self.file_path)
return True
except Exception as e:
logger.error("GalleryMetadataStore: save error: %s", e)
+24 -11
View File
@@ -811,21 +811,27 @@ class GalleryService:
return self.metadata_store.save(str(resolved), data)
def toggle_favorite(self, image_path: str) -> bool:
if not self._check_path_allowed(Path(image_path).resolve()):
resolved = Path(image_path).resolve()
if not self._check_path_allowed(resolved):
return False
meta = self.metadata_store.get(image_path)
# get_image_metadata()/list_images() 側はresolve()済みパスをキーにして取得する
# ため、ここでも統一する(save_image_metaと同じ理由。キー不一致による
# 「保存はできるが表示されない」というサイレントな食い違いを防ぐ)。
resolved_str = str(resolved)
meta = self.metadata_store.get(resolved_str)
new_val = not meta.get("favorite", False)
self.metadata_store.save(image_path, {"favorite": new_val})
self.metadata_store.save(resolved_str, {"favorite": new_val})
return new_val
def bulk_set_favorite(self, paths: list[str], value: bool) -> dict:
"""複数画像のお気に入りを一括設定する"""
ok = fail = 0
for p in paths:
if not self._check_path_allowed(Path(p).resolve()):
resolved = Path(p).resolve()
if not self._check_path_allowed(resolved):
fail += 1
continue
if self.metadata_store.save(p, {"favorite": value}):
if self.metadata_store.save(str(resolved), {"favorite": value}):
ok += 1
else:
fail += 1
@@ -859,21 +865,28 @@ class GalleryService:
return self.metadata_store.delete_group(name)
def add_to_group(self, image_path: str, group_name: str) -> bool:
if not self._check_path_allowed(Path(image_path).resolve()):
resolved = Path(image_path).resolve()
if not self._check_path_allowed(resolved):
return False
meta = self.metadata_store.get(image_path)
# get_image_metadata()/list_images() 側はresolve()済みパスをキーにして取得する
# ため、ここでも統一する(save_image_metaと同じ理由。キー不一致による
# 「グループに追加はできるが一覧に反映されない」というサイレントな食い違いを防ぐ)。
resolved_str = str(resolved)
meta = self.metadata_store.get(resolved_str)
groups = meta.get("groups", [])
if group_name not in groups:
groups.append(group_name)
return self.metadata_store.save(image_path, {"groups": groups})
return self.metadata_store.save(resolved_str, {"groups": groups})
return True
def remove_from_group(self, image_path: str, group_name: str) -> bool:
if not self._check_path_allowed(Path(image_path).resolve()):
resolved = Path(image_path).resolve()
if not self._check_path_allowed(resolved):
return False
meta = self.metadata_store.get(image_path)
resolved_str = str(resolved)
meta = self.metadata_store.get(resolved_str)
groups = [g for g in meta.get("groups", []) if g != group_name]
return self.metadata_store.save(image_path, {"groups": groups})
return self.metadata_store.save(resolved_str, {"groups": groups})
def list_images_in_group(self, group_name: str) -> list[str]:
all_paths = self.metadata_store.list_images_in_group(group_name)
+20 -6
View File
@@ -187,19 +187,33 @@ class TaggerService:
def _predict_onnx(self, img: Image.Image, data: dict, thr: float, char_thr: float) -> list:
shape = data["input_shape"]
fmt = "NHWC"
size = (224, 224)
size = 224
if len(shape) == 4:
if shape[1] == 3 and isinstance(shape[2], int) and shape[2] > 0:
fmt = "NCHW"
size = (int(shape[3]), int(shape[2]))
size = int(shape[2])
elif shape[3] == 3 and isinstance(shape[1], int) and shape[1] > 0:
fmt = "NHWC"
size = (int(shape[2]), int(shape[1]))
size = int(shape[1])
img = ImageOps.exif_transpose(img)
if img.mode != "RGB":
img = img.convert("RGB")
arr = np.array(img.resize(size, Image.Resampling.LANCZOS), dtype=np.float32) / 255.0
# WD Tagger系標準の前処理: 透過は白背景で合成 → アスペクト比を維持したまま
# 白背景で正方形にパディング → リサイズ → RGB→BGR → 0-255のfloat32のまま(NHWC)
if img.mode != "RGBA":
img = img.convert("RGBA")
canvas = Image.new("RGBA", img.size, (255, 255, 255))
canvas.paste(img, mask=img)
img = canvas.convert("RGB")
w, h = img.size
max_dim = max(w, h)
padded = Image.new("RGB", (max_dim, max_dim), (255, 255, 255))
padded.paste(img, ((max_dim - w) // 2, (max_dim - h) // 2))
if max_dim != size:
padded = padded.resize((size, size), Image.Resampling.BICUBIC)
arr = np.array(padded, dtype=np.float32)
arr = np.ascontiguousarray(arr[:, :, ::-1]) # RGB -> BGR
if fmt == "NCHW":
arr = arr.transpose((2, 0, 1))
arr = np.expand_dims(arr, 0)
+143
View File
@@ -0,0 +1,143 @@
"""Video tab plan file management service (JSON plan + optional PNG index thumbnail).
Duplicated from LabPlanService rather than shared — the two plan formats are
unrelated (batch keyframe columns vs. sequential timeline blocks) and would
gain nothing from a forced common base beyond coincidental line-count savings.
"""
import base64
import json
import logging
from datetime import datetime, timezone
from pathlib import Path
logger = logging.getLogger(__name__)
class VideoPlanService:
def __init__(self, plan_dir: Path):
self.plan_dir = plan_dir
self.plan_dir.mkdir(parents=True, exist_ok=True)
# ------------------------------------------------------------------
# Path safety
# ------------------------------------------------------------------
def _safe_path(self, filename: str, ext: str = ".json") -> Path | None:
if not filename or not filename.strip():
return None
name = filename.strip()
if not name.endswith(ext):
name = name + ext
if "/" in name or "\\" in name or name in (".", "..") or "\x00" in name:
return None
resolved = (self.plan_dir / name).resolve()
plan_dir_resolved = self.plan_dir.resolve()
if resolved != plan_dir_resolved and not str(resolved).startswith(str(plan_dir_resolved) + "\\") and not str(resolved).startswith(str(plan_dir_resolved) + "/"):
return None
return resolved
def _now_iso(self) -> str:
return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
# ------------------------------------------------------------------
# CRUD
# ------------------------------------------------------------------
def list_plans(self) -> list[dict]:
if not self.plan_dir.is_dir():
return []
result = []
for path in sorted(self.plan_dir.glob("*.json")):
try:
with open(path, "r", encoding="utf-8") as f:
data = json.load(f)
except Exception as e:
logger.warning("Skipping unreadable video plan %s: %s", path.name, e)
continue
stem = path.stem
thumbnail = None
thumb_path = self.plan_dir / f"{stem}.png"
if thumb_path.is_file():
thumbnail = f"/wfm_data/video_plan/{stem}.png"
result.append({
"filename": path.name,
"name": data.get("name", stem),
"note": data.get("note", ""),
"block_count": len(data.get("blocks", [])),
"updated_at": data.get("updated_at", ""),
"thumbnail": thumbnail,
})
result.sort(key=lambda p: p.get("updated_at", ""), reverse=True)
return result
def get_plan(self, filename: str) -> dict:
path = self._safe_path(filename)
if path is None:
raise ValueError(f"Invalid filename: {filename}")
if not path.is_file():
raise FileNotFoundError(f"Plan not found: {filename}")
with open(path, "r", encoding="utf-8") as f:
return json.load(f)
def save_plan(self, filename: str, data: dict, index_image_base64: str | None = None) -> dict:
path = self._safe_path(filename)
if path is None:
raise ValueError(f"Invalid filename: {filename}")
data = dict(data)
data["updated_at"] = self._now_iso()
path.parent.mkdir(parents=True, exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
json.dump(data, f, ensure_ascii=False, indent=2)
if index_image_base64:
self.save_index_image(filename, index_image_base64)
return {"filename": path.name, "updated_at": data["updated_at"]}
def save_index_image(self, filename: str, image_base64: str) -> None:
path = self._safe_path(filename)
if path is None:
raise ValueError(f"Invalid filename: {filename}")
stem = path.stem
thumb_path = self.plan_dir / f"{stem}.png"
# Accept both raw base64 and data: URL forms
b64 = image_base64
if "," in b64 and b64.strip().lower().startswith("data:"):
b64 = b64.split(",", 1)[1]
image_bytes = base64.b64decode(b64)
with open(thumb_path, "wb") as f:
f.write(image_bytes)
def save_index_image_to_output(self, image_base64: str, filename_prefix: str = "Video_index") -> dict:
"""Saves the contact-sheet index image into ComfyUI's own output folder,
alongside the videos generated during the run (unlike save_index_image,
which saves it next to the plan file in plan_dir)."""
b64 = image_base64
if "," in b64 and b64.strip().lower().startswith("data:"):
b64 = b64.split(",", 1)[1]
image_bytes = base64.b64decode(b64)
import folder_paths # type: ignore
output_dir = folder_paths.get_output_directory()
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(filename_prefix, output_dir)
save_name = f"{filename}_{counter:05}_.png"
save_path = Path(full_output_folder) / save_name
save_path.write_bytes(image_bytes)
return {"filename": save_name, "subfolder": subfolder}
def delete_plan(self, filename: str) -> None:
path = self._safe_path(filename)
if path is None:
raise ValueError(f"Invalid filename: {filename}")
if path.is_file():
path.unlink()
thumb_path = self.plan_dir / f"{path.stem}.png"
if thumb_path.is_file():
thumb_path.unlink()
+20 -1
View File
@@ -4,7 +4,7 @@ import jinja2
from aiohttp import web
from pathlib import Path
from .config import TEMPLATES_DIR, STATIC_DIR, DATA_DIR, WORKFLOWS_DIR, LAB_PLAN_DIR
from .config import TEMPLATES_DIR, STATIC_DIR, DATA_DIR, WORKFLOWS_DIR, LAB_PLAN_DIR, VIDEO_PLAN_DIR
logger = logging.getLogger(__name__)
@@ -57,6 +57,22 @@ async def serve_lab_plan_file(request: web.Request) -> web.Response:
})
async def serve_video_plan_file(request: web.Request) -> web.Response:
"""Serve files (index thumbnails) from the Video plan directory."""
filename = request.match_info.get("filename", "")
if not filename or ".." in filename or "/" in filename or "\\" in filename:
return web.Response(status=404)
file_path = VIDEO_PLAN_DIR / filename
if not file_path.is_file():
return web.Response(status=404)
content_type, _ = mimetypes.guess_type(str(file_path))
return web.FileResponse(file_path, headers={
"Content-Type": content_type or "application/octet-stream",
})
class WorkflowStudio:
"""Main entry point for Workflow Studio plugin."""
@@ -76,6 +92,9 @@ class WorkflowStudio:
# Dynamic Lab plan file serving (index thumbnails)
app.router.add_get("/wfm_data/lab_plan/{filename}", serve_lab_plan_file)
# Dynamic Video plan file serving (index thumbnails)
app.router.add_get("/wfm_data/video_plan/{filename}", serve_video_plan_file)
# Main page
app.router.add_get("/wfm", serve_index_page)
+2 -2
View File
@@ -1,8 +1,8 @@
[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.4"
license = "MIT"
version = "0.5.7"
license = { file = "LICENSE" }
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+377 -27
View File
@@ -1,6 +1,7 @@
/* =============================================
Video Tab (MiniMax H3専用・GenerateUIタブとは独立)
3ペイン構成: 左=フォーム / 中央=プレビュー+編集 / 右=プロパティ
Video Tab (MiniMax H3 / LTX-2.5 / Wan2.2対応・GenerateUIタブとは独立)
3ペイン構成: 左=Plan/Asset/Editサブタブ / 中央=プレビュー+Video Source / 右=プロパティ
中央・右ペインは左のサブタブ切替と無関係に常時表示される。
各ペインは独立したカラムとして高さ100%を占め、内部でスクロールする。
中央ペインのコンテンツ量(生成結果の有無・動画の縦横比)が変わっても
左右のペインの位置が動かないよう、意図的に高さを共有させない構造にしている。
@@ -37,44 +38,324 @@
margin-bottom: 4px;
}
.wfm-video-header {
display: flex;
flex-direction: column;
gap: 2px;
margin-bottom: 4px;
}
.wfm-video-header h3 {
margin: 0;
}
.wfm-video-wf-name {
color: var(--wfm-text-secondary);
font-size: 13px;
}
.wfm-video-frame-slots {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
/* ── Plan/Asset/Edit サブタブナビ(Lab/Galleryと同型) ── */
.wfm-video-subtab-nav {
display: flex;
border-bottom: 1px solid var(--wfm-border);
flex-shrink: 0;
margin: -16px -16px 12px;
padding: 0 16px;
}
.wfm-video-frame-slot {
.wfm-video-subtab-btn {
padding: 6px 16px;
font-size: 12px;
background: transparent;
border: none;
color: var(--wfm-text-secondary);
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color 0.15s;
}
.wfm-video-subtab-btn:hover { color: var(--wfm-text-primary); }
.wfm-video-subtab-btn.active { color: var(--wfm-primary); border-bottom-color: var(--wfm-primary); }
/* 中央ペイン用のタブナビ: プレビュー行の"下"に来るため、サイドバー版と違って
上マージンは潰さない(プレビュー行と重ならないようにする)。左右のみ潰して
center-panelのpadding分フルブリードにする。 */
.wfm-video-center-subtab-nav {
margin: 0 -16px 12px;
}
.wfm-video-subtab-panel {
display: flex;
flex-direction: column;
gap: 10px;
}
/* ── Plan: タイムライン(各ブロックのdurationに応じてflex-growで幅配分) ── */
.wfm-video-timeline-wrap {
display: flex;
flex-direction: column;
gap: 6px;
}
.wfm-video-timeline-track {
display: flex;
height: 40px;
border-radius: 4px;
overflow: hidden;
border: 1px solid var(--wfm-border);
}
.wfm-video-timeline-block {
flex-basis: 0;
min-width: 24px;
cursor: pointer;
border-right: 1px solid rgba(0, 0, 0, 0.3);
transition: outline 0.1s;
}
.wfm-video-timeline-block:last-child { border-right: none; }
.wfm-video-timeline-block.selected { outline: 2px solid var(--wfm-primary); outline-offset: -2px; }
.wfm-video-timeline-toolbar {
display: flex;
gap: 6px;
}
/* ── Plan: 中央下部に配置されるコンテンツ全体(Planサブタブ選択時のみ表示) ── */
.wfm-video-plan-topbar {
display: flex;
flex-direction: column;
gap: 8px;
}
/* 現在ロード中のワークフロー名 + Planに記録されたワークフローのOpen Workflow行を
同じ1行にまとめる(以前は縦に2行だった)。 */
.wfm-video-wf-row {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.wfm-video-wf-row .wfm-lab-plan-workflow-row { margin-top: 0; }
.wfm-video-plan-basesettings {
display: grid;
grid-template-columns: repeat(5, 150px);
gap: 10px;
}
/* ── Plan: 2行目の追加設定(Width/Height/Turbo Mode/Strength/Steps/Prompt Enhance)。
basesettingsと同じ見た目だが、ワークフローによって対応する項目が変わる可変集合の
ため別クラスに分けている ── */
.wfm-video-plan-extrasettings {
display: grid;
grid-template-columns: repeat(6, 130px);
gap: 10px;
}
.wfm-video-plan-basesettings label,
.wfm-video-plan-extrasettings label {
display: block;
font-size: 12px;
color: var(--wfm-text-secondary);
margin-bottom: 4px;
}
/* Noise Seed欄: 数値入力とRandomizeチェックボックスを1セル内で横並びにする */
.wfm-video-seed-inline {
display: flex;
gap: 6px;
align-items: center;
}
.wfm-video-seed-inline .wfm-input { flex: 1; min-width: 0; }
.wfm-video-seed-randomize-inline {
display: flex;
align-items: center;
gap: 3px;
font-size: 11px;
white-space: nowrap;
margin-bottom: 0;
}
/* Turbo Mode / Prompt Enhance欄: ラベル行の下にチェックボックスを1つだけ置く
(他のnumber/select欄と縦位置を揃えるため、input要素の高さを合わせる) */
.wfm-video-checkbox-inline {
display: flex;
align-items: center;
gap: 4px;
height: 30px;
font-size: 12px;
margin-bottom: 0;
}
/* タイムラインの下: ブロックエディタ(左、横並びの3カラム) + Run/Planタブ(右) */
.wfm-video-plan-main-row {
display: flex;
gap: 16px;
align-items: flex-start;
}
/* ── Plan: ブロックエディタ(選択中ブロックのFirst/Last Image・Prompt。Durationはtopbarの
basesettings行に移動済み。中央の広いエリアに配置されるため横並びの3カラムで表示する) ── */
.wfm-video-block-editor {
flex: 1;
min-width: 0;
display: flex;
gap: 16px;
}
.wfm-video-block-col label {
display: block;
font-size: 12px;
color: var(--wfm-text-secondary);
margin-bottom: 4px;
}
.wfm-video-block-first-col,
.wfm-video-block-last-col {
width: 190px;
flex: none;
display: flex;
flex-direction: column;
}
.wfm-video-resolution-row {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 10px;
align-items: end;
.wfm-video-block-prompt-col {
flex: 1;
min-width: 220px;
display: flex;
flex-direction: column;
}
.wfm-video-seed-randomize-wrap {
.wfm-video-block-prompt-col textarea {
flex: 1;
resize: none;
}
.wfm-video-block-color-row {
display: flex;
align-items: center;
padding-bottom: 6px;
gap: 6px;
font-size: 11px;
color: var(--wfm-text-secondary);
margin-bottom: 6px;
}
.wfm-video-color-swatch {
display: inline-block;
width: 14px;
height: 14px;
border-radius: 3px;
border: 1px solid var(--wfm-border);
}
/* ── Plan: Run/Planタブ(実行系・プラン管理系を切替表示するコンパクトなウィジェット) ── */
.wfm-video-runplan-panel {
width: 260px;
flex: none;
}
.wfm-video-runplan-tabnav {
display: flex;
gap: 4px;
margin-bottom: 10px;
border-bottom: 1px solid var(--wfm-border);
}
.wfm-video-runplan-tab {
flex: 1;
background: none;
border: none;
padding: 6px 4px;
cursor: pointer;
color: var(--wfm-text-secondary);
border-bottom: 2px solid transparent;
font-size: 13px;
}
.wfm-video-runplan-tab.active {
color: var(--wfm-text);
border-bottom-color: var(--wfm-primary);
}
.wfm-video-runplan-content {
display: flex;
flex-direction: column;
}
/* ── Asset: 素材グリッド・詳細パネル ── */
.wfm-video-asset-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
max-height: 320px;
overflow-y: auto;
}
.wfm-video-asset-card {
cursor: pointer;
border: 1px solid var(--wfm-border);
border-radius: 4px;
overflow: hidden;
transition: outline 0.1s;
}
.wfm-video-asset-card.selected { outline: 2px solid var(--wfm-primary); outline-offset: -2px; }
.wfm-video-asset-card-img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
display: block;
background: var(--wfm-bg-hover, #111);
}
.wfm-video-asset-card-name {
font-size: 10px;
padding: 2px 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--wfm-text-secondary);
}
.wfm-video-asset-detail {
display: flex;
flex-direction: column;
gap: 6px;
border-top: 1px solid var(--wfm-border);
padding-top: 10px;
}
.wfm-video-asset-detail label {
font-size: 12px;
color: var(--wfm-text-secondary);
}
.wfm-video-asset-name {
font-size: 12px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wfm-video-asset-tags {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.wfm-video-asset-tag {
display: inline-flex;
align-items: center;
gap: 2px;
background: var(--wfm-bg-secondary);
border: 1px solid var(--wfm-border);
border-radius: 10px;
padding: 1px 8px;
font-size: 11px;
}
.wfm-video-asset-tag button {
background: none;
border: none;
color: var(--wfm-text-secondary);
cursor: pointer;
padding: 0;
font-size: 11px;
}
/* ── 中央ペイン: プレビュー + 編集 ── */
@@ -89,8 +370,9 @@
border-right: 1px solid var(--wfm-border);
}
/* 生成結果 or ソース選択エリアで読み込んだ動画を横並びで表示する行。
プレビュー枠が主役、ソースパネルは選択UIのみの固定幅。 */
/* 3カラム構成: 左=Video Source選択UI(固定幅) / 中央=Asset選択・Sourceドロップ兼用
プレビュー / 右=生成結果専用プレビュー。.wfm-video-preview-frameは共通クラスなので
両プレビュー枠とも自動的にflex:1で均等幅になる。 */
.wfm-video-preview-row {
flex: none;
display: flex;
@@ -108,6 +390,7 @@
border: 1px dashed var(--wfm-border);
border-radius: 6px;
background: var(--wfm-bg-hover, #111);
text-align: center;
}
.wfm-video-preview-el {
@@ -183,3 +466,70 @@
flex-direction: column;
gap: 6px;
}
/* ── 左ペイン Project サブタブ: 保存済みPlan一覧 ── */
.wfm-video-project-list {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 60vh;
overflow-y: auto;
}
.wfm-video-project-item {
display: flex;
gap: 8px;
align-items: center;
border: 1px solid var(--wfm-border);
border-radius: 4px;
padding: 6px;
cursor: pointer;
}
.wfm-video-project-item:hover { border-color: var(--wfm-primary); }
.wfm-video-project-item.active { outline: 2px solid var(--wfm-primary); outline-offset: -2px; }
.wfm-video-project-item-thumb {
width: 40px;
height: 40px;
flex: none;
object-fit: cover;
border-radius: 3px;
background: var(--wfm-bg-hover, #111);
}
.wfm-video-project-item-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.wfm-video-project-item-name {
font-size: 12px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wfm-video-project-item-meta {
font-size: 10px;
color: var(--wfm-text-secondary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wfm-video-project-item-delete {
flex: none;
background: none;
border: none;
color: var(--wfm-text-secondary);
cursor: pointer;
font-size: 14px;
padding: 2px 6px;
}
.wfm-video-project-item-delete:hover { color: var(--wfm-danger); }
+1
View File
@@ -736,6 +736,7 @@ function applyI18nToHtml() {
"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-8": "helpVideo8",
"wfm-help-video-9": "helpVideo9", "wfm-help-video-10": "helpVideo10",
};
for (const [id, key] of Object.entries(helpIdMap)) {
const el = document.getElementById(id);
+12
View File
@@ -616,6 +616,18 @@ export const comfyWorkflow = {
return _lastMutedNodes;
},
// Forces the next convertUiToApi() call to refetch /object_info instead of
// reusing the cached snapshot. Needed whenever a file gets uploaded mid-session
// after the cache was already populated (e.g. Video Plan's block-chaining
// uploads an extracted frame between batch iterations) — a stale cache's
// LoadImage "image" COMBO choices wouldn't include the just-uploaded filename
// yet, so the COMBO-mismatch fallback a few lines below (silently substituting
// choices[0] when a value isn't in the known list — see the file-level comment
// at the top) would replace it with an unrelated pre-existing file instead.
invalidateObjectInfoCache() {
_objectInfoCache = null;
},
async convertUiToApi(workflow) {
_lastCheckpointSubstitutions = [];
_lastBypassedNodes = [];
+67 -7
View File
@@ -46,6 +46,16 @@ const API = {
};
export const FEEDER_GROUP = "__Feeder__";
export const VIDEO_GROUP = "__Video Assets__";
// Video Planを実行するたびに生成された動画が自動的に追加される作業用グループ
// (Plan保存の有無に関わらず常にここへ入る)。__Video Assets__(ユーザーが手動で
// キュレーションする素材グループ)への整理はユーザー任意のタイミングで行う。
export const VTEMP_GROUP = "__Video Temp__";
const _RESERVED_GROUPS = [FEEDER_GROUP, VIDEO_GROUP, VTEMP_GROUP];
function _isReservedGroup(name) {
return _RESERVED_GROUPS.includes(name);
}
// 拡張子から動画ファイル(mp4)かどうかを判定する。
// 一覧アイテムは path/filename、詳細メタ(get_image_metadata)は ext フィールドを持つため両対応。
@@ -499,8 +509,14 @@ async function loadImages() {
if (state.favoriteOnly) params.favorite = "true";
if (state.tagFilter) params.tag = state.tagFilter;
// グループフィルタはサーバーサイドで処理
if (state.groupFilter) params.group = state.groupFilter;
// グループフィルタはサーバーサイドで処理。グループのメンバーは現在のフォルダの
// サブフォルダに散らばっている可能性がある(例: 動画は"video"サブフォルダ配下)ため、
// 通常のフォルダ単位ブラウズ(非再帰)とは異なり、フィルタ時はフォルダ配下を再帰的に
// 検索する。
if (state.groupFilter) {
params.group = state.groupFilter;
params.recursive = "true";
}
try {
const images = (await apiFetch(API.images(params))).images || [];
@@ -1135,6 +1151,33 @@ export async function ensureFeederGroup() {
}
}
/** __Video Assets__ と __Video Temp__ の両方が存在しない場合に作成する。add_to_groupは
* 対象グループがレジストリに登録されているかを確認せず画像側にグループ名を書き込むだけの
* ため、一度レジストリから消える(例: 予約保護が効く前の版で削除された)と、以後の手動追加は
* 画像には記録されてもグループ一覧・フィルタには一切出てこなくなる。VideoタブのAsset
* タブ初期化時に呼び、レジストリを確実に存在させる。
* (__Video Temp__側もここでensureする — 以前はensureVideoGroupがVIDEO_GROUPしか
* 保証しておらず、__Video Temp__のレジストリが何らかの理由で消えると誰も復活させられない
* バグがあった。バッチRun開始時のensure(video-plan-tab.jsの_ensureVideoAssetGroups)は
* Runするまで呼ばれないため、それだけでは不十分。) */
export async function ensureVideoGroup() {
try {
await fetch(API.groupEnsure, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: VIDEO_GROUP }),
});
await fetch(API.groupEnsure, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: VTEMP_GROUP }),
});
await loadGroups();
} catch (e) {
console.warn("[Gallery] ensureVideoGroup error:", e);
}
}
/** Feederグループ内の全画像を除外する(FC ボタン) */
async function clearFeederGroup() {
try {
@@ -1149,6 +1192,19 @@ async function clearFeederGroup() {
}
}
/** __Video Temp__グループ内の全画像を除外する(詳細パネルの「Clear __Video Temp__」ボタン) */
async function clearVtempGroup() {
try {
await fetch(API.groupClear(VTEMP_GROUP), { method: "POST" });
showToast(t("vtempGroupCleared"), "success");
if (state.groupFilter === VTEMP_GROUP) {
await loadImages();
}
} catch (e) {
showToast(t("errorWithMsg", e.message), "error");
}
}
/** ツールバーのグループフィルタと一括バーのセレクトを更新 */
function _updateGroupSelects() {
// ツールバー: グループフィルタ
@@ -1228,15 +1284,16 @@ function renderDetailGroup(img) {
${allGroups.length === 0
? `<option value="">${t("modelsNoGroupAvailable")}</option>`
: allGroups.map(g => {
const label = g === FEEDER_GROUP ? `🔒 ${escapeHtml(g)}` : escapeHtml(g);
const label = _isReservedGroup(g) ? `🔒 ${escapeHtml(g)}` : escapeHtml(g);
return `<option value="${escapeHtml(g)}">${label}</option>`;
}).join("")}
</select>
<button class="wfm-btn wfm-btn-sm" id="wfm-gallery-grp-rename-btn"
${allGroups.length === 0 || allGroups[0] === FEEDER_GROUP ? "disabled" : ""} title="${t("modelsRename")}">&#9998;</button>
${allGroups.length === 0 || _isReservedGroup(allGroups[0]) ? "disabled" : ""} title="${t("modelsRename")}">&#9998;</button>
<button class="wfm-btn wfm-btn-sm wfm-btn-danger" id="wfm-gallery-grp-delete-btn"
${allGroups.length === 0 || allGroups[0] === FEEDER_GROUP ? "disabled" : ""} title="${t("modelsDelete")}">&times;</button>
${allGroups.length === 0 || _isReservedGroup(allGroups[0]) ? "disabled" : ""} title="${t("modelsDelete")}">&times;</button>
</div>
<button class="wfm-btn wfm-btn-sm" id="wfm-gallery-vtemp-clear-btn" style="width:100%;margin-top:6px;" title="${t("vtempClearBtnTitle")}">${t("vtempClearBtnLabel")}</button>
</div>
</div>
`;
@@ -1315,15 +1372,18 @@ function renderDetailGroup(img) {
}
});
// 管理セレクト変更時: __Feeder__ は rename/delete を無効化
// 管理セレクト変更時: 予約グループ(__Feeder__/__Video Assets__/__Video Temp__)は rename/delete を無効化
el.querySelector("#wfm-gallery-grp-manage-sel")?.addEventListener("change", (e) => {
const isReserved = e.target.value === FEEDER_GROUP;
const isReserved = _isReservedGroup(e.target.value);
const renameBtn = el.querySelector("#wfm-gallery-grp-rename-btn");
const deleteBtn = el.querySelector("#wfm-gallery-grp-delete-btn");
if (renameBtn) renameBtn.disabled = isReserved;
if (deleteBtn) deleteBtn.disabled = isReserved;
});
// Clear __Video Temp__ ボタン: __Video Temp__ グループをクリア(Video Plan実行時に自動登録される生成物置き場)
el.querySelector("#wfm-gallery-vtemp-clear-btn")?.addEventListener("click", clearVtempGroup);
// グループ名変更
el.querySelector("#wfm-gallery-grp-rename-btn")?.addEventListener("click", async () => {
const sel = el.querySelector("#wfm-gallery-grp-manage-sel");
+105 -72
View File
@@ -186,6 +186,9 @@ const LANGUAGES = {
feederGalNoNode: "No WFS_GalleryFeeder node selected",
feederGalEmptyGroup: "No images in the selected group",
feederGroupCleared: "Feeder group cleared",
vtempGroupCleared: "__Video Temp__ group cleared",
vtempClearBtnLabel: "Clear __Video Temp__",
vtempClearBtnTitle: "Clear the __Video Temp__ group (video generations land here automatically; organize keepers into __Video Assets__ manually anytime)",
addedToFeeder: "Added to Feeder",
removedFromFeeder: "Removed from Feeder",
appliedToWorkflow: "Applied to workflow",
@@ -910,7 +913,7 @@ const LANGUAGES = {
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.",
helpSettings15: "Full Backup (ZIP): unlike the JSON export above, also includes folder-based data (AI Skills, Lab Plans, Style presets) and the Tagger database — everything the JSON export can't represent. Restoring overwrites existing files; restart ComfyUI afterward.",
helpSettings15: "Full Backup (ZIP): unlike the JSON export above, also includes folder-based data (AI Skills, Lab Plans, Video Plans, Style presets) and the Tagger database — everything the JSON export can't represent. Restoring overwrites existing files; restart ComfyUI afterward.",
helpSettings16: "Two opt-in checkboxes above the Full Backup buttons additionally include ComfyUI's default workflows folder and the Impact Pack's wildcard folder in the export — both export-only, never restored automatically; copy the ZIP's _external/ folder back by hand if you want them.",
helpSettings9: "All sections are collapsible accordion panels",
helpSettings10: "Wildcard Integration: link WFS wildcard dir to ComfyUI-Impact-Pack wildcards (directory junction on Windows / symlink on other OS); existing files migrated automatically",
@@ -1227,7 +1230,7 @@ const LANGUAGES = {
importError: "Import failed",
exportFullBackup: "Full Backup (ZIP)",
importFullBackup: "Restore Full Backup (ZIP)",
fullBackupHint: "Full Backup (ZIP) additionally includes folder-based data (AI Skills, Lab Plans, Style presets) and the Tagger database — everything the JSON export above can't represent. Restoring overwrites existing files; restart ComfyUI afterward.",
fullBackupHint: "Full Backup (ZIP) additionally includes folder-based data (AI Skills, Lab Plans, Video Plans, Style presets) and the Tagger database — everything the JSON export above can't represent. Restoring overwrites existing files; restart ComfyUI afterward.",
fullBackupFilesUnit: "files",
fullBackupIncludeWorkflows: "Include default workflows folder (user/default/workflows)",
fullBackupIncludeWildcard: "Include Impact Pack wildcard folder (if present)",
@@ -1327,28 +1330,26 @@ const LANGUAGES = {
// -- Video Tab (MiniMax H3 / LTX-2.5 / Wan2.2, independent of GenerateUI) --
tabVideo: "Video",
loadInVideo: "Load in Video",
videoTitle: "Video",
videoFirstFrame: "First Frame (optional)",
videoLastFrame: "Last Frame (optional)",
videoDropOrClick: "Drop image or click to select",
videoPrompt: "Prompt",
videoAspectRatio: "Aspect Ratio",
videoMegapixels: "Megapixels",
videoMultiple: "Multiple",
videoDuration: "Duration (seconds)",
videoNoiseSeed: "Noise Seed",
videoRandomizeSeed: "Randomize",
videoGenerate: "Generate",
videoEditPlaceholder: "Editing tools coming soon",
videoNoWorkflowLoaded: "No workflow loaded",
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)",
videoWorkflowLoadFailed: "Failed to load workflow",
videoConfirmLoadWorkflow: (name) => `Load "${name}" as this plan's workflow?`,
videoPlanMinOneBlock: "A plan needs at least one block",
videoPlanEnterName: "Enter a name for this plan",
videoPlanSaved: "Plan saved",
videoPlanSaveFailed: "Failed to save plan",
videoPlanLoaded: "Plan loaded",
videoPlanLoadFailed: "Failed to load plan",
videoConfirmClearPlan: "Clear the current plan?",
videoPlanPause: "Pause",
videoPlanResume: "Resume",
videoWorkflowLoaded: (name) => `Workflow loaded: ${name}`,
videoGenerateSuccess: "Video generated",
videoDoneCount: (n) => `Done (${n} file${n === 1 ? "" : "s"})`,
videoSourceLabel: "Video Source",
videoSourceHint: "Load any video here to use Frame/GIF tools without generating one.",
videoSourceDropLabel: "Drop video or click to select",
videoNoVideo: "No video",
videoSourcePreviewPlaceholder: "Select an asset or drop a video",
videoResultPreviewPlaceholder: "No video generated yet",
videoPropFrame: "Frame",
videoPropGif: "GIF",
videoFrameHint: "Play/seek the preview video to the position you want, then capture.",
@@ -1365,16 +1366,26 @@ const LANGUAGES = {
videoGifDoneCount: (n) => `Done (${n} frame${n === 1 ? "" : "s"})`,
videoGifSaved: (name) => `GIF saved: ${name}`,
videoNoSourceLoaded: "Load a video first (generate one, or drop a file into Video Source)",
videoPropProject: "Project",
videoProjectHint: "Saved plans",
videoProjectEmpty: "No saved plans yet",
videoProjectBlockCount: (n) => `${n} block${n === 1 ? "" : "s"}`,
videoProjectDeleteConfirm: (name) => `Delete plan "${name}"?`,
videoProjectDeleted: "Plan deleted",
videoProjectDeleteFailed: "Failed to delete plan",
videoProjectLoadListFailed: "Failed to load plan list",
helpVideoTitle: "Video 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. 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 the loaded video workflow first; Clear resets it back to empty.",
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. The center panel's Plan / Edit subtabs handle batch generation and (future) editing; the sidebar's Asset / Project subtabs handle browsing generated videos and saved plans.",
helpVideo1: "Plan subtab: the topbar's settings row holds Aspect Ratio / Megapixels / Multiple / Duration (seconds) / Noise Seed as this plan's base settings — Duration always reflects the currently selected block (each block keeps its own value), the rest are plan-wide. A second row below adds Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance, each enabled only for workflows that actually support it (see helpVideo2). Split the timeline into blocks with the + Split / + Block / Delete buttons — each block has its own Prompt, Duration, and First/Last Image — First Image can be None, an explicit image, or \"use previous block's last frame\" (an explicit Last Image on the previous block always wins over extracting one from its generated video). Click Run to generate every block in order; Pause/Cancel work mid-run.",
helpVideo2: "A plan with a single block behaves exactly like the old one-shot form. Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults. For workflows with no ResolutionSelector node (e.g. Wan2.2, LTX-2.5 First & Last Frame to Video), the Aspect Ratio / Megapixels / Multiple fields are disabled and the workflow's own Width / Height become directly editable instead. Turbo Mode / Strength / Steps only apply to MiniMax H3's turbo LoRA, and Prompt Enhance only to LTX-2.5 — both stay disabled for other model families. Noise Seed is disabled for the one workflow that doesn't expose it: Wan2.2 Text-to-Video.",
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 — this starts a fresh single-block plan seeded from the workflow's own current values. Unsupported workflows show an error instead.",
helpVideo4: "Generated videos (mp4) automatically appear in the Asset subtab's Video Temp group, and can also be browsed and played back in the Gallery tab. Organizing keepers into Video Assets is entirely up to you, on your own schedule.",
helpVideo5: "The center panel shows two previews: the left one shows either the video you select in the Asset subtab or whatever you drop/pick in the Video Source panel on its left (Clear resets it to empty), letting you use the Frame/GIF tools without running the loaded video workflow first; the right one always shows the most recently generated clip.",
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.",
helpVideo8: "Chaining: setting a block's First Image to \"use previous block's last frame\" continues smoothly from the previous clip — if that previous block has its own explicit Last Image, that image is used directly; otherwise the actual last frame of its generated video is extracted automatically.",
helpVideo9: "Project tab (sidebar, next to Asset): browse every saved plan file (thumbnail, block count, last updated), click one to load it into the Plan editor, or delete it with the × button; clicking the same tab again collapses the panel.",
helpVideo10: "Highlight color: the Prompt / Duration / First Image / Last Image / Aspect Ratio / Megapixels / Multiple / Noise Seed / Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance 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 while Width / Height light up instead.",
},
ja: {
@@ -1557,6 +1568,9 @@ const LANGUAGES = {
feederGalNoNode: "WFS_GalleryFeederノードが選択されていません",
feederGalEmptyGroup: "選択グループに画像がありません",
feederGroupCleared: "Feederグループをクリアしました",
vtempGroupCleared: "__Video Temp__グループをクリアしました",
vtempClearBtnLabel: "Clear __Video Temp__",
vtempClearBtnTitle: "__Video Temp__グループをクリアします(動画生成物は自動的にここへ入ります。__Video Assets__への整理は任意のタイミングで手動で行ってください)",
addedToFeeder: "Feederに追加しました",
removedFromFeeder: "Feederから除外しました",
appliedToWorkflow: "ワークフローに適用しました",
@@ -2281,7 +2295,7 @@ const LANGUAGES = {
helpSettings6: "デフォルトワークフローの設定・解除",
helpSettings7: "Eagle連携URL、自動保存の有効/無効",
helpSettings8: "データ管理:設定・メタデータ・プロンプトなど主要データをJSONにエクスポート、またはインポートして復元。インポート後はComfyUIを再起動してください。",
helpSettings15: "フルバックアップ (ZIP):上記のJSONエクスポートと異なり、フォルダ形式のデータ(AI Skills、Lab Plan、Styleプリセット)とTaggerデータベースも含みます。復元すると既存ファイルは上書きされます。復元後はComfyUIを再起動してください。",
helpSettings15: "フルバックアップ (ZIP):上記のJSONエクスポートと異なり、フォルダ形式のデータ(AI Skills、Lab Plan、Video Plan、Styleプリセット)とTaggerデータベースも含みます。復元すると既存ファイルは上書きされます。復元後はComfyUIを再起動してください。",
helpSettings16: "フルバックアップのボタン上にある2つのチェックボックスで、デフォルトワークフローフォルダーとImpact Packのwildcardフォルダーもエクスポートに含められます。どちらもエクスポート専用で自動復元はされません。必要な場合はZIP内の_external/フォルダから手動でコピーしてください。",
helpSettings9: "各セクションはアコーディオン式で折りたたみ可能",
helpSettings10: "Wildcard Integration:WFSのワイルドカードディレクトリをComfyUI-Impact-Packのwildcardsディレクトリへリンク(Windowsはジャンクション、他OSはシンボリックリンク)。既存ファイルは自動で移行されます",
@@ -2596,7 +2610,7 @@ const LANGUAGES = {
importError: "インポート失敗",
exportFullBackup: "フルバックアップ (ZIP)",
importFullBackup: "フルバックアップを復元 (ZIP)",
fullBackupHint: "フルバックアップ(ZIP)は上記のJSONエクスポートでは表現できないフォルダ形式のデータ(AI Skills、Lab Plan、Styleプリセット)とTaggerデータベースも含みます。復元すると既存ファイルは上書きされます。復元後はComfyUIを再起動してください。",
fullBackupHint: "フルバックアップ(ZIP)は上記のJSONエクスポートでは表現できないフォルダ形式のデータ(AI Skills、Lab Plan、Video Plan、Styleプリセット)とTaggerデータベースも含みます。復元すると既存ファイルは上書きされます。復元後はComfyUIを再起動してください。",
fullBackupFilesUnit: "件",
fullBackupIncludeWorkflows: "デフォルトワークフローフォルダーを含める (user/default/workflows)",
fullBackupIncludeWildcard: "Impact Packのwildcardフォルダーを含める(存在する場合)",
@@ -2696,28 +2710,26 @@ const LANGUAGES = {
// -- Video タブ(MiniMax H3 / LTX-2.5 / Wan2.2対応、GenerateUIタブとは独立) --
tabVideo: "Video",
loadInVideo: "Videoに読み込み",
videoTitle: "Video",
videoFirstFrame: "First Frame(任意)",
videoLastFrame: "Last Frame(任意)",
videoDropOrClick: "画像をドロップまたはクリックして選択",
videoPrompt: "Prompt",
videoAspectRatio: "Aspect Ratio",
videoMegapixels: "Megapixels",
videoMultiple: "Multiple",
videoDuration: "Duration(秒)",
videoNoiseSeed: "Noise Seed",
videoRandomizeSeed: "ランダム化",
videoGenerate: "Generate",
videoEditPlaceholder: "編集機能は今後追加予定",
videoNoWorkflowLoaded: "ワークフローが読み込まれていません",
videoUnsupportedWorkflow: "このワークフローには対応する動画モデルノード(MiniMax H3、LTX-2.5のText/Image/First&Last-Frame to Video、またはWan2.2のText to Video)が含まれていません",
videoWorkflowLoadFailed: "ワークフローの読み込みに失敗しました",
videoConfirmLoadWorkflow: (name) => `「${name}」をこのPlanのワークフローとして読み込みますか?`,
videoPlanMinOneBlock: "Planには最低1つのブロックが必要です",
videoPlanEnterName: "Planの名前を入力してください",
videoPlanSaved: "Planを保存しました",
videoPlanSaveFailed: "Planの保存に失敗しました",
videoPlanLoaded: "Planを読み込みました",
videoPlanLoadFailed: "Planの読み込みに失敗しました",
videoConfirmClearPlan: "現在のPlanをクリアしますか?",
videoPlanPause: "一時停止",
videoPlanResume: "再開",
videoWorkflowLoaded: (name) => `ワークフローを読み込みました: ${name}`,
videoGenerateSuccess: "動画を生成しました",
videoDoneCount: (n) => `完了(${n}件)`,
videoSourceLabel: "動画ソース",
videoSourceHint: "生成せずにFrame/GIF機能を使いたい場合はここに任意の動画を読み込めます。",
videoSourceDropLabel: "動画をドロップまたはクリックして選択",
videoNoVideo: "動画なし",
videoSourcePreviewPlaceholder: "アセットを選択するか動画をドロップしてください",
videoResultPreviewPlaceholder: "生成された動画はまだありません",
videoPropFrame: "Frame",
videoPropGif: "GIF",
videoFrameHint: "プレビュー動画を再生・シークして止めたい位置で「Capture Frame」を押してください。",
@@ -2734,16 +2746,26 @@ const LANGUAGES = {
videoGifDoneCount: (n) => `完了(${n}フレーム)`,
videoGifSaved: (name) => `GIFを保存しました: ${name}`,
videoNoSourceLoaded: "先に動画を用意してください(生成するか、動画ソースにファイルをドロップ)",
videoPropProject: "Project",
videoProjectHint: "保存済みのPlan",
videoProjectEmpty: "保存済みのPlanはまだありません",
videoProjectBlockCount: (n) => `${n}ブロック`,
videoProjectDeleteConfirm: (name) => `Plan「${name}」を削除しますか?`,
videoProjectDeleted: "Planを削除しました",
videoProjectDeleteFailed: "Planの削除に失敗しました",
videoProjectLoadListFailed: "Plan一覧の読み込みに失敗しました",
helpVideoTitle: "Video タブ",
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)は読み込んだワークフローの既定値に固定され、このタブでは変更できません。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機能を読み込んだワークフローを実行せずに使えます。Clearで選択をリセットできます。",
helpVideoDesc: "MiniMax H3 (Image to Video)、LTX-2.5 (Text / Image / First & Last Frame to Video)、Wan2.2 (Text to Video) ワークフロー対応の動画生成タブ。GenerateUIタブとは独立して動作します。中央パネルのPlan/Editサブタブがバッチ生成と(将来の)編集を、左サイドバーのAsset/Projectサブタブが生成済み動画の閲覧と保存済みPlanの一覧を扱います。",
helpVideo1: "Planサブタブ: 上部の設定行にAspect Ratio/Megapixels/Multiple/Duration(秒)/Noise SeedがこのPlanの基本設定として並びます——Durationは常に現在選択中のブロックの値を表示・編集します(各ブロックが独自の値を持つ)が、それ以外はPlan全体で共通の値です。その下の2行目にはWidth/Height/Turbo Mode/Strength/Steps/Prompt Enhanceが並び、読み込んだワークフローが実際に対応する項目だけ入力可能になります(詳細はhelpVideo2)。「+ Split」「+ Block」「Delete」ボタンでタイムラインをブロックに分割すると、各ブロックは独自のPrompt・Duration・First/Last Imageを持ちます(First Imageは「なし」「画像を指定」「前ブロックの最終フレームを使用」から選択可能。前ブロックに明示的なLast Imageが設定されていれば、フレーム抽出よりそちらが優先されます)。Runを押すと全ブロックを順番に生成します。実行中もPause/Cancelが使えます。",
helpVideo2: "ブロックが1個だけのPlanは、以前の単発生成フォームと同じ動作になります。モデル選択(UNet/CLIP/VAE/Audio VAE)は読み込んだワークフローの既定値に固定されます。ResolutionSelectorノードを持たないワークフロー(Wan2.2、LTX-2.5のFirst & Last Frame to Videoなど)はAspect Ratio/Megapixels/Multiple欄が無効化される代わりに、ワークフロー自体のWidth/Heightを直接編集できるようになります。Turbo Mode/Strength/StepsはMiniMax H3のturbo LoRA専用、Prompt EnhanceはLTX-2.5専用で、他のモデルファミリーでは無効のままです。Noise SeedはWan2.2のText to Videoのみ公開入力を持たないため無効化されます。",
helpVideo3: "Workflowタブの詳細モーダルにある「Videoに読み込み」ボタンから、MiniMax H3のImage to Videoノード、LTX-2.5のText/Image/First&Last-Frame to Videoノード、またはWan2.2のText to Videoノードを含むワークフローを読み込めます。この操作でワークフローの現在値を反映したブロック1個の新規Planが作成されます。対応していないワークフローはエラー表示になります。",
helpVideo4: "生成した動画(mp4)はAssetサブタブのVideo Tempグループに自動的に反映されるほか、Galleryタブでも閲覧・再生できます。残したい動画をVideo Assetsへ整理するタイミングはユーザー任意です。",
helpVideo5: "中央パネルには2つのプレビューがあります。左側はAssetサブタブで選択した動画、または左隣の「Video Source」パネルにドロップ/選択した任意のローカル動画を表示し(Clearでリセット)、読み込んだワークフローを実行せずにFrame/GIF機能を使えます。右側は常に直近で生成されたクリップを表示します。",
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のラベルは非表示のままです(それらの項目は操作不可のため)。",
helpVideo8: "チェイン機能: ブロックのFirst Imageを「前ブロックの最終フレームを使用」に設定すると、前のクリップから連続した映像になります。前ブロックに明示的なLast Imageが設定されていればそれがそのまま使われ、無ければ生成された動画から実際の最終フレームが自動抽出されます。",
helpVideo9: "Projectタブ(左サイドバー、Assetの隣): 保存済みの全Planファイル(サムネイル・ブロック数・更新日時)を一覧表示し、クリックでPlanエディタへ読み込み、×ボタンで削除できます。同じタブをもう一度押すとパネルを閉じます。",
helpVideo10: "ハイライト表示: 読み込んだワークフローが実際にサポートしているフィールドに応じて、Prompt/Duration/First Image/Last Image/Aspect Ratio/Megapixels/Multiple/Noise Seed/Width/Height/Turbo Mode/Strength/Steps/Prompt Enhanceのラベルが、GenerateUI ModelタブのハイライトとSettingsタブで共通設定できる色に変わります。例えばWan2.2ワークフロー(ResolutionSelectorノードが無い)ではAspect Ratio/Megapixels/Multipleはハイライトされない代わりに、Width/Heightがハイライトされます。",
},
zh: {
@@ -2926,6 +2948,9 @@ const LANGUAGES = {
feederGalNoNode: "未选择WFS_GalleryFeeder节点",
feederGalEmptyGroup: "所选组中没有图片",
feederGroupCleared: "已清空Feeder组",
vtempGroupCleared: "已清空__Video Temp__组",
vtempClearBtnLabel: "Clear __Video Temp__",
vtempClearBtnTitle: "清空__Video Temp__组(视频生成结果会自动进入此组,整理到__Video Assets__由用户自行选择时机手动完成)",
addedToFeeder: "已添加到Feeder",
removedFromFeeder: "已从Feeder移除",
appliedToWorkflow: "已应用到工作流",
@@ -3650,7 +3675,7 @@ const LANGUAGES = {
helpSettings6: "默认工作流设置/取消",
helpSettings7: "Eagle集成URL、自动保存开关",
helpSettings8: "数据管理:将设置、元数据、提示词等主要数据导出为JSON文件,或导入以恢复。导入后请重启ComfyUI。",
helpSettings15: "完整备份 (ZIP):与上方的JSON导出不同,还包含文件夹型数据(AI Skills、Lab Plan、Style预设)以及Tagger数据库。恢复会覆盖现有文件,恢复后请重启ComfyUI。",
helpSettings15: "完整备份 (ZIP):与上方的JSON导出不同,还包含文件夹型数据(AI Skills、Lab Plan、Video Plan、Style预设)以及Tagger数据库。恢复会覆盖现有文件,恢复后请重启ComfyUI。",
helpSettings16: "完整备份按钮上方的两个复选框可将ComfyUI默认工作流文件夹和Impact Pack的wildcard文件夹一并导出。两者均仅用于导出,不会自动恢复。如需要,请从ZIP中的_external/文件夹手动复制回去。",
helpSettings9: "各部分可折叠展开",
helpSettings10: "Wildcard Integration:将WFS通配符目录链接到ComfyUI-Impact-Pack的wildcards目录(Windows为目录联结,其他OS为符号链接);现有文件自动迁移",
@@ -3966,7 +3991,7 @@ const LANGUAGES = {
importError: "导入失败",
exportFullBackup: "完整备份 (ZIP)",
importFullBackup: "恢复完整备份 (ZIP)",
fullBackupHint: "完整备份(ZIP)还包含上方JSON导出无法表示的文件夹型数据(AI Skills、Lab Plan、Style预设)以及Tagger数据库。恢复会覆盖现有文件,恢复后请重启ComfyUI。",
fullBackupHint: "完整备份(ZIP)还包含上方JSON导出无法表示的文件夹型数据(AI Skills、Lab Plan、Video Plan、Style预设)以及Tagger数据库。恢复会覆盖现有文件,恢复后请重启ComfyUI。",
fullBackupFilesUnit: "个文件",
fullBackupIncludeWorkflows: "包含默认工作流文件夹 (user/default/workflows)",
fullBackupIncludeWildcard: "包含Impact Pack的wildcard文件夹(如存在)",
@@ -4066,28 +4091,26 @@ const LANGUAGES = {
// -- Video 标签页(支持 MiniMax H3 / LTX-2.5 / Wan2.2,独立于 GenerateUI) --
tabVideo: "Video",
loadInVideo: "加载到Video",
videoTitle: "Video",
videoFirstFrame: "First Frame(可选)",
videoLastFrame: "Last Frame(可选)",
videoDropOrClick: "拖放图片或点击选择",
videoPrompt: "Prompt",
videoAspectRatio: "Aspect Ratio",
videoMegapixels: "Megapixels",
videoMultiple: "Multiple",
videoDuration: "Duration(秒)",
videoNoiseSeed: "Noise Seed",
videoRandomizeSeed: "随机化",
videoGenerate: "Generate",
videoEditPlaceholder: "编辑功能即将推出",
videoNoWorkflowLoaded: "尚未加载工作流",
videoUnsupportedWorkflow: "该工作流不包含受支持的视频模型节点(MiniMax H3、LTX-2.5 的 Text/Image/First&Last-Frame to Video,或 Wan2.2 的 Text to Video)",
videoWorkflowLoadFailed: "工作流加载失败",
videoConfirmLoadWorkflow: (name) => `要将“${name}”加载为该 Plan 的工作流吗?`,
videoPlanMinOneBlock: "Plan 至少需要一个区块",
videoPlanEnterName: "请输入该 Plan 的名称",
videoPlanSaved: "Plan 已保存",
videoPlanSaveFailed: "Plan 保存失败",
videoPlanLoaded: "Plan 已加载",
videoPlanLoadFailed: "Plan 加载失败",
videoConfirmClearPlan: "要清空当前 Plan 吗?",
videoPlanPause: "暂停",
videoPlanResume: "继续",
videoWorkflowLoaded: (name) => `已加载工作流: ${name}`,
videoGenerateSuccess: "视频已生成",
videoDoneCount: (n) => `完成(${n} 个文件)`,
videoSourceLabel: "视频来源",
videoSourceHint: "无需生成,也可在此加载任意视频以使用Frame/GIF工具。",
videoSourceDropLabel: "拖放视频或点击选择",
videoNoVideo: "暂无视频",
videoSourcePreviewPlaceholder: "选择素材或拖放视频",
videoResultPreviewPlaceholder: "尚未生成视频",
videoPropFrame: "Frame",
videoPropGif: "GIF",
videoFrameHint: "播放/拖动预览视频到想要的位置,然后点击截取。",
@@ -4104,16 +4127,26 @@ const LANGUAGES = {
videoGifDoneCount: (n) => `完成(${n} 帧)`,
videoGifSaved: (name) => `已保存GIF: ${name}`,
videoNoSourceLoaded: "请先准备视频(生成一个,或将文件拖入视频来源)",
videoPropProject: "Project",
videoProjectHint: "已保存的 Plan",
videoProjectEmpty: "暂无已保存的 Plan",
videoProjectBlockCount: (n) => `${n} 个区块`,
videoProjectDeleteConfirm: (name) => `确定删除 Plan「${name}」吗?`,
videoProjectDeleted: "Plan 已删除",
videoProjectDeleteFailed: "Plan 删除失败",
videoProjectLoadListFailed: "Plan 列表加载失败",
helpVideoTitle: "Video 标签页",
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)固定为所加载工作流的默认值,无法在此标签页中修改。没有 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工具。点击Clear可重置选择。",
helpVideoDesc: "支持 MiniMax H3(Image to Video)、LTX-2.5(Text / Image / First & Last Frame to Video)、Wan2.2(Text to Video)工作流的视频生成标签页,独立于 GenerateUI 标签页运行。中央面板的 Plan/Edit 子标签负责批量生成和(未来的)编辑;侧边栏的 Asset/Project 子标签负责浏览已生成的视频和已保存的 Plan。",
helpVideo1: "Plan 子标签:顶部设置行包含 Aspect Ratio/Megapixels/Multiple/Duration(秒)/Noise Seed,作为该 Plan 的基础设置——Duration 始终显示并可编辑当前选中区块的值(每个区块保留自己的值),其余字段则是整个 Plan 共用的。下方第二行是 Width/Height/Turbo Mode/Strength/Steps/Prompt Enhance,仅当所加载的工作流实际支持该项时才可输入(详见 helpVideo2)。用「+ Split」「+ Block」「Delete」按钮把时间线分割成多个区块后,每个区块都有自己的 Prompt、Duration 以及 First/Last Image(First Image 可选择“无”、“指定图片”或“使用前一个区块的最后一帧”——若前一个区块已明确设置了 Last Image,则优先使用该图片而非提取帧)。点击 Run 会按顺序生成所有区块,运行中也可以 Pause/Cancel。",
helpVideo2: "只有一个区块的 Plan 与旧版单次生成表单效果完全相同。模型选择(UNet/CLIP/VAE/Audio VAE)固定为所加载工作流的默认值。没有 ResolutionSelector 节点的工作流(如 Wan2.2、LTX-2.5 的 First & Last Frame to Video)会禁用 Aspect Ratio/Megapixels/Multiple 字段,改为可以直接编辑工作流自身的 Width/Height。Turbo Mode/Strength/Steps 仅适用于 MiniMax H3 的 turbo LoRA,Prompt Enhance 仅适用于 LTX-2.5——其他模型系列中这些字段保持禁用。Noise Seed 仅在 Wan2.2 的 Text to Video 中会被禁用,因为该变体未公开此输入。",
helpVideo3: "在 Workflow 标签页的详情弹窗中使用「加载到Video」按钮,可以加载包含 MiniMax H3 的 Image to Video 节点、LTX-2.5 的 Text/Image/First&Last-Frame to Video 节点、或 Wan2.2 的 Text to Video 节点的工作流——此操作会创建一个仅含一个区块、并以该工作流当前值为初始值的新 Plan。不受支持的工作流会显示错误提示。",
helpVideo4: "生成的视频(mp4)会自动出现在 Asset 子标签的 Video Temp 组中,也可以在 Gallery 标签页中浏览和播放。是否整理到 Video Assets,由您自行决定时机。",
helpVideo5: "中间面板有两个预览区:左侧显示您在 Asset 子标签中选择的视频,或拖放/选择到左边「Video Source」面板中的任意本地视频(点击 Clear 可重置),无需先运行已加载的视频工作流即可使用 Frame/GIF 工具;右侧始终显示最近一次生成的片段。",
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标签保持不高亮,因为这些字段处于禁用状态。",
helpVideo8: "链接功能:将某个区块的 First Image 设置为“使用前一个区块的最后一帧”,即可与上一个片段流畅衔接——如果前一个区块已明确设置了 Last Image,将直接使用该图片;否则会自动从其生成的视频中提取实际的最后一帧。",
helpVideo9: "Project标签页(左侧边栏,与Asset并列):浏览所有已保存的 Plan 文件(缩略图、区块数、最后更新时间),点击即可加载到 Plan 编辑器,或用 × 按钮删除;再次点击同一标签会收起面板。",
helpVideo10: "高亮颜色:当所加载的工作流实际支持该字段时,Prompt / Duration / First Image / Last Image / Aspect Ratio / Megapixels / Multiple / Noise Seed / Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance 标签会变为与 GenerateUI Model 标签页相同的高亮颜色(可在 Settings 标签页自定义)——例如 Wan2.2 工作流(没有 ResolutionSelector 节点)中,Aspect Ratio / Megapixels / Multiple 不会高亮,取而代之的是 Width / Height 会高亮。",
},
};
+1 -1
View File
@@ -406,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,\n.wfm-video-form-panel label.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-plan-content label.wfm-model-label-active { color: ${val}; }`;
}
export function applyTheme(themeId) {
+296
View File
@@ -0,0 +1,296 @@
/**
* Video Tab - Asset subtab: browses the videos a Plan run has generated.
*
* Deliberately thin — it reuses Gallery's existing backend (groups, tags/memo
* sidecar, thumbnailing) exactly like feeder-tab.js's own Gallery mode does,
* rather than re-implementing folder browsing, bulk selection, etc. Anything
* beyond basic browsing/tagging (move, export, delete, multi-select) is left
* to the real Gallery tab via the "Open in Gallery" button.
*/
import { VIDEO_GROUP, VTEMP_GROUP, ensureVideoGroup } from "./gallery-tab.js";
import { setSourcePreview } from "./video-preview.js";
// Sentinel for the "All Video Assets" option — not a real backend group, since
// Gallery's group filter only ever matches one group at a time. Selecting it
// fetches VIDEO_GROUP and VTEMP_GROUP separately and merges them (see _loadImages).
const ALL_GROUPS_VALUE = "__video_asset_all__";
// Display names are now identical to the underlying group names (minus the
// "__...__" wrapping) — no more per-plan "VideoPlan:<name>" sub-groups, so the
// dropdown is always exactly these three fixed entries.
const _GROUPS = [ALL_GROUPS_VALUE, VIDEO_GROUP, VTEMP_GROUP];
const _s = {
outputDir: "",
group: ALL_GROUPS_VALUE,
images: [],
selectedPath: null,
loaded: false, // becomes true once the Asset subtab has been shown at least once
};
async function _fetchOutputDir() {
if (_s.outputDir) return;
try {
const res = await fetch("/api/wfm/settings/output-dir");
if (res.ok) {
const data = await res.json();
_s.outputDir = (data.current || "").replace(/\\/g, "/").replace(/\/$/, "");
}
} catch { /* non-critical */ }
}
function _groupLabel(g) {
if (g === ALL_GROUPS_VALUE) return "All Video Assets";
if (g === VIDEO_GROUP) return "Video Assets";
if (g === VTEMP_GROUP) return "Video Temp";
return g;
}
function _renderGroupSelect() {
const sel = document.getElementById("wfm-video-asset-group");
if (!sel) return;
sel.innerHTML = _GROUPS
.map((g) => `<option value="${g}"${g === _s.group ? " selected" : ""}>${_groupLabel(g)}</option>`)
.join("");
}
async function _fetchGroupImages(group) {
const params = new URLSearchParams({ folder: _s.outputDir, group, recursive: "true", sort: "date_desc" });
const res = await fetch(`/wfm/gallery/images?${params}`);
if (!res.ok) throw new Error(String(res.status));
const data = await res.json();
return data.images || [];
}
async function _loadImages() {
const grid = document.getElementById("wfm-video-asset-grid");
const statusEl = document.getElementById("wfm-video-asset-status");
if (!grid) return;
await _fetchOutputDir();
if (!_s.outputDir) {
grid.innerHTML = `<div class="wfm-placeholder">No output folder configured</div>`;
return;
}
grid.innerHTML = `<div class="wfm-placeholder">Loading...</div>`;
try {
let images;
if (_s.group === ALL_GROUPS_VALUE) {
// "All Video Assets" = the union of the curated __Video Assets__
// group and __Video Temp__ (auto-populated by every plan run,
// organized into __Video Assets__ by the user on their own
// schedule) — not a single backend group filter, so fetch both
// and merge.
const [curated, temp] = await Promise.all([
_fetchGroupImages(VIDEO_GROUP),
_fetchGroupImages(VTEMP_GROUP),
]);
const byPath = new Map();
for (const img of [...curated, ...temp]) byPath.set(img.path, img);
images = Array.from(byPath.values()).sort((a, b) => b.mtime - a.mtime);
} else {
images = await _fetchGroupImages(_s.group);
}
_s.images = images;
_renderGrid();
if (statusEl) statusEl.textContent = `${_s.images.length} video(s)`;
} catch (err) {
_s.images = [];
grid.innerHTML = `<div class="wfm-placeholder" style="color:var(--wfm-danger)">Load failed: ${err.message}</div>`;
if (statusEl) statusEl.textContent = "";
}
}
function _renderGrid() {
const grid = document.getElementById("wfm-video-asset-grid");
if (!grid) return;
if (_s.images.length === 0) {
grid.innerHTML = `<div class="wfm-placeholder">No videos yet</div>`;
return;
}
grid.innerHTML = "";
for (const img of _s.images) grid.appendChild(_makeCard(img));
}
function _makeCard(img) {
const card = document.createElement("div");
card.className = "wfm-video-asset-card" + (img.path === _s.selectedPath ? " selected" : "");
card.dataset.path = img.path;
const thumb = document.createElement("img");
thumb.className = "wfm-video-asset-card-img";
thumb.loading = "lazy";
thumb.src = `/wfm/gallery/image/thumb?path=${encodeURIComponent(img.path)}&w=200`;
thumb.onerror = () => { thumb.style.display = "none"; };
const name = document.createElement("div");
name.className = "wfm-video-asset-card-name";
name.textContent = img.filename;
name.title = img.filename;
card.append(thumb, name);
card.addEventListener("click", () => _selectImage(img));
return card;
}
function _selectImage(img) {
_s.selectedPath = img.path;
document.querySelectorAll(".wfm-video-asset-card").forEach((c) => {
c.classList.toggle("selected", c.dataset.path === img.path);
});
_renderDetail(img);
_loadIntoSourcePreview(img);
}
// Feeds the selected asset's video into the center panel's Asset/Source preview
// pane (see video-preview.js) so it's visible without switching tabs, and so the
// Frame/GIF property tools can operate on it just like a Video Source drop.
// Fetched as a Blob and wrapped as a "local" source rather than trying to map
// Gallery's arbitrary absolute path onto ComfyUI's filename/subfolder/type
// triple — that keeps the GIF tool's existing upload-on-first-use path working
// unchanged for both cases.
async function _loadIntoSourcePreview(img) {
try {
const res = await fetch(`/wfm/gallery/image/serve?path=${encodeURIComponent(img.path)}`);
if (!res.ok) throw new Error(String(res.status));
const blob = await res.blob();
const file = new File([blob], img.filename, { type: blob.type || "video/mp4" });
setSourcePreview(URL.createObjectURL(file), { kind: "local", file });
} catch (err) {
console.warn("[VideoAsset] failed to load preview:", err);
}
}
function _renderDetail(img) {
const panel = document.getElementById("wfm-video-asset-detail");
if (!panel) return;
// Filename/memo are untrusted (filesystem names, user-entered text) — the
// markup skeleton is static, and those two values are assigned afterward
// via textContent/.value, never interpolated into the HTML string itself.
panel.innerHTML = `
<div class="wfm-video-asset-name" id="wfm-video-asset-name"></div>
<label>Tags</label>
<div class="wfm-video-asset-tags" id="wfm-video-asset-tags"></div>
<div style="display:flex;gap:6px;">
<input type="text" id="wfm-video-asset-tag-input" class="wfm-input" placeholder="Add tag" style="flex:1;">
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-tag-add">Add</button>
</div>
<label style="margin-top:10px;">Memo</label>
<textarea id="wfm-video-asset-memo" class="wfm-textarea" rows="3"></textarea>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-memo-save" style="margin-top:6px;">Save Memo</button>
<button type="button" class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-video-asset-open-gallery" style="width:100%;margin-top:12px;">Open in Gallery</button>
`;
const nameEl = document.getElementById("wfm-video-asset-name");
if (nameEl) { nameEl.textContent = img.filename; nameEl.title = img.filename; }
const memoEl = document.getElementById("wfm-video-asset-memo");
if (memoEl) memoEl.value = img.memo || "";
_renderTags(img);
panel.querySelector("#wfm-video-asset-tag-add")?.addEventListener("click", async () => {
const input = panel.querySelector("#wfm-video-asset-tag-input");
const tag = input?.value.trim();
if (!tag) return;
const tags = Array.from(new Set([...(img.tags || []), tag]));
await _saveMeta(img.path, { tags });
img.tags = tags;
input.value = "";
_renderTags(img);
});
panel.querySelector("#wfm-video-asset-memo-save")?.addEventListener("click", async () => {
const memo = panel.querySelector("#wfm-video-asset-memo")?.value || "";
await _saveMeta(img.path, { memo });
img.memo = memo;
});
panel.querySelector("#wfm-video-asset-open-gallery")?.addEventListener("click", () => {
document.querySelector('.wfm-tab[data-tab="gallery"]')?.click();
const filterSel = document.getElementById("wfm-gallery-group-filter");
if (filterSel) {
// ALL_GROUPS_VALUE is a virtual union with no Gallery-side equivalent
// (Gallery's own filter only ever matches one real group) — fall back
// to the curated group, the closer of the two to "everything worth keeping".
filterSel.value = _s.group === ALL_GROUPS_VALUE ? VIDEO_GROUP : _s.group;
filterSel.dispatchEvent(new Event("change"));
}
});
}
function _renderTags(img) {
const container = document.getElementById("wfm-video-asset-tags");
if (!container) return;
const tags = img.tags || [];
container.innerHTML = "";
if (tags.length === 0) {
const placeholder = document.createElement("span");
placeholder.className = "wfm-placeholder";
placeholder.textContent = "No tags";
container.appendChild(placeholder);
return;
}
// Built via DOM APIs (not innerHTML) since tag text is user-entered —
// textContent keeps it inert regardless of what characters it contains.
for (const tag of tags) {
const pill = document.createElement("span");
pill.className = "wfm-video-asset-tag";
pill.append(document.createTextNode(`${tag} `));
const removeBtn = document.createElement("button");
removeBtn.type = "button";
removeBtn.textContent = "×";
removeBtn.addEventListener("click", async () => {
const newTags = tags.filter((t2) => t2 !== tag);
await _saveMeta(img.path, { tags: newTags });
img.tags = newTags;
_renderTags(img);
});
pill.appendChild(removeBtn);
container.appendChild(pill);
}
}
async function _saveMeta(path, data) {
try {
await fetch("/wfm/gallery/image/meta", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ path, ...data }),
});
} catch (err) {
console.warn("[VideoAsset] saveMeta failed:", err);
}
}
// Called whenever the Asset subtab becomes active (see video-tab.js's subtab
// toggle) — always refetches rather than caching, so a Plan run's newly
// generated videos show up as soon as the user switches over to look.
export async function refreshVideoAssetTab() {
if (!_s.loaded) {
_renderGroupSelect();
_s.loaded = true;
}
await _loadImages();
}
export function initVideoAssetTab() {
document.getElementById("wfm-video-asset-group")?.addEventListener("change", (e) => {
_s.group = e.target.value;
_s.selectedPath = null;
const panel = document.getElementById("wfm-video-asset-detail");
if (panel) panel.innerHTML = `<span class="wfm-placeholder">Select a video</span>`;
_loadImages();
});
document.getElementById("wfm-video-asset-refresh")?.addEventListener("click", () => _loadImages());
// Neither reserved group is ever auto-created by a batch run itself (see
// video-plan-tab.js's _ensureVideoAssetGroups, which only ensures
// __Video Temp__ right before a run starts), so a fresh install or a group
// deleted via Gallery's Manage Groups would otherwise never come back on
// its own — add_to_group() happily records membership on individual images
// without ever re-registering the group itself. ensureVideoGroup() ensures
// both __Video Assets__ and __Video Temp__ every time the Asset subtab inits.
ensureVideoGroup();
}
File diff suppressed because it is too large Load Diff
+82
View File
@@ -0,0 +1,82 @@
/**
* Video Tab - shared state for the two center-panel preview panes:
* "source" (#wfm-video-source-preview-video — an Asset selection or a
* locally-dropped file) and "result" (#wfm-video-preview-video — the latest
* generated clip). video-asset-tab.js (Asset selection), video-plan-tab.js
* (batch run results) and video-tab.js (the Video Source drop zone, Frame/GIF
* tools) all need to read or write these. Pulling this into its own module
* lets all three depend on it without needing to import each other —
* video-tab.js already imports both of the others for init/refresh, so a
* reverse import from either back into video-tab.js would create a cycle.
*/
const _PANES = {
source: { video: "wfm-video-source-preview-video", placeholder: "wfm-video-source-preview-placeholder" },
result: { video: "wfm-video-preview-video", placeholder: "wfm-video-preview-placeholder" },
};
const _objectUrls = { source: null, result: null };
// Whichever pane most recently received a video is what the Frame/GIF property
// tabs act on (see getActivePreviewSource/getActivePreviewVideoElement below) —
// an Asset selection or Video Source drop activates "source", a batch run
// finishing a block activates "result".
let _activePane = null; // "source" | "result" | null
let _activeSource = null;
function _setPreview(pane, url, source) {
const ids = _PANES[pane];
const video = document.getElementById(ids.video);
const placeholder = document.getElementById(ids.placeholder);
if (!video || !placeholder) return;
if (_objectUrls[pane]) {
URL.revokeObjectURL(_objectUrls[pane]);
_objectUrls[pane] = null;
}
if (url && url.startsWith("blob:")) _objectUrls[pane] = url;
if (url) {
video.src = url;
video.style.display = "block";
placeholder.style.display = "none";
_activePane = pane;
_activeSource = source;
} else {
video.pause();
video.removeAttribute("src");
video.load();
video.style.display = "none";
placeholder.style.display = "";
if (_activePane === pane) { _activePane = null; _activeSource = null; }
}
}
// Sets (or clears, with url=null) the Asset-selection/Video-Source-drop pane.
export function setSourcePreview(url, source) { _setPreview("source", url, source); }
// Sets (or clears) the generated-result pane — called once per block as a
// batch run's video output comes in.
export function setResultPreview(url, source) { _setPreview("result", url, source); }
// What the Frame/GIF property tabs operate on: { kind: "output"|"input", filename,
// subfolder, type } for anything already on the server, or { kind: "local", file }
// for a picked/dropped file not yet uploaded. null if neither pane has a video.
export function getActivePreviewSource() { return _activeSource; }
// The GIF tab uploads a still-local source on first use and needs to remember
// the resulting server-side reference so a repeat conversion doesn't re-upload —
// this rewrites the active source in place without touching either <video> element.
export function updateActivePreviewSourceRef(source) { _activeSource = source; }
// The <video> element the Frame/GIF tools should read/capture from, or null if
// neither pane currently has a video loaded.
export function getActivePreviewVideoElement() {
if (!_activePane) return null;
return document.getElementById(_PANES[_activePane].video);
}
// Both panes' <video> elements share the same persistent volume setting.
export function getAllPreviewVideoElements() {
return Object.values(_PANES).map((ids) => document.getElementById(ids.video)).filter(Boolean);
}
+126
View File
@@ -0,0 +1,126 @@
/**
* Video Tab - Sidebar "Project" subtab (next to Asset): browses saved Video
* Plan files (ws_videoplan_*.json in video_plan/), independent of which plan
* (if any) is currently loaded in the Plan editor.
*
* Deliberately thin, mirroring video-asset-tab.js's own scope — clicking an
* item hands off to video-plan-tab.js's openSavedVideoPlan() rather than
* re-implementing plan loading here.
*/
import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { escapeHtml } from "./util.js";
import { openSavedVideoPlan } from "./video-plan-tab.js";
const _s = {
plans: [],
activeFilename: null,
loaded: false, // becomes true once the Project subtab has been shown at least once
};
function _formatUpdatedAt(iso) {
if (!iso) return "";
const d = new Date(iso);
if (isNaN(d.getTime())) return "";
return d.toLocaleString();
}
function _renderList() {
const list = document.getElementById("wfm-video-project-list");
if (!list) return;
if (_s.plans.length === 0) {
list.innerHTML = `<span class="wfm-placeholder">${t("videoProjectEmpty")}</span>`;
return;
}
list.innerHTML = "";
for (const plan of _s.plans) list.appendChild(_makeItem(plan));
}
function _makeItem(plan) {
const item = document.createElement("div");
item.className = "wfm-video-project-item" + (plan.filename === _s.activeFilename ? " active" : "");
item.dataset.filename = plan.filename;
const thumb = document.createElement("img");
thumb.className = "wfm-video-project-item-thumb";
thumb.loading = "lazy";
if (plan.thumbnail) thumb.src = plan.thumbnail;
thumb.onerror = () => { thumb.style.visibility = "hidden"; };
const info = document.createElement("div");
info.className = "wfm-video-project-item-info";
const name = document.createElement("div");
name.className = "wfm-video-project-item-name";
name.textContent = plan.name || plan.filename;
name.title = plan.filename;
const meta = document.createElement("div");
meta.className = "wfm-video-project-item-meta";
const blockLabel = t("videoProjectBlockCount", plan.block_count ?? 0);
const updated = _formatUpdatedAt(plan.updated_at);
meta.textContent = updated ? `${blockLabel} · ${updated}` : blockLabel;
meta.title = plan.note || "";
info.append(name, meta);
const deleteBtn = document.createElement("button");
deleteBtn.type = "button";
deleteBtn.className = "wfm-video-project-item-delete";
deleteBtn.textContent = "×";
deleteBtn.title = t("delete");
deleteBtn.addEventListener("click", (e) => {
e.stopPropagation();
_deletePlan(plan);
});
item.append(thumb, info, deleteBtn);
item.addEventListener("click", () => _openPlan(plan));
return item;
}
async function _openPlan(plan) {
_s.activeFilename = plan.filename;
_renderList();
await openSavedVideoPlan(plan.filename);
}
async function _deletePlan(plan) {
if (!window.confirm(t("videoProjectDeleteConfirm", plan.name || plan.filename))) return;
try {
const res = await fetch("/api/wfm/video/plans/delete", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ filename: plan.filename }),
});
const json = await res.json();
if (!res.ok) throw new Error(json.error || `HTTP ${res.status}`);
if (_s.activeFilename === plan.filename) _s.activeFilename = null;
showToast(t("videoProjectDeleted"), "success");
await refreshVideoProjectTab();
} catch (err) {
showToast(`${t("videoProjectDeleteFailed")}: ${err.message}`, "error");
}
}
// Called whenever the Project subtab becomes active (see video-tab.js's prop-tab
// toggle) — always refetches rather than caching, so a plan saved elsewhere
// (Plan pane's Save/Save As) shows up as soon as the user switches over to look.
export async function refreshVideoProjectTab() {
const list = document.getElementById("wfm-video-project-list");
if (!list) return;
try {
const res = await fetch("/api/wfm/video/plans");
if (!res.ok) throw new Error(String(res.status));
_s.plans = await res.json();
_renderList();
} catch (err) {
list.innerHTML = `<span class="wfm-placeholder" style="color:var(--wfm-danger)">${escapeHtml(t("videoProjectLoadListFailed"))}: ${escapeHtml(err.message)}</span>`;
}
_s.loaded = true;
}
export function initVideoProjectTab() {
document.getElementById("wfm-video-project-refresh")?.addEventListener("click", () => refreshVideoProjectTab());
}
+79 -561
View File
@@ -1,272 +1,81 @@
/**
* 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不整合を防ぐ)。
* Video Tab - top-level orchestration for the Plan / Asset / Edit subtabs, plus
* the Frame-capture / GIF-conversion / Video-Source tools (kept exactly as they
* were — they don't depend on which subtab is active and stay visible across
* all three; see video-tab.css's persistent-panel layout).
*
* Batch generation (the former single-shot form) now lives in
* video-plan-tab.js, and per-block workflow manipulation in video-workflow.js.
* This file only re-exports loadWorkflowIntoVideoEditor so workflow-tab.js's
* "Load in Video" button needs no changes.
*/
import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { comfyUI } from "./comfyui-client.js";
import { comfyWorkflow } from "./comfyui-workflow.js";
import { escapeHtml } from "./util.js";
import { applyStoredVideoVolume } from "./settings-tab.js";
import { initVideoPlanTab, loadWorkflowIntoVideoEditor } from "./video-plan-tab.js";
import { initVideoAssetTab, refreshVideoAssetTab } from "./video-asset-tab.js";
import { initVideoProjectTab, refreshVideoProjectTab } from "./video-project-tab.js";
import {
setSourcePreview, getActivePreviewSource, updateActivePreviewSourceRef,
getActivePreviewVideoElement, getAllPreviewVideoElements,
} from "./video-preview.js";
const state = {
templateWorkflow: null,
templateFilename: null,
firstFrameFilename: null,
lastFrameFilename: null,
generating: false,
// Whatever's currently shown in the center preview frame — a just-generated
// result, or a video dropped/picked in the Video Source panel. Used by the
// Frame/GIF property tabs so they work on any video, not just generated ones.
// { kind: "output"|"input", filename, subfolder, type } for anything already on
// the server, or { kind: "local", file } for a picked file not yet uploaded.
previewSource: null,
};
export { loadWorkflowIntoVideoEditor };
// ============================================
// 動画モデルノードの動的特定(ノード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...)は共通しているため同じロジックで
// 処理できる。
// Subtab switching — two INDEPENDENT groups sharing the same .wfm-video-subtab-*
// look, kept deliberately uncoupled: the sidebar's Asset/Project pair collapses
// entirely when re-clicked (nothing needs to always be visible there — Video
// Source covers the "load something to work with" case), while the center
// Plan/Edit pair is a "always exactly one visible" 2-way tab. Querying each
// scoped to its own container (rather than one global querySelectorAll) is
// what keeps clicking one from affecting the other.
// ============================================
// ノードの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);
function _initCenterSubtabToggle() {
const scope = document.querySelector(".wfm-video-center-panel");
if (!scope) return;
scope.querySelectorAll(".wfm-video-subtab-btn").forEach((btn) => {
btn.addEventListener("click", () => {
const target = btn.dataset.videoSubtab;
scope.querySelectorAll(".wfm-video-subtab-btn").forEach((b) => b.classList.remove("active"));
btn.classList.add("active");
scope.querySelectorAll(".wfm-video-subtab-panel").forEach((p) => {
p.style.display = p.dataset.videoSubtabPanel === target ? "" : "none";
});
});
});
}
// 上と同じ並び順ルールで、名前から直接インデックスを引く版(ResolutionSelectorや
// LoadImageなど、モデルファミリー間で入力名が揺れないノードに使う)。
function _widgetIndex(node, name) {
const widgetInputs = (node?.inputs || []).filter((inp) => inp.widget);
return widgetInputs.findIndex((inp) => inp.name === name);
}
// サブグラフが公開する入力は、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;
}
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;
// 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;
};
// 一部の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 rawLastLoadImageNode = findLinkedNode(lastFrameSlot);
const lastLoadImageNode = (rawLastLoadImageNode && rawLastLoadImageNode.type === "LoadImage") ? rawLastLoadImageNode : null;
return {
family, sgDef, instanceNode, loadImageNode, lastLoadImageNode, resolutionNode,
firstFrameSlot, lastFrameSlot, promptIdx, durationIdx,
};
// Sidebar Asset/Project pair: clicking a button shows its panel and hides the
// other; clicking the already-active button collapses it (both panels hidden),
// letting the video preview reclaim the sidebar's width when neither is needed.
function _initSidebarSubtabToggle() {
const sidebar = document.querySelector(".wfm-video-form-panel");
if (!sidebar) return;
const buttons = sidebar.querySelectorAll(".wfm-video-subtab-btn");
buttons.forEach((btn) => {
btn.addEventListener("click", () => {
const target = btn.dataset.videoSubtab;
const panel = document.getElementById(`wfm-video-subtab-${target}`);
const willShow = !!panel && panel.style.display === "none";
buttons.forEach((b) => b.classList.remove("active"));
sidebar.querySelectorAll(".wfm-video-subtab-panel").forEach((p) => { p.style.display = "none"; });
if (willShow) {
btn.classList.add("active");
panel.style.display = "";
if (target === "asset") refreshVideoAssetTab();
else if (target === "project") refreshVideoProjectTab();
}
});
});
}
// ============================================
// ワークフロー読み込み
// ============================================
// 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`);
if (!previewImg || !wrap || !filename) return;
previewImg.src = `${comfyUI.baseUrl}/view?filename=${encodeURIComponent(filename)}&type=input`;
wrap.style.display = "";
}
export async function loadWorkflowIntoVideoEditor(workflow, filename) {
const nodes = locateVideoModelNodes(workflow);
if (!nodes) {
showToast(t("videoUnsupportedWorkflow"), "error");
_updateFieldHighlights(null);
return false;
}
_updateFieldHighlights(nodes);
state.templateWorkflow = workflow;
state.templateFilename = filename || "";
// 前回読み込んだワークフローの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, lastLoadImageNode, promptIdx, durationIdx } = nodes;
const promptEl = document.getElementById("wfm-video-prompt");
if (promptEl) promptEl.value = instanceNode.widgets_values[promptIdx] ?? "";
const durationEl = document.getElementById("wfm-video-duration");
if (durationEl) durationEl.value = instanceNode.widgets_values[durationIdx] ?? 2;
const arIdx = _widgetIndex(resolutionNode, "aspect_ratio");
const mpIdx = _widgetIndex(resolutionNode, "megapixels");
const multIdx = _widgetIndex(resolutionNode, "multiple");
const aspectEl = document.getElementById("wfm-video-aspect-ratio");
if (aspectEl && arIdx !== -1 && resolutionNode.widgets_values[arIdx] != null) {
aspectEl.value = resolutionNode.widgets_values[arIdx];
}
const mpEl = document.getElementById("wfm-video-megapixels");
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;
}
// ============================================
// Aspect Ratio 選択肢(object_infoから動的取得、ハードコードしない)
// ============================================
async function _populateAspectRatioOptions() {
const select = document.getElementById("wfm-video-aspect-ratio");
if (!select) return;
try {
const info = await comfyUI.fetchObjectInfo("ResolutionSelector");
const inputDef = info?.ResolutionSelector?.input?.required?.aspect_ratio;
if (!inputDef) return;
const first = inputDef[0];
let values = null;
if (Array.isArray(first)) values = first;
else if (typeof first === "string" && Array.isArray(inputDef[1]?.values)) values = inputDef[1].values;
else if (typeof first === "string" && Array.isArray(inputDef[1]?.options)) values = inputDef[1].options;
if (!values?.length) return;
select.innerHTML = values.map((v) => `<option value="${escapeHtml(v)}">${escapeHtml(v)}</option>`).join("");
} catch {
// ResolutionSelectorが未導入の環境などは選択肢が空のまま(手入力不可のselectなので実質何もできないが、
// Videoタブ自体の初期化は継続させる)。
}
}
// ============================================
// first_frame / last_frame アップロード
// first_frame / last_frame アップロード(Video Sourceパネル・Frame/GIFタブと共有する
// 汎用ドロップゾーン配線ヘルパー。video-plan-tab.jsのブロック画像アップロードとは別物)
// ============================================
function _wireDropZone(dropZoneId, fileInputId, onFile) {
@@ -285,283 +94,6 @@ function _wireDropZone(dropZoneId, fileInputId, onFile) {
});
}
async function _handleFrameUpload(which, file) {
if (!file || !file.type.startsWith("image/")) return;
const statusEl = document.getElementById(`wfm-video-${which}-frame-status`);
const previewImg = document.getElementById(`wfm-video-${which}-frame-preview`);
const wrap = document.getElementById(`wfm-video-${which}-frame-wrap`);
if (previewImg) previewImg.src = URL.createObjectURL(file);
if (wrap) wrap.style.display = "";
if (statusEl) statusEl.textContent = "Uploading...";
try {
const result = await comfyUI.uploadImage(file, file.name);
if (which === "first") state.firstFrameFilename = result.name;
else state.lastFrameFilename = result.name;
if (statusEl) {
statusEl.textContent = `✓ ${result.name}`;
statusEl.style.color = "var(--wfm-success)";
}
} catch (err) {
if (statusEl) {
statusEl.textContent = `✗ ${err.message}`;
statusEl.style.color = "var(--wfm-danger)";
}
}
}
function _clearFrame(which) {
if (which === "first") state.firstFrameFilename = null;
else state.lastFrameFilename = null;
const wrap = document.getElementById(`wfm-video-${which}-frame-wrap`);
const previewImg = document.getElementById(`wfm-video-${which}-frame-preview`);
const statusEl = document.getElementById(`wfm-video-${which}-frame-status`);
const fileInput = document.getElementById(`wfm-video-${which}-frame-file`);
if (wrap) wrap.style.display = "none";
if (previewImg) previewImg.src = "";
if (statusEl) statusEl.textContent = "";
if (fileInput) fileInput.value = "";
}
// ============================================
// フォーム値の読み取り・ワークフローへの反映
// ============================================
function _readFormValues() {
return {
prompt: document.getElementById("wfm-video-prompt")?.value || "",
aspectRatio: document.getElementById("wfm-video-aspect-ratio")?.value || "",
megapixels: Number(document.getElementById("wfm-video-megapixels")?.value) || 0.2,
multiple: Number(document.getElementById("wfm-video-multiple")?.value) || 32,
duration: Number(document.getElementById("wfm-video-duration")?.value) || 2,
};
}
function _applyFormToWorkflow(nodes, form) {
const { instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx } = nodes;
instanceNode.widgets_values[promptIdx] = form.prompt;
instanceNode.widgets_values[durationIdx] = form.duration;
const arIdx = _widgetIndex(resolutionNode, "aspect_ratio");
const mpIdx = _widgetIndex(resolutionNode, "megapixels");
const multIdx = _widgetIndex(resolutionNode, "multiple");
if (arIdx !== -1) resolutionNode.widgets_values[arIdx] = form.aspectRatio;
if (mpIdx !== -1) resolutionNode.widgets_values[mpIdx] = form.megapixels;
if (multIdx !== -1) resolutionNode.widgets_values[multIdx] = form.multiple;
// 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が未接続のワークフローに対して、画像が指定された時だけ
// LoadImageノードを新規注入する共通ヘルパー。ノードID/リンクIDはclone内の実際の
// 最大値+1で採番するため、重複ID/リンクID不整合は起きない
// (CLAUDE.md記載の既知の落とし穴への対策)。未指定時は何もしない
// (テンプレート由来のlink:nullのまま=クリーンな状態を毎回cloneするので残留の心配がない=バイパス扱い)。
function _injectFrameNode(clone, instanceNode, targetSlot, filename) {
const maxNodeId = Math.max(clone.last_node_id || 0, ...clone.nodes.map((n) => n.id));
const maxLinkId = Math.max(clone.last_link_id || 0, ...clone.links.map((l) => l[0]));
const newNodeId = maxNodeId + 1;
const newLinkId = maxLinkId + 1;
clone.nodes.push({
id: newNodeId,
type: "LoadImage",
pos: [(instanceNode.pos?.[0] || 0) - 260, (instanceNode.pos?.[1] || 0) + 40],
size: [280, 314],
flags: {},
order: clone.nodes.length,
mode: 0,
inputs: [
{ localized_name: "image", name: "image", type: "COMBO", widget: { name: "image" }, link: null },
{ localized_name: "choose file to upload", name: "upload", type: "IMAGEUPLOAD", widget: { name: "upload" }, link: null },
],
outputs: [
{ localized_name: "IMAGE", name: "IMAGE", type: "IMAGE", links: [newLinkId] },
{ localized_name: "MASK", name: "MASK", type: "MASK", links: null },
],
properties: { "Node name for S&R": "LoadImage" },
widgets_values: [filename, "image"],
});
clone.links.push([newLinkId, newNodeId, 0, instanceNode.id, targetSlot, "IMAGE"]);
const targetInput = instanceNode.inputs[targetSlot];
if (targetInput) targetInput.link = newLinkId;
clone.last_node_id = newNodeId;
clone.last_link_id = newLinkId;
}
// ============================================
// 実行
// ============================================
async function runGeneration() {
if (state.generating) return;
if (!state.templateWorkflow) {
showToast(t("videoNoWorkflowLoaded"), "error");
return;
}
const clone = structuredClone(state.templateWorkflow);
const nodes = locateVideoModelNodes(clone);
if (!nodes) {
showToast(t("videoUnsupportedWorkflow"), "error");
return;
}
_applyFormToWorkflow(nodes, _readFormValues());
// first_frame/last_frame: 既存のLoadImageノードが無いワークフロー(T2V構成等)で、
// ユーザーが新たに画像を指定した場合のみノードを注入する。未指定ならバイパス(未接続のまま実行)。
if (!nodes.loadImageNode && state.firstFrameFilename) {
_injectFrameNode(clone, nodes.instanceNode, nodes.firstFrameSlot, state.firstFrameFilename);
}
if (!nodes.lastLoadImageNode && state.lastFrameFilename) {
_injectFrameNode(clone, nodes.instanceNode, nodes.lastFrameSlot, state.lastFrameFilename);
}
const genBtn = document.getElementById("wfm-video-generate-btn");
const progressBar = document.getElementById("wfm-video-progress-bar");
const progressText = document.getElementById("wfm-video-progress-text");
state.generating = true;
if (genBtn) genBtn.disabled = true;
if (progressBar) progressBar.style.width = "0%";
if (progressText) progressText.textContent = "Converting workflow...";
try {
const apiWorkflow = await comfyWorkflow.convertUiToApi(clone);
const seedValue = Number(document.getElementById("wfm-video-noise-seed")?.value) || 0;
const seedMode = document.getElementById("wfm-video-seed-randomize")?.checked ? "random" : "fixed";
const { images, seed } = await comfyUI.generate(apiWorkflow, {
seedMode,
seedValue,
timeoutMs: 30 * 60 * 1000, // 動画生成は静止画より長時間になりうる
onProgress: (pct) => {
if (progressBar) progressBar.style.width = `${(pct * 100).toFixed(1)}%`;
if (progressText) progressText.textContent = `${(pct * 100).toFixed(0)}%`;
},
});
const seedEl = document.getElementById("wfm-video-noise-seed");
if (seedEl) seedEl.value = seed;
const outputMedia = images.filter((img) => img.type !== "temp");
if (progressText) progressText.textContent = t("videoDoneCount", outputMedia.length);
if (progressBar) progressBar.style.width = "100%";
_renderResult(outputMedia);
await _saveGeneratedVideoMeta(outputMedia, apiWorkflow);
showToast(t("videoGenerateSuccess"), "success");
} catch (err) {
showToast(t("errorWithMsg", err.message), "error");
if (progressText) progressText.textContent = "Error";
} finally {
state.generating = false;
if (genBtn) genBtn.disabled = false;
}
}
// ============================================
// 結果表示
// ============================================
// Sets (or clears) the center preview frame's video and records where it came from —
// `source` is what the Frame/GIF property tabs act on (see state.previewSource above).
// Revokes the previous blob: URL (if any) so picking a series of local files doesn't
// leak memory.
let _previewObjectUrl = null;
function _setPreviewMedia(url, source) {
state.previewSource = source;
const video = document.getElementById("wfm-video-preview-video");
const placeholder = document.getElementById("wfm-video-preview-placeholder");
if (!video || !placeholder) return;
if (_previewObjectUrl) {
URL.revokeObjectURL(_previewObjectUrl);
_previewObjectUrl = null;
}
if (url && url.startsWith("blob:")) _previewObjectUrl = url;
if (url) {
video.src = url;
video.style.display = "block";
placeholder.style.display = "none";
} else {
video.pause();
video.removeAttribute("src");
video.load();
video.style.display = "none";
placeholder.style.display = "";
}
}
function _renderResult(images) {
// 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) {
_setPreviewMedia(null, null);
return;
}
const params = new URLSearchParams({ filename: media.filename, subfolder: media.subfolder || "", type: media.type || "output" });
const src = `${comfyUI.baseUrl}/view?${params}`;
_setPreviewMedia(src, {
kind: media.type === "input" ? "input" : "output",
filename: media.filename,
subfolder: media.subfolder || "",
type: media.type || "output",
});
}
// ============================================
// Gallery連携(生成結果のワークフローをサイドカーメタとして保存)
// ============================================
let _outputDir = "";
async function _fetchOutputDir() {
try {
const res = await fetch("/api/wfm/settings/output-dir");
if (res.ok) {
const data = await res.json();
_outputDir = (data.current || "").replace(/\\/g, "/").replace(/\/$/, "");
}
} catch { /* non-critical */ }
}
async function _saveGeneratedVideoMeta(images, workflow) {
if (!_outputDir) await _fetchOutputDir();
if (!_outputDir) return;
for (const img of images) {
if (img.type !== "output") continue;
const parts = [_outputDir];
if (img.subfolder) parts.push(img.subfolder);
parts.push(img.filename);
const path = parts.join("/");
try {
await fetch("/wfm/gallery/image/meta", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ path, workflow }),
});
} catch { /* non-critical */ }
}
}
// ============================================
// i18nの適用(app.jsのapplyI18nToHtml()と同じ「個別要素にt()を適用」方式)
// ============================================
@@ -571,29 +103,17 @@ function _applyVideoI18n() {
const el = document.getElementById(id);
if (el) el.textContent = t(key);
};
setText("wfm-video-title-label", "videoTitle");
setText("wfm-video-first-frame-label", "videoFirstFrame");
setText("wfm-video-last-frame-label", "videoLastFrame");
setText("wfm-video-first-frame-drop-label", "videoDropOrClick");
setText("wfm-video-last-frame-drop-label", "videoDropOrClick");
setText("wfm-video-first-frame-clear", "clear");
setText("wfm-video-last-frame-clear", "clear");
setText("wfm-video-prompt-label", "videoPrompt");
setText("wfm-video-aspect-ratio-label", "videoAspectRatio");
setText("wfm-video-megapixels-label", "videoMegapixels");
setText("wfm-video-multiple-label", "videoMultiple");
setText("wfm-video-duration-label", "videoDuration");
setText("wfm-video-noise-seed-label", "videoNoiseSeed");
setText("wfm-video-randomize-label", "videoRandomizeSeed");
setText("wfm-video-generate-btn", "videoGenerate");
setText("wfm-video-edit-placeholder-label", "videoEditPlaceholder");
setText("wfm-video-source-label", "videoSourceLabel");
setText("wfm-video-source-hint", "videoSourceHint");
setText("wfm-video-source-drop-label", "videoSourceDropLabel");
setText("wfm-video-source-clear", "clear");
setText("wfm-video-preview-placeholder", "videoNoVideo");
setText("wfm-video-source-preview-placeholder", "videoSourcePreviewPlaceholder");
setText("wfm-video-preview-placeholder", "videoResultPreviewPlaceholder");
setText("wfm-video-prop-tab-frame", "videoPropFrame");
setText("wfm-video-prop-tab-gif", "videoPropGif");
setText("wfm-video-subtab-btn-project", "videoPropProject");
setText("wfm-video-project-hint", "videoProjectHint");
setText("wfm-video-frame-hint", "videoFrameHint");
setText("wfm-video-frame-capture-btn", "videoCaptureFrame");
setText("wfm-video-frame-save-btn", "videoSaveToOutput");
@@ -613,12 +133,12 @@ function _wireVideoSourcePanel() {
_wireDropZone("wfm-video-source-drop", "wfm-video-source-file", (file) => {
if (!file.type.startsWith("video/")) return;
const statusEl = document.getElementById("wfm-video-source-status");
_setPreviewMedia(URL.createObjectURL(file), { kind: "local", file });
setSourcePreview(URL.createObjectURL(file), { kind: "local", file });
if (statusEl) { statusEl.textContent = file.name; statusEl.style.color = ""; }
});
document.getElementById("wfm-video-source-clear")?.addEventListener("click", () => {
_setPreviewMedia(null, null);
setSourcePreview(null, null);
const statusEl = document.getElementById("wfm-video-source-status");
if (statusEl) statusEl.textContent = "";
const fileInput = document.getElementById("wfm-video-source-file");
@@ -668,7 +188,7 @@ function _initFrameTab() {
const statusEl = document.getElementById("wfm-video-frame-status");
captureBtn?.addEventListener("click", () => {
const video = document.getElementById("wfm-video-preview-video");
const video = getActivePreviewVideoElement();
if (!video || video.style.display === "none" || !video.videoWidth) {
showToast(t("videoNoSourceLoaded"), "error");
return;
@@ -730,7 +250,7 @@ function _initGifTab() {
const statusEl = document.getElementById("wfm-video-gif-status");
convertBtn?.addEventListener("click", async () => {
if (!state.previewSource) {
if (!getActivePreviewSource()) {
showToast(t("videoNoSourceLoaded"), "error");
return;
}
@@ -740,12 +260,12 @@ function _initGifTab() {
if (progressText) progressText.textContent = "Uploading...";
try {
let ref = state.previewSource;
let ref = getActivePreviewSource();
if (ref.kind === "local") {
const result = await comfyUI.uploadImage(ref.file, ref.file.name);
ref = { kind: "input", filename: result.name, subfolder: result.subfolder || "", type: "input" };
// Cache the uploaded reference so a repeat conversion doesn't re-upload.
state.previewSource = ref;
updateActivePreviewSourceRef(ref);
}
const start = Number(document.getElementById("wfm-video-gif-start")?.value) || 0;
@@ -796,14 +316,11 @@ function _initGifTab() {
export function initVideoTab() {
_applyVideoI18n();
_populateAspectRatioOptions();
_wireDropZone("wfm-video-first-frame-drop", "wfm-video-first-frame-file", (file) => _handleFrameUpload("first", file));
_wireDropZone("wfm-video-last-frame-drop", "wfm-video-last-frame-file", (file) => _handleFrameUpload("last", file));
document.getElementById("wfm-video-first-frame-clear")?.addEventListener("click", () => _clearFrame("first"));
document.getElementById("wfm-video-last-frame-clear")?.addEventListener("click", () => _clearFrame("last"));
document.getElementById("wfm-video-generate-btn")?.addEventListener("click", runGeneration);
_initCenterSubtabToggle();
_initSidebarSubtabToggle();
initVideoPlanTab();
initVideoAssetTab();
initVideoProjectTab();
_wireVideoSourcePanel();
_initPropTabs();
@@ -811,6 +328,7 @@ export function initVideoTab() {
_initGifTab();
// 保存済みの音量を適用し、以降ユーザーがネイティブコントロールで変更した音量も
// 自動保存する(要素自体は永続的なので初期化時に一度呼べば十分)。
applyStoredVideoVolume(document.getElementById("wfm-video-preview-video"));
// 自動保存する(要素自体は永続的なので初期化時に一度呼べば十分)。両方のプレビュー
// ペイン(Asset/Source用・生成結果用)の<video>要素に適用する。
getAllPreviewVideoElements().forEach((video) => applyStoredVideoVolume(video));
}
+276
View File
@@ -0,0 +1,276 @@
/**
* Video workflow helpers — model-family detection and node manipulation for
* MiniMax H3 / LTX-2.5 (Text・Image・First&Last-Frame to Video) / Wan2.2 (Text
* to Video) workflows. Pure functions operating on UI-format workflow JSON,
* with no DOM/state dependency, so both the Plan tab's per-block batch loop
* and (previously) the single-shot form can share the exact same logic.
*/
// ============================================
// 動画モデルノードの動的特定(ノードIDをハードコードしない)
// サブグラフの内部ノード型(Wan2.2のみサブグラフ名)で対象ワークフローの種類を判定し、
// 以降はサブグラフが公開する入力のlabel(無ければname)で意味的にスロットを特定する。
// これによりLTX-2.5の3バリアント間で公開入力のname(text/value/value_1...)が揺れて
// いても、label(prompt/duration/width...)は共通しているため同じロジックで処理できる。
// ============================================
// ノードの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);
}
// 上と同じ並び順ルールで、名前から直接インデックスを引く版(ResolutionSelectorや
// LoadImageなど、モデルファミリー間で入力名が揺れないノードに使う)。
export function widgetIndex(node, name) {
const widgetInputs = (node?.inputs || []).filter((inp) => inp.widget);
return widgetInputs.findIndex((inp) => inp.name === name);
}
// サブグラフが公開する入力は、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;
}
// noise_seedはLTX-2.5のText to Videoバリアントだけlabel="seed"を持つ(他は無label)ため、
// 意味的ラベルではなくname自体(全バリアントで"noise_seed"に統一)で検索する。
function _findInputByName(node, name) {
return (node?.inputs || []).find((inp) => inp.name === name) || 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;
}
export 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;
// 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);
// ワークフローにより有無・意味が異なる任意項目。見つからなければ全て-1を返し、
// 呼び出し側(UI)はその項目を無効化・非ハイライトにする。
const heightInput = _findInputByLabel(instanceNode, "height");
const noiseSeedInput = _findInputByName(instanceNode, "noise_seed");
// MiniMax H3は"turbo_mode"、Wan2.2は"enable_turbo_mode" — 同じ意味のトグルをUI上は
// 1つのフィールドとして兼用するため、どちらか見つかった方を使う。
const turboModeInput = _findInputByLabel(instanceNode, "turbo_mode") || _findInputByLabel(instanceNode, "enable_turbo_mode");
const turboStrengthInput = _findInputByLabel(instanceNode, "turbo_model_strength");
const turboStepsInput = _findInputByLabel(instanceNode, "turbo_steps");
const promptEnhanceInput = _findInputByLabel(instanceNode, "prompt_enhance");
const noiseSeedIdx = _widgetIndexOf(instanceNode, noiseSeedInput);
const turboModeIdx = _widgetIndexOf(instanceNode, turboModeInput);
const turboStrengthIdx = _widgetIndexOf(instanceNode, turboStrengthInput);
const turboStepsIdx = _widgetIndexOf(instanceNode, turboStepsInput);
const promptEnhanceIdx = _widgetIndexOf(instanceNode, promptEnhanceInput);
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;
};
// 一部の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のまま返し、必要ならapplyBlockToWorkflow側で動的にノードを注入する。
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 rawLastLoadImageNode = findLinkedNode(lastFrameSlot);
const lastLoadImageNode = (rawLastLoadImageNode && rawLastLoadImageNode.type === "LoadImage") ? rawLastLoadImageNode : null;
// width/heightはResolutionSelectorがあればその出力に接続されており(widthSlotの
// link経由)、その場合は直接ウィジェット値を書き換えても実行時にリンク元の出力で
// 上書きされ意味がない。resolutionNodeがnullのワークフロー(LTX-2.5 First&Last-Frame,
// Wan2.2全種)でのみ、instanceNode自身のwidth/heightウィジェットを直接編集できる。
const widthIdx = resolutionNode ? -1 : _widgetIndexOf(instanceNode, widthInput);
const heightIdx = resolutionNode ? -1 : _widgetIndexOf(instanceNode, heightInput);
return {
family, sgDef, instanceNode, loadImageNode, lastLoadImageNode, resolutionNode,
firstFrameSlot, lastFrameSlot, promptIdx, durationIdx,
widthIdx, heightIdx, noiseSeedIdx, turboModeIdx, turboStrengthIdx, turboStepsIdx, promptEnhanceIdx,
};
}
// Reads the current values a freshly-loaded template workflow carries, so a UI
// (the Plan tab's first block, previously the single-shot form) can seed its
// fields from whatever the workflow file already had.
export function readTemplateDefaults(nodes) {
const {
instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx,
widthIdx, heightIdx, noiseSeedIdx, turboModeIdx, turboStrengthIdx, turboStepsIdx, promptEnhanceIdx,
} = nodes;
const arIdx = widgetIndex(resolutionNode, "aspect_ratio");
const mpIdx = widgetIndex(resolutionNode, "megapixels");
const multIdx = widgetIndex(resolutionNode, "multiple");
const fnIdx = widgetIndex(loadImageNode, "image");
const lastFnIdx = widgetIndex(lastLoadImageNode, "image");
return {
prompt: instanceNode.widgets_values[promptIdx] ?? "",
duration: instanceNode.widgets_values[durationIdx] ?? 2,
hasResolution: !!resolutionNode,
aspectRatio: (resolutionNode && arIdx !== -1) ? resolutionNode.widgets_values[arIdx] : null,
megapixels: (resolutionNode && mpIdx !== -1) ? resolutionNode.widgets_values[mpIdx] : null,
multiple: (resolutionNode && multIdx !== -1) ? resolutionNode.widgets_values[multIdx] : null,
firstImageFilename: (loadImageNode && fnIdx !== -1) ? loadImageNode.widgets_values[fnIdx] : null,
lastImageFilename: (lastLoadImageNode && lastFnIdx !== -1) ? lastLoadImageNode.widgets_values[lastFnIdx] : null,
// width/heightは resolutionNode がある場合は widthIdx/heightIdx が -1 になる
// (locateVideoModelNodes参照) ため、常にnullが返り直接入力欄は無効化される。
hasDirectResolution: widthIdx !== -1 && heightIdx !== -1,
width: widthIdx !== -1 ? instanceNode.widgets_values[widthIdx] : null,
height: heightIdx !== -1 ? instanceNode.widgets_values[heightIdx] : null,
hasNoiseSeed: noiseSeedIdx !== -1,
noiseSeed: noiseSeedIdx !== -1 ? instanceNode.widgets_values[noiseSeedIdx] : null,
hasTurboMode: turboModeIdx !== -1,
turboMode: turboModeIdx !== -1 ? instanceNode.widgets_values[turboModeIdx] : null,
hasTurboStrength: turboStrengthIdx !== -1,
turboStrength: turboStrengthIdx !== -1 ? instanceNode.widgets_values[turboStrengthIdx] : null,
hasTurboSteps: turboStepsIdx !== -1,
turboSteps: turboStepsIdx !== -1 ? instanceNode.widgets_values[turboStepsIdx] : null,
hasPromptEnhance: promptEnhanceIdx !== -1,
promptEnhance: promptEnhanceIdx !== -1 ? instanceNode.widgets_values[promptEnhanceIdx] : null,
};
}
// first_frame/last_frameが未接続のワークフローに対して、画像が指定された時だけ
// LoadImageノードを新規注入する共通ヘルパー。ノードID/リンクIDはclone内の実際の
// 最大値+1で採番するため、重複ID/リンクID不整合は起きない
// (CLAUDE.md記載の既知の落とし穴への対策)。
export function injectFrameNode(clone, instanceNode, targetSlot, filename) {
const maxNodeId = Math.max(clone.last_node_id || 0, ...clone.nodes.map((n) => n.id));
const maxLinkId = Math.max(clone.last_link_id || 0, ...clone.links.map((l) => l[0]));
const newNodeId = maxNodeId + 1;
const newLinkId = maxLinkId + 1;
clone.nodes.push({
id: newNodeId,
type: "LoadImage",
pos: [(instanceNode.pos?.[0] || 0) - 260, (instanceNode.pos?.[1] || 0) + 40],
size: [280, 314],
flags: {},
order: clone.nodes.length,
mode: 0,
inputs: [
{ localized_name: "image", name: "image", type: "COMBO", widget: { name: "image" }, link: null },
{ localized_name: "choose file to upload", name: "upload", type: "IMAGEUPLOAD", widget: { name: "upload" }, link: null },
],
outputs: [
{ localized_name: "IMAGE", name: "IMAGE", type: "IMAGE", links: [newLinkId] },
{ localized_name: "MASK", name: "MASK", type: "MASK", links: null },
],
properties: { "Node name for S&R": "LoadImage" },
widgets_values: [filename, "image"],
});
clone.links.push([newLinkId, newNodeId, 0, instanceNode.id, targetSlot, "IMAGE"]);
const targetInput = instanceNode.inputs[targetSlot];
if (targetInput) targetInput.link = newLinkId;
clone.last_node_id = newNodeId;
clone.last_link_id = newLinkId;
}
// Writes one block's (or the old single-shot form's) values onto a workflow
// clone already located via locateVideoModelNodes(clone) — `nodes`' node
// references point into `clone` itself. First/last frame images are only
// touched when a filename is actually given: an existing LoadImage node gets
// its widget overwritten, a missing one gets injected on demand, and leaving
// both unset keeps the slot disconnected (bypassed) exactly like the
// template's own clean state.
export function applyBlockToWorkflow(clone, nodes, params) {
const {
instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx, firstFrameSlot, lastFrameSlot,
widthIdx, heightIdx, turboModeIdx, turboStrengthIdx, turboStepsIdx, promptEnhanceIdx,
} = nodes;
instanceNode.widgets_values[promptIdx] = params.prompt || "";
instanceNode.widgets_values[durationIdx] = params.duration;
const arIdx = widgetIndex(resolutionNode, "aspect_ratio");
const mpIdx = widgetIndex(resolutionNode, "megapixels");
const multIdx = widgetIndex(resolutionNode, "multiple");
if (arIdx !== -1) resolutionNode.widgets_values[arIdx] = params.aspectRatio;
if (mpIdx !== -1) resolutionNode.widgets_values[mpIdx] = params.megapixels;
if (multIdx !== -1) resolutionNode.widgets_values[multIdx] = params.multiple;
// widthIdx/heightIdxはresolutionNodeがあるワークフローでは-1固定(locateVideoModelNodes
// 参照)なので、そちらはaspect_ratio/megapixels/multiple経由の計算値のまま変更しない。
if (widthIdx !== -1 && params.width != null) instanceNode.widgets_values[widthIdx] = params.width;
if (heightIdx !== -1 && params.height != null) instanceNode.widgets_values[heightIdx] = params.height;
// noise_seedはここでは書かない — comfyUI.generate()がAPI変換後のワークフロー全体から
// "noise_seed"/"seed"キーを持つ全ノードを一括で上書きする(applySeedToWorkflow)ため、
// ここで書いてもその後必ず上書きされる。Plan全体のシード管理は引き続きそちら任せでよい。
if (turboModeIdx !== -1 && params.turboMode != null) instanceNode.widgets_values[turboModeIdx] = params.turboMode;
if (turboStrengthIdx !== -1 && params.turboStrength != null) instanceNode.widgets_values[turboStrengthIdx] = params.turboStrength;
if (turboStepsIdx !== -1 && params.turboSteps != null) instanceNode.widgets_values[turboStepsIdx] = params.turboSteps;
if (promptEnhanceIdx !== -1 && params.promptEnhance != null) instanceNode.widgets_values[promptEnhanceIdx] = params.promptEnhance;
if (params.firstImageFilename) {
if (loadImageNode) {
const fnIdx = widgetIndex(loadImageNode, "image");
if (fnIdx !== -1) loadImageNode.widgets_values[fnIdx] = params.firstImageFilename;
} else if (firstFrameSlot !== -1) {
injectFrameNode(clone, instanceNode, firstFrameSlot, params.firstImageFilename);
}
}
if (params.lastImageFilename) {
if (lastLoadImageNode) {
const fnIdx = widgetIndex(lastLoadImageNode, "image");
if (fnIdx !== -1) lastLoadImageNode.widgets_values[fnIdx] = params.lastImageFilename;
} else if (lastFrameSlot !== -1) {
injectFrameNode(clone, instanceNode, lastFrameSlot, params.lastImageFilename);
}
}
}
+163 -88
View File
@@ -2090,17 +2090,19 @@
<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 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>
<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. The center panel's Plan / Edit subtabs handle batch generation and (future) editing; the sidebar's Asset / Project subtabs handle browsing generated videos and saved plans.</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. 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 the loaded video workflow first; Clear resets it back to empty.</li>
<li id="wfm-help-video-1">Plan subtab: the topbar's settings row holds Aspect Ratio / Megapixels / Multiple / Duration (seconds) / Noise Seed as this plan's base settings — Duration always reflects the currently selected block (each block keeps its own value), the rest are plan-wide. A second row below adds Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance, each enabled only for workflows that actually support it (see helpVideo2). Split the timeline into blocks with the + Split / + Block / Delete buttons — each block has its own Prompt, Duration, and First/Last Image — First Image can be None, an explicit image, or "use previous block's last frame" (an explicit Last Image on the previous block always wins over extracting one from its generated video). Click Run to generate every block in order; Pause/Cancel work mid-run.</li>
<li id="wfm-help-video-2">A plan with a single block behaves exactly like the old one-shot form. Model selection (UNet / CLIP / VAE / Audio VAE) is fixed to the loaded workflow's defaults. For workflows with no ResolutionSelector node (e.g. Wan2.2, LTX-2.5 First & Last Frame to Video), the Aspect Ratio / Megapixels / Multiple fields are disabled and the workflow's own Width / Height become directly editable instead. Turbo Mode / Strength / Steps only apply to MiniMax H3's turbo LoRA, and Prompt Enhance only to LTX-2.5 — both stay disabled for other model families. Noise Seed is disabled for the one workflow that doesn't expose it: Wan2.2 Text-to-Video.</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 — this starts a fresh single-block plan seeded from the workflow's own current values. Unsupported workflows show an error instead.</li>
<li id="wfm-help-video-4">Generated videos (mp4) automatically appear in the Asset subtab's Video Temp group, and can also be browsed and played back in the Gallery tab. Organizing keepers into Video Assets is entirely up to you, on your own schedule.</li>
<li id="wfm-help-video-5">The center panel shows two previews: the left one shows either the video you select in the Asset subtab or whatever you drop/pick in the Video Source panel on its left (Clear resets it to empty), letting you use the Frame/GIF tools without running the loaded video workflow first; the right one always shows the most recently generated clip.</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>
<li id="wfm-help-video-8">Chaining: setting a block's First Image to "use previous block's last frame" continues smoothly from the previous clip — if that previous block has its own explicit Last Image, that image is used directly; otherwise the actual last frame of its generated video is extracted automatically.</li>
<li id="wfm-help-video-9">Project tab (sidebar, next to Asset): browse every saved plan file (thumbnail, block count, last updated), click one to load it into the Plan editor, or delete it with the × button; clicking the same tab again collapses the panel.</li>
<li id="wfm-help-video-10">Highlight color: the Prompt / Duration / First Image / Last Image / Aspect Ratio / Megapixels / Multiple / Noise Seed / Width / Height / Turbo Mode / Strength / Steps / Prompt Enhance 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 while Width / Height light up instead.</li>
</ul>
</div>
<button class="wfm-help-jump-btn wfm-btn wfm-btn-sm" data-jump-tab="video">Go to Video Tab</button>
@@ -2685,99 +2687,42 @@
</div>
</section>
<!-- Video Tab (MiniMax H3 / LTX-2.5対応・GenerateUIタブとは独立) -->
<!-- Video Tab (Plan[バッチ動画生成]/Asset[素材管理]/Edit[将来機能]の3サブタブ。
中央のプレビュー+右のFrame/GIFプロパティパネルはサブタブ切替と独立した常時表示) -->
<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</h3>
<span id="wfm-video-wf-name" class="wfm-video-wf-name">No workflow loaded</span>
<div class="wfm-video-subtab-nav">
<button type="button" class="wfm-video-subtab-btn" data-video-subtab="asset" id="wfm-video-subtab-btn-asset">Asset</button>
<button type="button" class="wfm-video-subtab-btn" data-video-subtab="project" id="wfm-video-subtab-btn-project">Project</button>
</div>
<div class="wfm-video-frame-slots">
<div class="wfm-video-frame-slot">
<label id="wfm-video-first-frame-label">First Frame (optional)</label>
<div class="wfm-i2i-preview-wrap" id="wfm-video-first-frame-wrap" style="display:none;">
<img class="wfm-i2i-preview-img" id="wfm-video-first-frame-preview">
</div>
<div class="wfm-i2i-drop-zone" id="wfm-video-first-frame-drop">
<label class="wfm-i2i-drop-label">
<span id="wfm-video-first-frame-drop-label">Drop image or click to select</span>
<input type="file" accept="image/*" id="wfm-video-first-frame-file" style="display:none;">
</label>
</div>
<div style="display:flex;gap:6px;align-items:center;">
<span class="wfm-i2i-status" id="wfm-video-first-frame-status" style="flex:1;"></span>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-first-frame-clear">Clear</button>
</div>
<!-- Asset: このPlanが生成した動画の素材管理(Galleryのグループ機能を再利用) -->
<div id="wfm-video-subtab-asset" class="wfm-video-subtab-panel" data-video-subtab-panel="asset" style="display:none;">
<div style="display:flex;gap:6px;align-items:center;">
<select id="wfm-video-asset-group" class="wfm-input" style="flex:1;"></select>
<button type="button" id="wfm-video-asset-refresh" class="wfm-btn wfm-btn-sm" title="Refresh">↻</button>
</div>
<div class="wfm-video-frame-slot">
<label id="wfm-video-last-frame-label">Last Frame (optional)</label>
<div class="wfm-i2i-preview-wrap" id="wfm-video-last-frame-wrap" style="display:none;">
<img class="wfm-i2i-preview-img" id="wfm-video-last-frame-preview">
</div>
<div class="wfm-i2i-drop-zone" id="wfm-video-last-frame-drop">
<label class="wfm-i2i-drop-label">
<span id="wfm-video-last-frame-drop-label">Drop image or click to select</span>
<input type="file" accept="image/*" id="wfm-video-last-frame-file" style="display:none;">
</label>
</div>
<div style="display:flex;gap:6px;align-items:center;">
<span class="wfm-i2i-status" id="wfm-video-last-frame-status" style="flex:1;"></span>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-last-frame-clear">Clear</button>
</div>
<span id="wfm-video-asset-status" class="wfm-i2i-status"></span>
<div class="wfm-video-asset-grid" id="wfm-video-asset-grid"></div>
<div class="wfm-video-asset-detail" id="wfm-video-asset-detail">
<span class="wfm-placeholder">Select a video</span>
</div>
</div>
<label for="wfm-video-prompt" id="wfm-video-prompt-label">Prompt</label>
<textarea id="wfm-video-prompt" class="wfm-textarea" rows="6"></textarea>
<div class="wfm-video-resolution-row">
<div>
<label for="wfm-video-aspect-ratio" id="wfm-video-aspect-ratio-label">Aspect Ratio</label>
<select id="wfm-video-aspect-ratio" class="wfm-input"></select>
<!-- Project: 保存済みVideo Plan一覧(クリックでPlanエディタへ読み込み) -->
<div id="wfm-video-subtab-project" class="wfm-video-subtab-panel" data-video-subtab-panel="project" style="display:none;">
<div style="display:flex;gap:6px;align-items:center;">
<p class="wfm-video-prop-hint" id="wfm-video-project-hint" style="flex:1;margin:0;">Saved plans</p>
<button type="button" id="wfm-video-project-refresh" class="wfm-btn wfm-btn-sm" title="Refresh">↻</button>
</div>
<div>
<label for="wfm-video-megapixels" id="wfm-video-megapixels-label">Megapixels</label>
<input type="number" id="wfm-video-megapixels" class="wfm-input" step="0.01" min="0.01" value="0.2">
</div>
<div>
<label for="wfm-video-multiple" id="wfm-video-multiple-label">Multiple</label>
<input type="number" id="wfm-video-multiple" class="wfm-input" step="8" min="8" value="32">
</div>
</div>
<div class="wfm-video-resolution-row">
<div>
<label for="wfm-video-duration" id="wfm-video-duration-label">Duration (seconds)</label>
<input type="number" id="wfm-video-duration" class="wfm-input" step="0.5" min="0.5" value="2">
</div>
<div>
<label for="wfm-video-noise-seed" id="wfm-video-noise-seed-label">Noise Seed</label>
<input type="number" id="wfm-video-noise-seed" class="wfm-input" value="0">
</div>
<div class="wfm-video-seed-randomize-wrap">
<label><input type="checkbox" id="wfm-video-seed-randomize" checked> <span id="wfm-video-randomize-label">Randomize</span></label>
</div>
</div>
<div style="display:flex;align-items:center;gap:10px;margin-top:10px;">
<button id="wfm-video-generate-btn" class="wfm-btn wfm-btn-primary" style="flex:1;">Generate</button>
</div>
<div class="wfm-gen-progress-container">
<div class="wfm-gen-progress-track">
<div id="wfm-video-progress-bar" class="wfm-gen-progress-bar"></div>
</div>
<span id="wfm-video-progress-text" class="wfm-gen-progress-text">Ready</span>
<div class="wfm-video-project-list" id="wfm-video-project-list"></div>
</div>
</div>
<!-- 中央ペイン: プレビュー(生成結果 or ドロップされた任意の動画) + 編集(将来機能用プレースホルダー) -->
<!-- 中央ペイン: プレビュー(常時表示) + Plan/Editタブ(バッチ生成編集・将来の動画編集機能)。
左のAssetサブタブ切替とは独立して常に表示される -->
<div class="wfm-video-center-panel">
<div class="wfm-video-preview-row">
<div class="wfm-video-preview-frame" id="wfm-video-preview-frame">
<span class="wfm-placeholder" id="wfm-video-preview-placeholder">No video</span>
<video id="wfm-video-preview-video" class="wfm-video-preview-el" controls style="display:none;"></video>
</div>
<div class="wfm-video-source-panel">
<div class="wfm-video-pane-header" id="wfm-video-source-label">Video Source</div>
<p class="wfm-video-prop-hint" id="wfm-video-source-hint">Load any video here to use Frame/GIF tools without generating one.</p>
@@ -2792,12 +2737,142 @@
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-source-clear">Clear</button>
</div>
</div>
<div class="wfm-video-preview-frame" id="wfm-video-source-preview-frame">
<span class="wfm-placeholder" id="wfm-video-source-preview-placeholder">Asset / Source Preview</span>
<video id="wfm-video-source-preview-video" class="wfm-video-preview-el" controls style="display:none;"></video>
</div>
<div class="wfm-video-preview-frame" id="wfm-video-preview-frame">
<span class="wfm-placeholder" id="wfm-video-preview-placeholder">Generated Video Preview</span>
<video id="wfm-video-preview-video" class="wfm-video-preview-el" controls style="display:none;"></video>
</div>
</div>
<div class="wfm-video-edit-panel">
<div class="wfm-video-subtab-nav wfm-video-center-subtab-nav">
<button type="button" class="wfm-video-subtab-btn active" data-video-subtab="plan">Plan</button>
<button type="button" class="wfm-video-subtab-btn" data-video-subtab="edit">Edit</button>
</div>
<!-- Plan: バッチ動画生成のタイムライン編集・実行(中央下部、Planタブ選択時のみ表示) -->
<div id="wfm-video-plan-content" class="wfm-video-subtab-panel wfm-video-plan-content" data-video-subtab-panel="plan">
<div class="wfm-video-plan-topbar">
<div class="wfm-video-wf-row">
<span id="wfm-video-wf-name" class="wfm-video-wf-name">No workflow loaded</span>
<div class="wfm-lab-plan-workflow-row" id="wfm-video-plan-workflow-row" style="display:none;">
<span id="wfm-video-plan-workflow-name" class="wfm-lab-plan-workflow-name"></span>
<button type="button" id="wfm-video-plan-workflow-load-btn" class="wfm-btn wfm-btn-xs" title="Load this plan's recorded workflow">Open Workflow</button>
</div>
</div>
<div class="wfm-video-plan-basesettings">
<div>
<label for="wfm-video-plan-aspect-ratio" id="wfm-video-plan-aspect-ratio-label">Aspect Ratio</label>
<select id="wfm-video-plan-aspect-ratio" class="wfm-input"></select>
</div>
<div>
<label for="wfm-video-plan-megapixels" id="wfm-video-plan-megapixels-label">Megapixels</label>
<input type="number" id="wfm-video-plan-megapixels" class="wfm-input" step="0.01" min="0.01" value="0.2">
</div>
<div>
<label for="wfm-video-plan-multiple" id="wfm-video-plan-multiple-label">Multiple</label>
<input type="number" id="wfm-video-plan-multiple" class="wfm-input" step="8" min="8" value="32">
</div>
<div>
<label for="wfm-video-block-duration" id="wfm-video-block-duration-label">Duration (seconds)</label>
<input type="number" id="wfm-video-block-duration" class="wfm-input" step="0.5" min="0.5" value="2">
</div>
<div>
<label for="wfm-video-plan-seed-value" id="wfm-video-plan-seed-value-label">Noise Seed</label>
<div class="wfm-video-seed-inline">
<input type="number" id="wfm-video-plan-seed-value" class="wfm-input" value="0">
<label class="wfm-video-seed-randomize-inline"><input type="checkbox" id="wfm-video-plan-seed-randomize" checked> Rand</label>
</div>
</div>
</div>
<div class="wfm-video-plan-extrasettings">
<div>
<label for="wfm-video-plan-width" id="wfm-video-plan-width-label">Width</label>
<input type="number" id="wfm-video-plan-width" class="wfm-input" step="16" min="16" value="1280">
</div>
<div>
<label for="wfm-video-plan-height" id="wfm-video-plan-height-label">Height</label>
<input type="number" id="wfm-video-plan-height" class="wfm-input" step="16" min="16" value="720">
</div>
<div>
<label id="wfm-video-plan-turbo-mode-label">Turbo Mode</label>
<label class="wfm-video-checkbox-inline"><input type="checkbox" id="wfm-video-plan-turbo-mode"> Enabled</label>
</div>
<div>
<label for="wfm-video-plan-turbo-strength" id="wfm-video-plan-turbo-strength-label">Strength</label>
<input type="number" id="wfm-video-plan-turbo-strength" class="wfm-input" step="0.05" min="0" value="1">
</div>
<div>
<label for="wfm-video-plan-turbo-steps" id="wfm-video-plan-turbo-steps-label">Steps</label>
<input type="number" id="wfm-video-plan-turbo-steps" class="wfm-input" step="1" min="1" value="8">
</div>
<div>
<label id="wfm-video-plan-prompt-enhance-label">Prompt Enhance</label>
<label class="wfm-video-checkbox-inline"><input type="checkbox" id="wfm-video-plan-prompt-enhance"> Enabled</label>
</div>
</div>
</div>
<div class="wfm-video-timeline-wrap">
<div class="wfm-video-timeline-track" id="wfm-video-timeline-track"></div>
<div class="wfm-video-timeline-toolbar">
<button type="button" id="wfm-video-block-split-btn" class="wfm-btn wfm-btn-xs">+ Split</button>
<button type="button" id="wfm-video-block-add-btn" class="wfm-btn wfm-btn-xs">+ Block</button>
<button type="button" id="wfm-video-block-delete-btn" class="wfm-btn wfm-btn-xs">Delete</button>
</div>
</div>
<div class="wfm-video-plan-main-row">
<div class="wfm-video-block-editor" id="wfm-video-block-editor"></div>
<div class="wfm-video-runplan-panel">
<div class="wfm-video-runplan-tabnav">
<button type="button" class="wfm-video-runplan-tab active" data-runplan-tab="run">Run</button>
<button type="button" class="wfm-video-runplan-tab" data-runplan-tab="plan">Plan</button>
</div>
<div id="wfm-video-runplan-run" class="wfm-video-runplan-content active">
<div style="display:flex;gap:6px;">
<button id="wfm-video-plan-run-btn" class="wfm-btn wfm-btn-primary" style="flex:1;">Run</button>
<button id="wfm-video-plan-cancel-btn" class="wfm-btn wfm-btn-danger" style="display:none;">Cancel</button>
</div>
<button id="wfm-video-plan-pause-btn" class="wfm-btn" style="width:100%;margin-top:6px;" disabled>Pause</button>
<div class="wfm-gen-progress-container" style="margin-top:8px;">
<div class="wfm-gen-progress-track">
<div id="wfm-video-plan-progress-bar" class="wfm-gen-progress-bar"></div>
</div>
<span id="wfm-video-plan-progress-text" class="wfm-gen-progress-text">Ready</span>
</div>
</div>
<div id="wfm-video-runplan-plan" class="wfm-video-runplan-content" style="display:none;">
<label>Note</label>
<textarea id="wfm-video-plan-note" class="wfm-input wfm-lab-note" rows="3"></textarea>
<button id="wfm-video-plan-save-btn" class="wfm-btn wfm-btn-primary" style="width:100%;margin-top:8px;">Plan Save</button>
<button id="wfm-video-plan-saveas-btn" class="wfm-btn" style="width:100%;margin-top:6px;">Save As</button>
<button id="wfm-video-plan-clear-btn" class="wfm-btn" style="width:100%;margin-top:6px;">Plan Clear</button>
<div class="wfm-i2i-drop-zone" id="wfm-video-plan-drop-zone" style="margin-top:10px;">
<label class="wfm-i2i-drop-label">
<input type="file" id="wfm-video-plan-file-input" accept="application/json,.json,image/png,.png" style="display:none;">
Drop plan (.json/.png) here or click to select
</label>
</div>
</div>
</div>
</div>
</div>
<!-- Edit: 将来の動画編集機能用プレースホルダー -->
<div id="wfm-video-subtab-edit" class="wfm-video-subtab-panel wfm-video-edit-panel" data-video-subtab-panel="edit" style="display:none;">
<span id="wfm-video-edit-placeholder-label" class="wfm-placeholder">Editing tools coming soon</span>
</div>
</div>
<!-- 右ペイン: プロパティ(Frame抽出 / GIF変換の2タブ) -->
<!-- 右ペイン: プロパティ(Frame抽出 / GIF変換の2タブ)。中央ペインと同様に常時表示 -->
<div class="wfm-video-properties-panel">
<div class="wfm-video-prop-tabnav">
<button type="button" class="wfm-video-prop-tab active" data-prop-tab="frame" id="wfm-video-prop-tab-frame">Frame</button>