Compare commits

...
32 Commits
Author SHA1 Message Date
ketle-manandClaude Opus 5.5 db1e834f86 release: v0.9.2 — fix corrupted image transfers with selector event loop
- With windows_selector_event_loop enabled, Gallery previews/downloads could
  arrive corrupted (same size, one 32KB block replaced by the next block).
  Set AIOHTTP_NOSENDFILE when switching to the selector loop.
- DEVLOG updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:54:23 +09:00
ketle-manandClaude Opus 5.5 1db6fda6f1 fix: corrupted file transfers with selector event loop on Windows
With windows_selector_event_loop enabled, aiohttp FileResponse goes through
asyncio's _sendfile_fallback, which reuses a 16KB buffer while the selector
transport queues unsent data without copying. Under backpressure later reads
overwrite queued blocks, so Gallery previews/downloads arrived corrupted
(same size, shifted 32KB block). Set AIOHTTP_NOSENDFILE when switching loops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:53:22 +09:00
ketle-manandClaude Opus 5.5 6cdf4919e4 release: v0.9.1 — TagSpace: add selected tags, Open in Gallery
- Add only the tags picked in the Selection panel ("Add selected (N)")
- Tag / Gallery-image chips re-escape parentheses (no accidental emphasis)
- "Open in Gallery" for a selected Gallery point (revealInGallery)
- Manual (ja/en) renamed to v0.9.1; DEVLOG updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:50:13 +09:00
ketle-manandClaude Opus 5.5 d9fc3bfcda feat(tagspace): "Open in Gallery" for a selected Gallery point
New gallery-tab export revealInGallery(path): switches to the Gallery /
Output subtab, clears search/favorite/tag/group filters and similar mode,
expands the folder tree down to the image's folder, loads it, renders
thumbnail pages up to the image (keeping the infinite-scroll sentinel at
the end) and selects it like a normal click. Returns false for paths
outside the output folder or not in the list; TagSpace shows a toast.
Help tagspace-10 (en/ja/zh), README, manual 11-7 (ja/en, combined/ZIP
rebuilt), DEVLOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:48:49 +09:00
ketle-manandClaude Opus 5.5 410fdbc1bb feat(tagspace): add only the selected tags; escape parentheses in tag chips
- With tags picked in the Selection panel, Add becomes "Add selected (N)"
  and adds just those tags (prompt order) as one chip; with none picked it
  adds the whole item as before.
- Tags are stored unescaped, so "rapunzel (disney)" went into prompts as an
  emphasis group. Tag and Gallery-image chips now re-escape parentheses
  (\( \)), matching card prompts so duplicates still collapse.
- Help tagspace-10 (en/ja/zh), README, manual 11-7 (ja/en, combined/ZIP
  rebuilt), DEVLOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:44:31 +09:00
ketle-manandClaude Opus 5.5 fc635f0618 release: v0.9.0 — TagSpace tab
- New TagSpace tab: tags, ImagePrompt cards and Gallery images laid out
  in EmbeddingGemma 2 space (3D), with Tagger fill, All tags / Min uses /
  Wildcards options, tag picking from cards and Gallery images, prompt
  building into GenerateUI
- Wildcard YAML parsed with PyYAML (multi-line items)
- Ollama embedding: retry on local port exhaustion
- Manual (text-only, ja/en) updated to v0.9.0
- DEVLOG / README updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:53:51 +09:00
ketle-manandClaude Opus 5.5 9cdfa44130 docs: update manual to v0.9.0 (TagSpace, Ollama semantic search, Reference to Video)
Revise the Japanese and English text-only manuals from v0.8.9 to v0.9.0:
new TagSpace section (11-7), Gallery semantic search on Ollama, PixAI
Tagger and GPU check, GenerateUI Input tab layout and Raw JSON folding,
Fibo 2.0 / FastH3 / Pika-H3-Flex, Video Plan Reference Image, Comic
Creator multi-reference runs, and troubleshooting entries. Combined MD,
ZIP and README rebuilt from the chapter files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:51:54 +09:00
ketle-manandClaude Opus 5.5 30ccd838fb Merge branch 'feature/tagspace-tab'
TagSpace tab (unreleased). DEVLOG: TagSpace notes moved into a new
"unreleased" section above v0.8.14 (the auto-merge had put them inside the
released v0.8.14 section); the duplicated Ollama migration notes stay under
v0.8.14 only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:45:40 +09:00
ketle-manandClaude Opus 5.5 6dd7f7523b feat(tagspace): pick a card's tags and search the space with them
Cards get normalized `tags` at build time (same split_tags as Gallery
points); the detail panel shares one tagPicker() for cards and Gallery
images, with the card's full prompt kept in a collapsible "Full prompt".
Cards without tags (or spaces built before this) still show the full text.
Help tagspace-10 (en/ja/zh), README, DEVLOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:35:25 +09:00
ketle-manandClaude Opus 5.5 645dbd8283 feat(tagspace): pick a Gallery image's tags and search the space with them
The selected Gallery point's prompt tags are shown as toggle buttons; the
chosen ones (kept until another item is selected) are joined in prompt
order and passed to the existing space search. The action row sticks to
the bottom of the detail panel so it stays reachable with many tags.
Help tagspace-10 (en/ja/zh, helpIdMap), README, DEVLOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:30:41 +09:00
ketle-manandClaude Opus 5.5 95b3627bd5 fix(tagspace): pick the point nearest the cursor on screen when zoomed in
The raycaster used a fixed world-space threshold (0.12) and took the first
hit, i.e. the one nearest the camera, so after zooming into the cloud a
single near point stayed "hovered" across a wide area and clicks kept
selecting it. Widen the candidate threshold, project each hit to the
screen, and choose the one closest to the cursor (within 8px, or the
drawn radius of enlarged points).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:22:03 +09:00
ketle-manandClaude Opus 5.5 cd35f7bdd2 feat(tagspace): All tags / Min uses / Wildcards options, cleaner tags, Ollama port-exhaustion retry
- Toolbar: All tags (max_tags=0, capped at 20,000), Min uses (1/2/3/5,
  total count over all sources), Wildcards on/off as a tag source; build
  meta records them plus tags_available, shown as "(of N candidates)".
  Defaults reproduce the previous 2000-tag result exactly.
- normalize_tag: drop JSON fragments embedded in prompts ("key": — MOSS-Image
  bbox layouts / text specs formed an isolated cluster of 234 tags) and model
  file names, strip stray double quotes, drop embedding: revealed after
  unwrapping parentheses.
- semantic_ollama: treat "Only one usage of each socket address" (loopback
  TIME_WAIT exhaustion from Ollama's per-input runner connections) as
  transient and wait 30s before retrying.
- Help tagspace-9 (en/ja/zh, helpIdMap), README, DEVLOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:06:19 +09:00
ketle-manandClaude Opus 5.5 24e082ecc2 feat(tagspace): parse wildcard YAML with PyYAML (block scalars, escapes)
The line-based reader took "- >-" as an item and dropped the block scalar's
body, and kept escapes like \u2019 literally. Read YAML with CSafeLoader
(SafeLoader fallback), take only string leaves (no keys, no bool/number
values), and fall back to the line reader for files that fail to parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:05:49 +09:00
ketle-manandClaude Opus 5.5 8fc1a9c68c release: v0.8.14 — Fibo 2.0 / FastH3 OmniRef / Pika-H3-Flex support
- GenerateUI / Metadata / side panel I tab: TextEncodeFibo2 and
  MiniMaxH3ReferenceToVideo prompt detection
- Video Plan tab: FastH3-family Reference to Video (Reference Image /
  Reference Image 2, unset references disconnected)
- Gallery semantic search on Ollama (EmbeddingGemma 2) instead of ONNX
- DEVLOG updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:56:12 +09:00
ketle-manandClaude Opus 5.5 805a4fa30f feat(video): disconnect unset reference images on Reference-to-Video plans
FastH3 / Pika-H3-Flex: a Reference Image / Reference Image 2 field left as
None/Clear now unlinks that ref_images input (and drops the template's
LoadImage once nothing else uses it) instead of silently generating with the
template's wired image. Other video families keep their existing behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:39:08 +09:00
ketle-manandClaude Opus 5.5 d6752c018c feat(video): Reference Image 2 for FastH3 / Pika-H3-Flex Plan blocks
Reuse the Plan block's Last Image field as Reference Image 2
(ref_images.ref_image_1) on Reference-to-Video templates: existing LoadImage
is overwritten or one is injected. Labels (Plan + Asset buttons/toasts)
switch to Reference Image / Reference Image 2. For chain_previous, Reference
Image 2 is never taken as the previous block's last frame — the generated
last frame is extracted instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:36:24 +09:00
ketle-manandClaude Opus 5.5 0039dd4f5b feat(video): support FastH3 OmniRef (MiniMax H3 Reference to Video) in Plan tab
FastH3 is a flat graph (no subgraph), so each field is written to the node
its input is wired from: prompt -> PrimitiveStringMultiline, duration ->
PrimitiveFloat (or length frames on the node itself, snapped to 17k+5),
resolution -> ResolutionSelector, First Image -> ref_images.ref_image_0
(labelled "Reference Image"; Last Image unavailable). widgetIndex falls back
to a default widget order for nodes saved without widget input entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:17:19 +09:00
ketle-manandClaude Opus 5.5 f5ea682440 feat(generateui): support Fibo 2.0 Edit and FastH3 OmniRef prompt detection
- TextEncodeFibo2: fixed positive/negative roles (prompt via PreviewAny ->
  PE switch chain), negative_prompt prompt node, width/height/batch_size
- MiniMaxH3ReferenceToVideo: treated as a video all-in-one node
  (VIDEO_ALL_IN_ONE_RE); a linked prompt source is seeded as positive
- Metadata / side panel I tab: resolve linked video prompts, split Fibo2
  positive/negative

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:17:19 +09:00
ketle-manandClaude Opus 5.5 91d096b69b docs(tagspace): help/README/DEVLOG for glow, twinkle and hover preview
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 21:33:08 +09:00
ketle-manandClaude Opus 5.5 73cfaca0bc feat(tagspace): glowing/twinkling points, hover zoom, click-to-select
- Points glow like stars (additive glow texture on a night-sky background);
  Gallery points are dimmed so dense areas don't wash out. "Glow" toggle.
- Twinkle: per-point phase/speed brightness modulation injected into
  PointsMaterial (onBeforeCompile). "Twinkle" toggle (effective with Glow).
- Hovering images in Selection / Nearby shows a 360px enlarged preview.
- Add/Remove button moved to the sticky title row of Selection.
- Clicking a point only selects it; double-click (or Add / +) adds/removes.
  Hint, empty-prompt text, help (en/ja/zh) and README updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 21:29:01 +09:00
ketle-manandClaude Opus 5.5 75269ce38d feat(tagspace): list neighbors for Gallery points
Selecting a Gallery point used to leave the previous list in place:
select() skipped the request and the neighbor matrix had no background
vectors. The background vectors are now saved with the space, centered
matrices are cached per kind, and a Gallery point lists similar Gallery
images, tags and cards interleaved. Cards, tags and searches still list
cards and tags only. Gallery images get round thumbnails in the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 19:05:28 +09:00
ketle-manandClaude Opus 5.5 9958000d25 docs(tagspace): record Tagger fill speed on GPU after onnxruntime-gpu fix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 18:07:39 +09:00
ketle-manandClaude Opus 5.5 2c513bb8bd feat(tagspace): Tagger fill for Gallery images without a prompt
- "Tagger fill" toolbar option: ONNX model from the Tagger tab, scope
  "Gallery points only" or "All images without a prompt"
- TaggerService.tag_image(): default thresholds (WD 0.35/0.85, PixAI
  recommended), rating labels dropped
- results cached per image and model (tagspace_tagger.json), saved every
  100 images so stopping keeps finished work; model unloaded afterwards
  unless the Tagger tab had it loaded
- new "Tagger fill" source; Gallery points fall back to Tagger tags,
  marked "(Tagger fill)"; progress shows CUDA/CPU
- help (en/ja/zh), README, DEVLOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:35:22 +09:00
ketle-manandClaude Opus 5.5 1011af7261 feat(tagspace): show or hide tags by source
The legend (ImagePrompt / Gallery prompts / Tagger DB / Prompt library /
Wildcards) becomes checkboxes. A tag stays visible while any of its sources
is on and takes the color of its first visible source; hidden tags are also
left out of the nearby/search lists, highlights and labels. Remembered in
localStorage. Help (en/ja/zh) and README updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:18:11 +09:00
ketle-manandClaude Opus 5.5 7c4899cc65 style(tagspace): move the Prompt panel to its own column on the right
The output textarea now fills the column height; chips take only the
height they need (up to 40%).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:10:12 +09:00
ketle-manandClaude Opus 5.5 2ef13a6662 feat(tagspace): add tags from Gallery image prompts, clickable Gallery points
- read the positive prompt embedded in indexed Gallery images (upstream from the
  sampler's positive input, never the negative), cached in tagspace_prompts.json
- prompts split at commas only; new "Gallery prompts" tag source
- tags picked round-robin across sources (ranked by number of prompts using the
  tag) so the many Gallery prompts do not crowd out the other sources
- Gallery points carry their prompt tags; clicking adds them as one chip
- fix: background points had no kind (hover/click showed undefined)
- fix: skip images deleted after indexing (thumbnail 404s)
- help (en/ja/zh), README, DEVLOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:04:11 +09:00
ketle-manandClaude Opus 5.5 d861d8c76d feat: add TagSpace tab - choose tags visually in a 3D latent space
- ImagePrompt cards (thumbnails), tags split from ImagePrompt / wildcards /
  Tagger DB / Prompt library, and sampled Gallery images placed in the
  EmbeddingGemma 2 space and projected to 3D with PCA
- card vectors reuse the Gallery semantic index (missing ones are indexed on
  build); tag vectors embedded with Ollama and cached (tagspace_tags.npz)
- images and text centered on their own means (cards for images) to remove
  the modality gap so cards overlap their matching tags
- click to add/remove, neighbors list (cards and tags interleaved), text search
  with probe marker, prompt composed with duplicates removed, append to
  GenerateUI Positive / copy
- three.js r187 subset + OrbitControls bundled (static/lib/three, MIT),
  loaded on first tab open
- /wfm/tagspace/{status,space,build,cancel,search,neighbors}
- help page (en/ja/zh), README, DEVLOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:36:14 +09:00
ketle-manandClaude Opus 5.5 65ccc60f00 docs: record live verification of Ollama-based semantic search in DEVLOG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:25:20 +09:00
ketle-manandClaude Opus 5.5 ea66f2565d feat: run Gallery semantic search's EmbeddingGemma 2 in Ollama instead of ONNX
- new semantic_ollama.py replaces semantic_local.py (ONNX runtime removed)
- images sent as input=[{"image": b64}] (the "images" field is silently ignored),
  4 per request, per-image fallback on batch failure, retries on dropped connections
- model size selectable: 740m / 440m (identical vectors, no rebuild); :latest used as 740m
- npz model name unchanged, existing indexes keep working (cos ~0.97 vs ONNX vectors)
- Ollama URL checked by url_guard; settings saved via /wfm/gallery/semantic/options
- model is unloaded from VRAM after indexing (keep_alive 0)
- settings UI: device/threads/image precision replaced by Ollama URL + model size
- help (helpGallery33/35/36, helpTrouble10/11 en/ja/zh), README, requirements, DEVLOG updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:16:49 +09:00
ketle-manandClaude Sonnet 5.5 f43ad515bf fix: persist image sent to Mask Editor One node (v0.8.13)
- wfmOpenMaskEditorForNode calls node._persistBgDataUrl so properties.bg_image
  stays in sync (Mask Editor One v0.1.12+); prevents an older image being
  restored on reload and overwriting the server-side cache
- layer_data carries the sent image width/height for preview restore
- help (helpImageEditMask14 en/ja/zh), README, DEVLOG updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 18:47:53 +09:00
ketle-manandClaude Sonnet 5.5 21fe458753 feat: multi-image I2I bridge for Comic Creator + Input tab Prompt/Image merge, collapsible Raw JSON (v0.8.12)
- window._wfmReceiveMultiImageI2IRunRequest: image i -> i-th LoadImage node, optional width/height/steps/cfg/denoise/sampler/scheduler/seed
- GenerateUI Input tab: Prompt | Image side by side (3:2), Image wraps under Prompt when narrow
- Raw JSON column collapsible (Input tab only, remembered)
- help (helpGen4 en/ja/zh), README, DEVLOG updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 18:34:25 +09:00
ketle-manandClaude Sonnet 5.5 f3a103aa67 feat: split Gallery Send CC into Layout / Image buttons (v0.8.11)
- Send CC Layout: existing behavior (panel/overlay, MP4 to Video tool)
- Send CC Image: new, calls Comic Creator's window.sendImageToImageTab
- help (helpGallery37 en/ja/zh), README, DEVLOG, manual ch.8/11 updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 11:43:11 +09:00
62 changed files with 8406 additions and 729 deletions
+7
View File
@@ -2,6 +2,13 @@
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.9.2(2026-11-03)** — Selectorイベントループ有効時に画像が壊れて届く不具合を修正
- **v0.9.1(2026-11-03)** — TagSpace: 選んだタグだけを追加 / タグのカッコをエスケープして追加
- **v0.9.0(2026-11-03)** — マニュアル(画像なし配布版)を v0.9.0 に改訂
- **v0.8.14(2026-11-03)** — Fibo 2.0 Edit / FastH3 OmniRef / Pika-H3-Flex 対応(GenerateUI・Metadata・Videoタブ)
- **v0.8.13(2026-10-27)** — Edit in Mask Editor One: 送信画像をノードへ永続化(Mask Editor One v0.1.12 対応)
- **v0.8.12(2026-10-27)** — Comic Creator向け複数画像I2Iブリッジ + GenerateUI Inputタブ: Prompt/Image統合・Raw JSON折りたたみ
- **v0.8.11(2026-10-26)** — Gallery: Send CC をレイアウト/Imageタブの2ボタンに分割
- **v0.8.10(2026-10-23)** — Tagger: PixAI Tagger v1.0 対応
- **v0.8.9(2026-10-20)** — Video: アセット登録ボタン / Editの音声変換 / ソースパネルのレイアウト
- **v0.8.8(2026-10-19)** — MOSS-Image 対応(GenerateUI / Gallery / Metadata / Iタブ)
+180
View File
@@ -2,6 +2,186 @@
---
## v0.9.2(2026-11-03)
### Selectorイベントループ有効時に画像が壊れて届く不具合を修正
- 症状: 設定「Selectorイベントループ」(`windows_selector_event_loop`)が有効だと、ギャラリーのプレビューと Download ボタンで取得した画像が壊れる(元ファイルと同サイズのまま、32KB 分のブロックが直後のブロックの内容に置き換わる)。出力フォルダのファイル自体は正常。
- 原因: Selector 方式では aiohttp の `FileResponse` が asyncio の `_sendfile_fallback` を通る。これは 16KB のバッファを使い回しながら、送り切れなかった分をトランスポートにコピーせず積むため(Python 3.12)、送信が詰まると次の読み込みで上書きされる。ギャラリーは多数の画像を同時に読むので詰まりやすい。
- 修正: `prestartup_script.py` で Selector に切り替えるとき `AIOHTTP_NOSENDFILE=1` も設定し、aiohttp がチャンクごとに新しい bytes を読んで送る経路を使うようにした(aiohttp 読み込み済みの場合はモジュール定数も上書き)。プロセス全体に効くので ComfyUI 本体の `/view` なども対象。
- 検証: 受信を遅くしたクライアントで、修正前は 5/5 回破損、修正後は 5/5 回ハッシュ一致。再起動後の実サーバー(ギャラリー配信 URL)でも 5/5 回一致。
- 壊れた応答は `Cache-Control: max-age=3600` でブラウザに残ることがあるので、更新後は再読み込み(Ctrl+F5)が必要。
---
## v0.9.1(2026-11-03)
### TagSpace: 選んだタグだけを追加 / タグのカッコをエスケープして追加
- 選択中パネルでタグを1つ以上選んでいると、「追加」ボタンが「選択したタグを追加(N)」になり、選んだタグだけ(プロンプト中の順)を1つのチップ(名前は「rapunzel(2タグ)」)として追加する。選んでいなければ従来どおり全体(カードはプロンプト全文、Gallery点は全タグ)。3D画面のダブルクリックと一覧の+は常に全体。
- 不具合修正: タグは分解時にエスケープを外している(`rapunzel \(disney\)` → `rapunzel (disney)`)ため、タグ・Gallery点のチップをそのままプロンプトに入れると `(disney)` が強調指定になっていた。プロンプトに入れるときにカッコを `\(` `\)` に戻す(表示はそのまま)。カード全文の `\(...\)` と同じ形になるので、重複除去でも1つにまとまる。
- 検証(Playwright): rapunzel カードで未選択の「追加」→全文、2つ選んで「選択したタグを追加(2)」→ `rapunzel \(disney\), braided ponytail`、一覧の+で同じタグを追加しても重複せず。
- ヘルプ(tagspace-10 英/日/中)、README、マニュアル第11章 11-7(日英、全章まとめ・ZIP 再作成)。
### TagSpace: Gallery点から「Galleryで開く」
- 選択中パネル(Gallery点)に「Galleryで開く」ボタン。`gallery-tab.js` に `revealInGallery(path)` を新設(export): ギャラリータブ/Output サブタブへ切り替え(初回はここで出力フォルダとツリーを読み込むので `state.folderTree` を待つ)→ 絞り込み(検索・お気に入り・タグ・グループ・類似表示)を「Clear filters」と同じ要領で解除 → ツリーを根から目的のフォルダまで矢印クリックで展開(子は展開時に描画される遅延描画のため)→ フォルダを選んで `await loadImages()` → 一覧で `[data-path]` の要素をクリック(通常クリックと同じ選択・詳細表示)して中央へスクロール。
- サムネイル表示は50件ずつ描くので、目的の画像まで `_appendNextPage` で描き足し、無限スクロールの目印を末尾へ戻す(全件描いたら外す)。パスは `\` / 大文字小文字の違いを無視して比較。出力フォルダ外・一覧に無い画像は false を返し、TagSpace 側でトーストを出す。
- 検証(Playwright): 検索語を入れた状態から TagSpace の Gallery 点で押す → 0.3秒でギャラリーに切り替わり、ツリー「2026-06-07」選択・一覧で目的の画像が選択されて画面内・検索欄クリア・詳細表示。456枚のフォルダの453枚目でも 0.6秒で表示(全件描画・目印も解除)。出力フォルダ外/存在しないパスは false。コンソールエラーなし。
- ヘルプ(tagspace-10 英/日/中)、README、マニュアル第11章 11-7(日英、全章まとめ・ZIP 再作成)。
---
## v0.9.0(2026-11-03)
### マニュアル(画像なし配布版)を v0.9.0 に改訂
- 日本語・英語の `docs/manual/` を v0.8.9 → v0.9.0 に更新(全章まとめ・ZIP・README を作り直し、v0.8.9 のファイルは削除)。
- 反映した変更: TagSpace タブ(第11章に 11-7 を新設、第3章のタブ一覧・付録の用語集・第12章のトラブル表)、Gallery セマンティック検索の Ollama 化(第8章 8-6・第2章・第12章。ONNX の GPU 設定の記述を Tagger 側へ移動)、Tagger の PixAI 対応と GPU 確認(第11章 11-2・第12章)、GenerateUI の Input タブ横並び・Raw JSON 折りたたみ(第5章)、Fibo 2.0 Edit/FastH3 OmniRef/Pika-H3-Flex(第5章 5-9)、Video Plan の Reference Image(第11章 11-4)、Comic Creator からの複数参照画像の実行(第11章 11-6)。
- 前回の全章まとめは v0.8.11 の章ファイル修正(Send CC)を取り込んでいなかった。今回は章ファイルから全章まとめを作り直したので解消。
- 英語版の Raw JSON 折りたたみボタンは、実際の表示(»)ではなく ASCII の `>>` と書いた。
### TagSpace タブ新設(latenttag-3d の WFS 統合)
- **目的**: latenttag-3d(単独アプリは別途継続)を WFS に組み込み、WFS のデータだけでタグを視覚的に選んでプロンプトを作る。
- **材料**: カード=ImagePrompt(`ws_image_prompt`、`.txt` または ponyxlWildcardsVault の YAML から `_read_sidecar_prompt` でプロンプト解決、プロンプトのある951枚)/タグ=ImagePrompt・ワイルドカード(`.txt` 行・YAML の `- ` 行)・Tagger DB・`prompts.json` の文を `, \n | { } BREAK` で分解し正規化(重み・括弧・Dynamic Prompts の `n::`・LoRA・`__wildcard__`・`rating:` を除去、`_`→空白、2〜40文字・5語以内)。出典の種類数→出現回数の順で上位 N(既定2000)/背景=Gallery 索引から seed 固定で間引いた画像(既定4000)。
- **ベクトル**: カードは Gallery セマンティック索引の画像ベクトルを流用(未索引分は構築時に `SemanticService.start_index(..., "missing")` で追加)。タグは Ollama でテキスト埋め込み(`task: search result | query:` 付き)し `tagspace_tags.npz` にキャッシュ。索引が Gemini のときはエラーにする。
- **modality gap**: 同じ空間でも画像とテキストは別の塊になる。実測で、そのまま PCA すると第1・第2軸が画像/テキストの分離に使われた(|Δ平均|/標準偏差 2.99・4.43)。画像とテキストを別々の平均で中心化すると 0 になり、画像→近いタグも改善(例 `alley`: 中心化前 anime, twintails… → 後 street, neon lights, city lights, night)。
- 画像側の平均を「カード+背景」で取ると、数の多い背景に引っ張られてカードがタグの塊から離れた(中心間距離 5.06)。カードの平均に変えて 0.00 にした。
- 近傍・検索も同じ中心化コサイン。同種どうしのスコアが高く出るため、カードとタグを別々に順位付けして交互に並べる。
- **3D**: three.js r187(MIT)から使う部品+OrbitControls だけを esbuild で束ねた `static/lib/three/three-tagspace.min.js`(559KB)を同梱し、タブを初めて開いたときに動的 import。カードは Sprite(サムネイルを6並列で順次読み込み)、タグ・背景は Points、選択/近傍/検索は重ね描き、ラベルは HTML オーバーレイ。タブが非表示の間は描画ループを止める。
- **API**: `/wfm/tagspace/{status,space,build,cancel,search,neighbors}`(`tagspace_routes.py`。Gallery と同じ GalleryService/SemanticService を共有)。生成物は `tagspace_space.json`(表示用)・`tagspace_space.npz`(近傍/検索用)・`tagspace_tags.npz`(タグのベクトル)。
- **検証**(ComfyUI_5 / 8189): 初回構築 約2.5分(カード画像1,054枚の索引追加+タグ2,000件)、キャッシュありの再構築 7秒。英語・日本語の検索、キャンバスのホバー/クリック(タグ・カード)、チップのトグル、重複除去、GenerateUI の Positive への追記(`wfs_sdxl_gallery.json`)、ワークフロー未読込時のトーストを確認。コンソールエラー0。
- 注意: Git Bash の curl で日本語の JSON を送ると文字化けして空の検索になる(API 側の問題ではない)。ヘルプ(TagSpace ページ 英/日/中)と README を追加。マニュアルは未更新。
- **追加: Gallery 画像のプロンプト由来タグ**(Tagger による補完は次の段階で検討)
- 表示自体にタグは不要(背景点は画像ベクトルで配置)。目的は、自分の生成画像の語をタグの材料にすることと、Gallery 点をクリックしてその画像のタグを入れること。
- 抽出: 埋め込みの API 形式グラフで、サンプラー/ガイダーの `positive`(無ければ Guider 系の `conditioning`)から上流をたどり、`text` / `prompt` / `clip_l` 等の文字列入力を集める。`negative` 系の入力はたどらない(ControlNet 等の両方を持つノード経由で negative が混ざるのを防ぐ)。UI 形式しか無い画像は対象外。
- 実測: 2.9万枚中 64%(18,723枚)で取得、初回 約2〜3分・キャッシュ(`tagspace_prompts.json`、size/mtime 一致)で 0.7秒。典型的なネガティブ語が3つ以上混ざるのは5件で、いずれも利用者がプロンプト欄に画面テキストを貼っていたもの。区切りはカンマ等のみ(スペース区切りは「blue eyes」が分かれるため不採用)。
- **出典の偏り**: タグを「出典の種類数→出現数」で選ぶと、Gallery が上位2000件中1982件を占めた。出典ごとに「そのタグを含む文の数」で並べ、出典を順番に1件ずつ取る方式に変更(Gallery 682・ImagePrompt 639・ワイルドカード 476・Tagger DB 199・Prompt ライブラリ 4)。
- 背景点に `tags` を持たせ、クリックでまとめて1チップ(`kind: image`)。プロンプトが無い画像(背景4000中 約41%)は追加不可で、詳細に「タグなし」と表示。
- バグ修正: 背景の点(`userData.items`)が `kind` を付ける前の生データだったため、ホバー/クリックで種類と名前が undefined になっていた。同じオブジェクトに `kind` を付けるよう修正。
- バグ修正: セマンティック索引に削除済み画像が残っており、背景のサムネイルが 404 になった。背景は多めに取って実在するファイルだけに絞り、プロンプト読み取りでも削除済みは除外。
- 既知: 画像編集モデルの指示文(例 `do not use the colors`)も5語以内ならタグとして残る。
- 検証(ComfyUI_5 再起動後): 構築148秒(プロンプト読み取り111秒)→キャッシュ有りで15〜16秒。背景4000点で存在しないファイル0件・サムネイル404は40件抽出で0件。Gallery 点のクリック(タグありは1チップで追加、タグなしは追加不可)と、ホバー331回でコンソールエラー0を確認。
- **追加: Tagger 補完**(プロンプトを取り出せない Gallery 画像、2.9万枚中 10,652枚)
- ツールバー「Tagger補完: [OFF/モデル] [Gallery点のみ/プロンプトの無い全画像]」。モデルは Tagger タブの ONNX モデル(`.onnx` の無い `wd-vit-tagger-v3` は出ない)。`TaggerService.tag_image()` を追加し、しきい値は既定値(WD 0.35/0.85、PixAI は推奨値 0.17/0.27)、評価ラベル(general/sensitive/questionable/explicit)は除外。
- 背景点の選択をタグ集めより前に移し、「Gallery点のみ」はその中のプロンプト由来タグが無い画像だけを処理。結果は `tagspace_tagger.json`(path→size/mtime/model/tags)にキャッシュし、100件ごとと終了時に保存(中止しても残る)。補完のために読み込んだモデルは終了後に Tagger のキャッシュから外す(Tagger タブで読み込み済みなら残す)。
- 新出典 `tagger_auto`(「Tagger補完」、黄緑)。背景点は `tag_src: prompt|tagger` を持ち、Tagger 由来はツールチップ/詳細に「(Tagger補完)」。進み具合に実行先(CUDA/CPU)を表示。
- **環境の問題(再発)**: ComfyUI_5 の venv で `onnxruntime` 1.31.0(CPU)と `onnxruntime-gpu` 1.30.0 が共存し CUDA が無効。CPU では wd-v1-4-convnext 465ms/枚・wd-v1-4-vit 641ms/枚(全画像なら約1.5時間)。修復は ComfyUI 停止→`fix_onnxruntime_gpu.bat`(外側リポジトリ、v0.8.10 と同じ)。今回は未実施。
- 検証(CPU): Gallery点600・Gallery点のみ・convnext で 288枚を142秒(0.49秒/枚)、全600点にタグ(プロンプト312・Tagger 288・なし0)。`tagger_auto` を含むタグ571件(うち補完でしか出ないもの180件: 1boy, multiple girls, scenery 等)。キャッシュで再構築17秒。UI(選択欄の有効/無効、凡例、「(Tagger補完)」表示、クリックで1チップ)とコンソールエラー0を確認。確認後は Gallery点4000・補完OFFで作り直し済み。
- GPU 修復後(利用者が `fix_onnxruntime_gpu.bat` を実行、`onnxruntime-gpu` 1.30.0 のみ・CUDA/TensorRT 有効): Gallery点4000・Gallery点のみ・convnext で 1,918枚を約136秒(約0.07秒/枚、画像読み込み込み。CPU の約7倍)、全4000点にタグ(プロンプト2,082・Tagger 1,918)。全画像(10,652枚)なら約12〜13分の見込み。
- **追加: Gallery 点の近傍**
- 以前は Gallery 点を選んでも `select()` が近傍を問い合わせずに抜け、直前の一覧が残っていた(ファイル名とは無関係)。近傍用 `tagspace_space.npz` にも背景のベクトルが無かった。
- 背景のベクトル(`bg_ids` / `bg_vecs`、4000×768 で約12MB)を保存し、カード/タグ/画像の中心化行列を読み込み時にキャッシュ。Gallery 点を基準にしたときだけ「画像→タグ→カード」を交互に並べる。カード・タグ・検索では画像を混ぜない(利用者の指定)。一覧の Gallery 画像は丸いサムネイル、タグの無い画像は「+」なし。
- 検証: `ComfyUI_00510_.png` → 似た画像(0.69〜0.71)・pink body suits 等のタグ・カードが交互、57ms。タグ/カード/検索の一覧は card・tag のみ。画面でも Tagger 補完の Gallery 点で確認。
- 未解明: 再起動直後の最初の構築が146秒かかり `tagspace_tagger.json` が書き換えられた(2回目以降は13秒・書き換えなし、ログに警告なし)。再現したら段階ごとの時間を記録して調べる。
- **追加: 表示と操作の改善**
- 発光: 放射グラデーションのテクスチャ(明るい芯+にじみ)を加算合成(`blending: 2`。同梱サブセットに `AdditiveBlending` が無いため数値で指定)、`depthWrite: false`、点サイズ×2.4。背景は夜空色 `#05070d`。Gallery点2万点だと重なりで中心が白く飛んだので、発光時は Gallery点の不透明度を 0.55→0.3。
- またたき: `PointsMaterial.onBeforeCompile` で頂点シェーダーに `twinkle`(位相・速さ。添字から決まる疑似乱数で再構築しても同じ)と時刻 uniform を差し込み、`vColor` を 0.15〜1.25 倍(`pow(0.5+0.5 sin, 2)` で暗い時間を長く・ピークを鋭く)。タグ・カード・Gallery点のみで、選択・近傍の強調は瞬かない。検証: 0.9秒で変化した画素 約2.6万(オフ時0)。
- 拡大表示: 「選択中」の画像と「近く」の一覧の画像に `data-ts-zoom`。マウスを乗せるとサイド列の左に 360px で表示(読み込み済みの小画像を先に出し 720px に差し替え、`pointer-events: none`)。
- 追加/削除ボタンを「選択中」の名前の行(`position: sticky`)へ移動。本文をスクロールしても押せる。
- クリックは選択のみ(`e.detail > 1` は無視)、ダブルクリックで追加/削除。「追加」ボタンと一覧の+は従来どおり。ヒント・空欄の案内・ヘルプ(英/日/中)・README を更新し、ヘルプに表示の項目(tagspace-8)を追加。
- **追加: ワイルドカード YAML をパーサーで読む**
- 従来は「`- ` で始まる行」を1項目として読んでいたため、`- >-` 等のブロックスカラー(本文が次行以降)は `>-` だけになり本文を取りこぼしていた(billions_of_all_in_one.yaml、corn-flakes-doll.yaml)。二重引用符内の `’` もエスケープのまま残っていた。
- PyYAML(ComfyUI 本体の依存)の `CSafeLoader`(無ければ `SafeLoader`)で読み、文字列の葉だけを取る(キー=カテゴリ名、yes/no・数値に変換された葉は除く)。YAML として読めないファイルは従来の行読みにフォールバック。4.2万行で 0.19 秒(純 Python の safe_load は 1.86 秒)。
- 実測(ワイルドカード7ファイル): 異なるタグ 28,861 → 30,130(+1,269。female / wings / dress / lace 等)。他5ファイルは不変。
- 実機(ComfyUI_5 再起動後、2000タグ・背景20000で再構築): ワイルドカード由来 748 → 762、入れ替わり22件(male / benevolent / pointed ears 等が入り、出典を順番に取る方式なので他出典の下位が抜ける)。female の出現数 164 → 208 等。
- **追加: 全タグ・最低出現回数・ワイルドカードのオン/オフ**
- 背景: 「全部の点を表示したい」。タグの種類は全出典で約4.8万、うち約3.7万がワイルドカードにしか無い語(1回だけの語が大半)。ワイルドカードを除くと約1.1万。
- ツールバーに「全タグ」(`max_tags=0`、上限 `ALL_TAGS_LIMIT`=20,000)、「最低出現回数」(1/2/3/5。全出典合計の出現数で候補から外す)、「ワイルドカード」(材料に含めるか)。meta に `max_tags` / `min_count` / `wildcard` / `tags_available` を記録し、一部だけ使ったときは状態表示に「(候補 N)」。既定値(ワイルドカードあり・最低1回)は従来と同じ結果(2000タグの集合・出現数・出典が完全一致を確認)。
- **正規化の追加**: 全タグにすると、MOSS-Image のレイアウト指定(`{"bbox":[...],"label":"text"}`)や文字入れ指定の JSON 断片が Gallery プロンプトから大量に入り、`bbox":-8` 等 234件が空間の外に孤立した塊を作った。`"key":` を含む断片とモデルのファイル名(`.safetensors` 等)を除外し、片側だけ残った `"` は取り除く。括弧を外した後の `embedding:` も除外。ワイルドカードなし全タグ 11,406 → 10,435(2回以上 7,383 → 6,843)。
- **Ollama の一時ポート枯渇**: 9,056件を連続で埋め込んだところ 6,880件目で `HTTP 400 ... dial tcp 127.0.0.1:NNNNN: connectex: Only one usage of each socket address` で失敗。Ollama はテキストごとにランナーへ新しい接続を張るため、ループバックの TIME_WAIT が 14,228 / 16,384 に達していた。このエラーを一時的扱いにし、30秒待って再試行(最大5回、Windows の TIME_WAIT は約2分で解放)。単体テスト(2回失敗→3回目で回復、失敗が続けば6回で諦める)で確認。実構築では以後枯渇せず(新規5,203件で TIME_WAIT 最大 11,968)、本番経路での再試行は未発生。
- 実測(ComfyUI_5、Gallery点20,000・Tagger補完あり): ワイルドカードなし全タグ 79秒(新規埋め込み 2,656件)、最低2回 22秒、ワイルドカードあり全タグ・最低2回(14,188件)127秒(新規 5,203件)。空間データ 9.4MB(2000タグ)→ 10.8MB(11,406タグ)。ブラウザで約3.2万点を表示し、毎フレームのホバー判定込みで 60fps・JSヒープ 35MB。PCA 寄与率は 10.5% → 7.9%(タグの種類が増えて軸が分散)。
- **追加: Gallery点のタグを選んで空間検索**
- 選択中パネルで Gallery 画像のプロンプト(またはTagger補完)のタグを、文ではなくタグごとのボタンで表示。クリックで選択/解除(複数可、`state.picked` に画像IDと Set で保持し、別の要素を選ぶとリセット)。「選択したタグで空間検索(N)」で、選んだタグをプロンプト中の順に `, ` でつないだ文を既存の `runSearch()` に渡す(検索欄にも入れる)。
- タグが多いとパネル(最大260px)からボタンがはみ出したため、ボタン行を `position: sticky; bottom: 0` で下端に固定。
- 検証(Playwright): 33タグの画像で2つ選択→ボタン有効化→「brown hair, east asian」で検索し、east asian 0.67 / brown hair 0.67 / dark brown hair 0.62 等が並ぶ。検索後も選択を保持。15タグの画像でパネルがスクロールする状態でもボタンが見えることを確認。
- **追加: カードのタグも選んで空間検索**
- カードはプロンプトを文で持つだけだったので、構築時に `split_tags`(Gallery点と同じ正規化)で `tags` を付ける。詳細パネルの表示処理を `tagPicker()` に共通化し、カードはタグのボタン+「プロンプト全文」(`<details>`)+カテゴリ。タグが無いカード・作り直し前の空間(`tags` 無し)は従来どおり全文表示。
- 検証(ComfyUI_5 再起動・再構築後): 951枚中948枚にタグ(平均3.4個)。無いのは `zero two \(darling in the franxx\)` のように1語が5語を超えるもの等3枚。「resentful」カードで angry / evil smile を選んで検索 → evil smile 0.89、evil grin 0.84、arrogant smile 0.64。
- **修正: ズーム時に広い範囲で同じ点が反応する(ホバー・クリック)**
- 原因: `Raycaster.params.Points.threshold` が3D空間の固定値 0.12 で、しかも結果はカメラに近い順に並ぶのに先頭を採用していた。ズームして点群に入ると、手前の1点が画面の広い範囲で「当たり幅の内側」になり続ける。
- 修正(`pick()`): 候補は広めに取り(注視点の3倍の奥行きで 8px になる幅と、描かれた点の3D上の半径の大きい方)、各点を画面へ投影してカーソルとの距離(px)が最小のものを選ぶ。点はカーソルから 8px 以内、拡大で大きく描かれた点は見た目の半径(発光時は芯)まで。カードのサムネイル(Sprite)は従来どおり当たれば候補。
- 検証(Playwright、ホイールで大きくズーム、10×10 の格子でホバー): 修正前 100か所すべてで反応し2種類(boke 55回)→ 修正後(適度なズーム)73か所で反応し72種類、点の無い場所は無反応。4か所のクリックもそれぞれ別の要素を選択。カメラがカードの中に入るほどズームするとサムネイルが画面全体を覆うので、そのカードが反応するのは正しい。
---
## v0.8.14(2026-11-03)
### Fibo 2.0 Edit / FastH3 OmniRef / Pika-H3-Flex 対応(GenerateUI・Metadata・Videoタブ)
- **GenerateUI解析**(`comfyui-workflow.js`): `TextEncodeFibo2` を `TextEncodeQwenImage21` と同じ固定ロール扱いに(prompt は PreviewAny → プロンプト強化スイッチ経由でリンクされるので配線元へ positive を伝播、negative_prompt は VGL JSON のままプロンプト欄に出す、width/height/batch_size を設定タブへ。0 は自動サイズ)。動画オールインワンノードの判定を `VIDEO_ALL_IN_ONE_RE`(`ImageToVideo|TextToVideo|ReferenceToVideo`)に集約し、`MiniMaxH3ReferenceToVideo` の prompt が別ノード(PrimitiveStringMultiline)から配線されていれば配線元を positive にする。
- **Metadata / サイドパネルIタブ**: 動画ノードの prompt がリンクなら配線元テキストを解決。Fibo2 は MageFlow/Boogu と同じく1ノードで positive/negative を分けて取り出す。
- **Videoタブ(Plan)**: 既存の MiniMax H3 / LTX-2.5 / Wan2.2 はサブグラフの公開入力1ノードに書く方式だが、FastH3 系はサブグラフ無しのフラット構成。新ファミリー `fasth3` として、各入力の**配線元ノード**を書き込み先にした(prompt → PrimitiveStringMultiline、duration → PrimitiveFloat(length が未配線なら自ノードの length へ 24fps・17k+5 グリッドのフレーム数で書く)、解像度 → ResolutionSelector)。First Image / Last Image 欄を **Reference Image / Reference Image 2**(`ref_images.ref_image_0` / `ref_image_1`)として流用し、Asset タブのボタン表記・トーストも切り替える。
- **未指定の参照画像は接続を外す**: FastH3 系のみ、None / Clear の参照画像はテンプレートの LoadImage が繋がっていても切断し、使われなくなった LoadImage はノードごと除く(外さないと UI 上は未指定なのにテンプレートの画像で生成される)。他ファミリーは従来通り。
- **chain_previous**: Reference Image 2 は「前ブロックの最終フレーム」として扱わず、常に生成された最終フレームを抽出して次ブロックの1枚目の参照画像にする。
- **罠**: FastH3 テンプレートの PrimitiveString/Float・ResolutionSelector・LoadImage は `inputs[]` に widget 定義を持たない形式で保存されており、`widgetIndex` が -1 を返して何も書けなかった。ノード型ごとの既定の並び順にフォールバックするようにした。
- **ノード側の仕様**: `MiniMaxH3ReferenceToVideo` は `ref_images.values()` を順に使うだけなので、1枚目が欠けて2枚目だけでも動く(その画像が `<Picture 1>` になる)。
- **検証**: Node 上で実コード+ ComfyUI_5(8189)の object_info を使い、3種のワークフローの変換・解析・抽出と、参照画像の差し替え/注入/切断を確認(既存 minimax / ltx25 テンプレートは結果不変)。Playwright で Video タブを実操作(ラベル・既定値・Clear・+Block・ドロップ・Asset 表記)。Pika-H3-Flex を Plan から実生成(2ブロック×2秒・0.2MP → 352×608・56フレーム・音声付き、約160秒)し、chain_previous でブロック1の最終フレームがブロック2の参照画像になって自然に繋がることを確認。
- **未対応**: 参照画像の3枚目以降・参照動画・参照音声はワークフロー側の設定のまま。Pika は ManualSigmas のため GenerateUI の Steps は効かない(linked 表示)。
### Gallery セマンティック検索: EmbeddingGemma 2 を ONNX から Ollama へ移行
- **背景**: latenttag-3d(Ollama の `embeddinggemma-2` でタグを埋め込む)と Gallery 索引を共通の空間で使いたい。ONNX 版(`semantic_local.py`、q4)は onnxruntime-gpu の入れ替え問題も抱えていた。
- **互換性の実測**: 同じ入力で ONNX 版と Ollama 版(Q8_0)を比較。テキスト cos 0.985〜0.993、画像(12枚)平均 0.967(最小 0.923)。既存索引に Ollama の検索文を当てた上位10件の一致は 8〜9/10。→ npz の `model` 名は `embeddinggemma-2` のまま、既存索引(2.9万枚)をそのまま使う。
- **740m / 440m**: 740m=テキスト+画像+音声、440m=テキスト+画像。画像・テキストとも cos 1.0(同じベクトル)なので、切り替えても再作成不要。`:latest` は 740m と同じ(parent_model 740m-q8_0)で、740m 未取得時の代わりに使う。270m / 570m は画像非対応のため選択肢に入れない。
- **Ollama の画像埋め込みの罠**: `/api/embed` に `images` フィールドを付けても**エラーにならず無視され、テキストだけの埋め込みが返る**。正しくは `input: [{"image": "<base64>"}]`。`[{"images": ...}]` は 400、壊れた画像は 500 "Failed to load image or audio file"、未取得モデルは 404。`input: []` + `keep_alive: 0` でアンロードできる。
- **実装**: `semantic_ollama.py` を新設し `semantic_local.py` を削除。画像は4枚ずつ送信(1枚ずつより約1.8倍速い)し、バッチが失敗したら1枚ずつ送り直して原因の画像だけを失敗扱いにする。Ollama 内部の接続切断(400 "forcibly closed" 等)と 5xx は最大5回再試行。接続不可・モデル未取得はジョブ開始前に検出し、作成中に起きたら中止。作成後は VRAM から外す。URL は `url_guard` で検査。設定は `semantic_settings.json`(`url` / `tag`)、保存用に `/wfm/gallery/semantic/options` を追加。
- **UI**: モデル設定タブのデバイス/CPUスレッド/画像精度を廃止し、Ollama URL・モデルサイズ(未取得表示つき)に置き換え。ヘルプ(helpGallery33/35/36・helpTrouble10/11 英/日/中)、README、requirements.txt を更新。マニュアル(v0.8.9版)は未更新。
- **実機確認**(ComfyUI_5 / 8189、再起動 13:17 > 反映 13:13 をプロセス起動時刻で確認): 既存索引 29,356件をそのまま読み込み。テキスト検索 0.9秒、類似画像 約0.6秒(4件)。URL ガードで `169.254.169.254` を拒否。モデル設定の 740m⇔440m 切替が保存され状態欄に反映。`ponyxl/scenes/city`(未索引9枚)を「新規・変更のみ」で作成→約1.7秒・失敗0(4+4+1枚のバッチ)、作成後 `/api/ps` が空(アンロード済み)、追加した `alley.jpeg` の類似上位は同フォルダの画像(0.88〜0.93)。コンソールエラーなし。
- 確認中に Python の urllib から `/similar` が1回120秒タイムアウト、`/folders` が1回 WinError 10054 になった。いずれも再試行や curl では毎回0.6秒前後で正常で、変更していない `/folders` でも起きたため今回の変更とは別の現象と判断(このPCで以前から出ている接続切断と同種の可能性)。
- **残作業**: 旧 ONNX モデル(`user/default/Workflow-Studio/models/embeddinggemma-2`、302MB)は削除可能。`onnxruntime` は Tagger で使うため依存に残す。
---
## v0.8.13(2026-10-27)
### Edit in Mask Editor One: 送信画像をノードへ永続化(Mask Editor One v0.1.12 対応)
- **背景**: Mask Editor One v0.1.12(PR #4)が、背景画像を `input/mask_editor/` へアップロードして `node.properties.bg_image` に保存し、ワークフロー切り替え/リロード時の `onConfigure` で復元するようになった。一方 `window.wfmOpenMaskEditorForNode`(`web/comfyui/node_sets_menu.js`)は `node._bgDataUrl` / `node._bgImg` を直接差し替えるだけで `properties` を更新しないため、そのままだとリロード時に**以前の画像が復元され、`/mask_editor/store_image` のサーバーキャッシュを上書きする**(WFSが送った画像が消える)。
- **修正**: 画像送信後に `node._persistBgDataUrl(imageDataUrl, "wfs_image.png")` を呼んで `properties.bg_image` を同期(Mask Editor One 側が公開する関数。旧バージョンでは `typeof` チェックで無視)。
- **layer_data**: 既存マスクを引き継ぐ際の `layer_data` に、送信画像の `width` / `height` を付与。ノードのマスクプレビュー復元はこのサイズでレイヤーを作る(無い場合は復元済みの背景画像サイズ、それも無ければスキップ)。付与順は「`_bgImg` ロード後」に変更。
- **How to apply**: 外部から `MaskEditorOne` ノードの画像を差し替えるコードは、`node._bgDataUrl` を書き換えたら必ず `node._persistBgDataUrl()` で参照も同期すること。`applyImageAndMaskToMaskEditorOneNode`(API形式ワークフローへ書き込む経路)はグラフ上のノードを触らないので影響なし。
- **検証**: ComfyUI_5(8189)で、画像A保存→WFS相当でB送信→シリアライズ/復元で、背景がB(300×600)・マスクプレビューも300×600になること、`width/height` なしの `layer_data` でも背景サイズで復元されることを確認。
- ヘルプ(`helpImageEditMask14` 英/日/中)とREADMEを更新。マニュアル(v0.8.9版)は未更新。
---
## v0.8.12(2026-10-27)
### Comic Creator向け複数画像I2Iブリッジ + GenerateUI Inputタブ: Prompt/Image統合・Raw JSON折りたたみ
- **背景**: Comic Creator v1.65.0 の Nanobanana+ タブ(ローカルモード)が、Flux.3 Image Klein / Qwen Image 2.1 等の Image Edit 系ワークフローを複数の参照画像つきで実行したい、という要望。既存の `_wfmReceiveI2IRunRequest` は画像1枚(slot 0固定)だった。
- **複数画像ブリッジ**: `gallery-tab.js` に `window._wfmReceiveMultiImageI2IRunRequest(imageBlobs, params, workflowData, workflowFilename)` を追加(ワークフロー読込→`image-edit-tab.js` の `runI2IExternalMulti` へ委譲)。`InpaintI2IActions.js` の `_runI2IWithImages` が `imageBlobs[i]` を i 番目のLoadImageへ `applyImageToSlot(file, i, ...)` で割り当て(ノード数超過分は無視)。戻り値は `{ ok, url, slotCount, usedImages }`。
- **生成パラメータ**: width/height/steps/cfg/denoise/sampler_name/scheduler は既存の `comfyEditor.setGenerationParams` を再利用(指定時のみ書き込み。未指定=ワークフローの値のまま)。シードは `generate(workflow, { seedValue })` で固定。
- **How to apply(限界)**: `setGenerationParams` はKSampler系・解析済みlatentノードにしか書けない。出力サイズを入力画像から決める構成(例: Flux.3 Image Klein の `ReferenceMultiLatent`)では `EmptyFlux2LatentImage` が解析対象外になり、width/height は反映されない(Steps/CFG/シード/プロンプトは反映)。
- **Inputタブ(GenerateUI)**: Prompt / Image の内部タブを廃止し、同一画面に左右(Prompt:Image = 3:2)で並べた。親カラム(`.wfm-gen-params-col--input`)をCSSコンテナにして、幅が720px以下になるとImageがPromptの下へ折り返す(`@container`)。JSのタブ切替ハンドラは削除(`gallery-tab.js` の `[data-input-tab="image"]` クリックは `?.` のため無害)。
- **Raw JSONの折りたたみ(Inputのみ)**: 右カラムの上端に »/« ボタン。折りたたむと幅30pxの縦書き「Raw JSON」の帯だけが右端に残り、Prompt/Imageが広がる。状態は `localStorage`(`wfm_gen_rawjson_collapsed`)。Model/Settings の Raw JSON は従来どおり。
- 落とし穴: `.wfm-gen-rawjson-col`(幅540px)より前に書いた `--collapsed { width:30px }` は詳細度が同じで負ける。`.wfm-gen-rawjson-col.wfm-gen-rawjson-col--collapsed` と2クラスで指定する。
- **検証**: Comic Creator内のiframe(ComfyUI_5、8189)で、横並び(757px : 514px)・折りたたみ(540→30px)・狭幅での折り返しと、Comic Creator経由の実生成(Qwen2.1 1枚/2枚入力、Flux.3 Klein)を確認。
- ヘルプ(helpGen4 英/日/中・`index.html`)とREADMEを更新。マニュアル(v0.8.9版)は未更新。
---
## v0.8.11(2026-10-26)
### Gallery: Send CC をレイアウト/Imageタブの2ボタンに分割
- **背景**: これまで「Send CC」はレイアウトタブ(選択コマ/オーバーレイ)専用で、Imageタブへ送れるのはComic Creatorの「I2Iへ送る」を押した直後(`window.parent._ccI2ITargetMode === 'image'`)の戻り経路だけだった。送り先を自分で選べるようにしたい、という要望。
- **UI**(`templates/index.html`): `wfm-gallery-send-cc-btn` を「Send CC Layout」に改名し、隣に `wfm-gallery-send-cc-image-btn`「Send CC Image」を追加。どちらもComic Creator内にiframe埋め込みされたときだけ表示(従来どおり)。
- **Send CC Layout**(`gallery-tab.js`): 従来の経路(画像は `insertImageFromUrl`、MP4は `insertVideoFromUrl`)のまま。`_ccI2ITargetMode` による分岐は撤去(Imageタブへは新ボタンで送る)。
- **Send CC Image**: Comic Creator側の新設ブリッジ `window.parent.sendImageToImageTab(url, name)` を呼ぶ。ブリッジは Imageタブへ `switchTab` してから `_ccImageTab.loadFromUrl` で読み込む(作業中のレイヤーがあれば新規レイヤー、無ければ新規キャンバス)。動画はImageタブ未対応のため従来どおりトーストで弾く。ブリッジが無い(古いComic Creator)/失敗時は「Comic Creator内から開いてください」のトースト。
- **連携の前提**: Comic Creator側の `window.sendImageToImageTab`(`14-integrations.js`、feature/ocr-text-insert ブランチ)が必要。
- **検証**: Comic Creator内のGalleryで両ボタンの表示と、画像選択→Send CC Image→Imageタブへの読み込み(トースト表示)を実機(ComfyUI_5)で確認。Send CC Layoutの実クリックは未検証(処理は従来のまま)。
- ヘルプ(helpGallery37、日英中)、README、マニュアル第8章・第11章(日英)を更新。
- 教訓: ComfyUI_5への同期は変更したファイルだけでなく、事前に実行側とHEADが同一であることを `diff --strip-trailing-cr` で確認してからコピーする。
---
## v0.8.10(2026-10-23)
### Tagger: PixAI Tagger v1.0 対応
+12 -8
View File
@@ -27,7 +27,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.8.10-green)
![Version](https://img.shields.io/badge/version-0.8.11-green)
## Features (tab -> feature names)
@@ -38,7 +38,7 @@ Thumbnail / Table views, Thumbnail side panel, Badge filtering, Search, Side pan
One-click capture, Auto-save as thumbnail, Embedded workflow metadata, Auto-import
### GenerateUI Tab (v0.3.5)
6-tab layout, Save button, Input tab, Model tab, Settings tab, Always-visible Raw JSON, Bypass/Mute node handling, One-click generation, Seed control, Style selector, Create Catalog / Catalog buttons, Batch type selector, Batch tab, UI-to-API conversion, Video workflow support, Eagle integration, Qwen Image 2.1 support, Ming Image support
6-tab layout, Save button, Input tab, Multi-image I2I for Comic Creator, Model tab, Settings tab, Always-visible Raw JSON, Bypass/Mute node handling, One-click generation, Seed control, Style selector, Create Catalog / Catalog buttons, Batch type selector, Batch tab, UI-to-API conversion, Video workflow support, Eagle integration, Qwen Image 2.1 support, Ming Image support
### Feeder subtab (v0.3.5 / v0.3.42)
ImageFeeder node control, Image library, Selection management, Presets, Continuous Run loop, Index sync, Seed, WFS_GalleryFeeder node, Node & group selector, Image grid, After Gen modes, Run / Stop controls
@@ -53,7 +53,7 @@ Setting / Results / Plan JSON sub-panels, Per-column keyframes, Model column —
2-column layout, Collapsible sections, Theme selection, Theme customization, Workflows directory, Gallery output directory, Eagle connection, CivitAI Host, CivitAI API Key, Default workflow, Default Checkpoint, VRAM Management (Ollama), Video Playback Volume, Data Management, Text Size, RAW JSON Colors, GenerateUI Model Tab Highlight, Wildcard Integration, G'MIC-Qt Integration, Language
### Gallery Tab (v0.3.44)
Output / ImagePrompt / Style_Catalog / Metadata sub-tabs, Image browser, Folder tree root label, Thumbnail / Table views, Folder management, File operations, Download, MP4 video support, MP4 embedded metadata, WebM support, Embedded metadata reading fixes, Audio support, File conversion, Move To folder filter, Semantic Search, Audio waveform colors, Info tab: dimensions & duration, Multi-select, Image Compare, Prompt search, Server-side filtering, Group management, Thumbnail F button, Favorites, Detail panel, Prompt tab, Nanobanana tab, Gemini / Nano Banana nodes, MOSS-Image in GenerateUI, Faster GenerateUI Check / conversion, Partner API nodes in GenerateUI, Workflow viewer, GenUI button, Image Edit button, Send GenUI Image button, Send to LI node button, Send to LV node button, Send CC button, Search clear (✕), Clear all filters (✕ Clear), Workflow auto-save, Output folder configurable, SVG file support, PSD file support, Performance
Output / ImagePrompt / Style_Catalog / Metadata sub-tabs, Image browser, Folder tree root label, Thumbnail / Table views, Folder management, File operations, Download, MP4 video support, MP4 embedded metadata, WebM support, Embedded metadata reading fixes, Audio support, File conversion, Move To folder filter, Semantic Search, Audio waveform colors, Info tab: dimensions & duration, Multi-select, Image Compare, Prompt search, Server-side filtering, Group management, Thumbnail F button, Favorites, Detail panel, Prompt tab, Nanobanana tab, Gemini / Nano Banana nodes, MOSS-Image in GenerateUI, Faster GenerateUI Check / conversion, Partner API nodes in GenerateUI, Workflow viewer, GenUI button, Image Edit button, Send GenUI Image button, Send to LI node button, Send to LV node button, Send CC Layout / Send CC Image buttons, Search clear (✕), Clear all filters (✕ Clear), Workflow auto-save, Output folder configurable, SVG file support, PSD file support, Performance
### ImagePrompt Gallery subtab (v0.3.94, renamed from Style/Prompt in v0.3.95)
Visual prompt library, 3-column layout, Prompt builder (right pane), Plain-text prompt storage, ponyxlWildcardsVault format support, Seed data importer
@@ -73,6 +73,9 @@ Model Browser, Thumbnail / Table views, Table column sort, Search & Filter, User
### Tagger Tab (v0.3.38)
3 sub-tabs, Model support, Threshold sliders, VLM tagging, Single tab, Single output options, Batch tab, DB tab, Dependencies
### TagSpace Tab (v0.9.0)
Choose tags visually in a 3D latent space, Build / Update, Choosing tags, Explore, Search with a card's or Gallery image's tags, Make a prompt, Tagger fill, Glow / Twinkle, Hover preview, Requirements
### Image Edit Tab (v0.3.65)
Layer-based image editor, Loading images, Open PSD button, Close button, New button, Tools, Layer panel, Duplicate layer (⧉), Layer lock, Text quality, Export, Canvas navigation, Undo / Redo
@@ -125,10 +128,10 @@ Samples for the Feeder tab: `ws_sdxl_image_feeder_i2i` / `ws_dwpose_image_feeder
## Manual
A beginner-oriented manual (covers v0.8.9, text-only edition without screenshots) is available in [`docs/manual/`](docs/manual/):
A beginner-oriented manual (covers v0.9.1, text-only edition without screenshots) is available in [`docs/manual/`](docs/manual/):
- English: [`docs/manual/en/`](docs/manual/en/) — ZIP: `Workflow_Studio_Manual_v0.8.9_en.zip`
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.8.9.zip`
- English: [`docs/manual/en/`](docs/manual/en/) — ZIP: `Workflow_Studio_Manual_v0.9.1_en.zip`
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.9.1.zip`
---
@@ -170,7 +173,7 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
- **[LM Studio](https://lmstudio.ai/)** — alternative backend for translation and VLM (OpenAI-compatible API)
- **[Lemonade Server](https://lemonade-server.ai/)** — alternative backend for translation, chat, and VLM (OpenAI-compatible API)
- **[Unsloth](https://unsloth.ai/)** — alternative backend for translation, chat, and VLM (OpenAI-compatible API); needs an API key set via `UNSLOTH_API_KEY` in a `.env` file, or Unsloth's Keyless API access → "Chat and inference" turned on — `pip install -r requirements.txt` for `python-dotenv`
- **Gemini API key / EmbeddingGemma 2** (v0.8.2) — only for the Gallery's Semantic Search: either set `GEMINI_API_KEY` in the plugin's `.env` (key from [Google AI Studio](https://aistudio.google.com); free tier available, paid beyond it), or use the local **EmbeddingGemma 2** (no key; `onnxruntime`, `tokenizers` and `huggingface_hub` — normally already present with ComfyUI; the model downloads on first use). `onnxruntime-gpu` makes the local model ≈45× faster on NVIDIA GPUs
- **Gemini API key / EmbeddingGemma 2** (v0.8.2) — only for the Gallery's Semantic Search: either set `GEMINI_API_KEY` in the plugin's `.env` (key from [Google AI Studio](https://aistudio.google.com); free tier available, paid beyond it), or use the local **EmbeddingGemma 2** in [Ollama](https://ollama.com) (no key; `ollama pull embeddinggemma-2:740m` or `embeddinggemma-2:440m`)
- **[Eagle](https://eagle.cool/)** — for auto-saving generated images with metadata
- **[comfyui-mask-editor-one](https://github.com/ketle-man/comfyui-mask-editor-one) (v0.1.9+)** — enables BiRefNet background removal, SAM3 text-prompt segmentation, and ABR stamp-brush library in the Image Edit Mask tool; `birefnet.safetensors` must be placed in `ComfyUI/models/background_removal/` for BiRefNet
- **[psd-tools](https://pypi.org/project/psd-tools/)** (v0.6.0) — enables all PSD (Photoshop) features: Gallery bulk "Create PSD" export, Gallery browsing/thumbnails for `.psd` files, and Image Edit's Save PSD / Open PSD buttons; `pip install -r requirements.txt` (ships prebuilt wheels, no C compiler required); without it, PSD-related actions show an error toast with the install command instead of failing silently
@@ -210,7 +213,8 @@ ComfyUI-Workflow-Studio/
│ │ ├── settings_routes.py # Settings API
│ │ ├── ollama_routes.py # Ollama proxy API
│ │ ├── eagle_routes.py # Eagle integration API
│ │ └── gallery_routes.py # Gallery tab API (Output + ImagePrompt + Style_Catalog sub-tabs)
│ │ ├── gallery_routes.py # Gallery tab API (Output + ImagePrompt + Style_Catalog sub-tabs)
│ │ └── tagspace_routes.py # TagSpace tab API (build / space / search / neighbors)
│ └── services/
│ ├── workflow_service.py # Workflow file operations
│ ├── nodes_service.py # Node metadata & node sets
+31 -13
View File
@@ -23,7 +23,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.8.10-green)
![Version](https://img.shields.io/badge/version-0.8.11-green)
## Screenshots
@@ -99,7 +99,8 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
- **6-tab layout** — Input / Model / Settings / Feeder / Batch / **Lab** tabs; Input, Model, and Settings each include a Raw JSON column on the right for instant preview and direct editing
- **Save button** — located at the right end of the subtab row; opens a filename dialog (default: current workflow name) and saves the current workflow as a `.json` file to the Workflow tab via the import API; hidden while the Batch or Lab subtab is active (v0.4.6), since those work on workflow copies / their own Plan files rather than the currently loaded workflow
- **Default-workflow snapshot fix** (v0.4.8) — overwriting the loaded workflow under a filename that's currently set as the auto-load **Default workflow** (Settings tab, see below) now also refreshes that cached snapshot; previously only the file on disk was updated, so the old (pre-edit) version — including any checkpoint no longer installed — kept reappearing after every page reload until the default was re-set by hand
- **Input tab** — Prompt and Image inner tabs (drag-and-drop upload); Prompt tab shows Positive Prompt and Negative Prompt textareas, plus an **Embeddings selector** at the bottom (Filter + Select + Weight input + Paste button); Paste inserts `(embedding:Name:weight)` at the cursor position of the last focused textarea (defaults to Positive when neither is focused); Raw JSON (540px) in the right column
- **Input tab** — Prompt (left) and Image (right, about 3:2) side by side on one screen (drag-and-drop upload; Image wraps under Prompt when the area is narrow, about 720px or less); Prompt area shows Positive Prompt and Negative Prompt textareas, plus an **Embeddings selector** at the bottom (Filter + Select + Weight input + Paste button); Paste inserts `(embedding:Name:weight)` at the cursor position of the last focused textarea (defaults to Positive when neither is focused); Raw JSON (540px) in the right column, collapsible to a slim strip with the » button (Input tab only; remembered)
- **Multi-image I2I for Comic Creator** (v0.8.12) — new iframe bridge `window._wfmReceiveMultiImageI2IRunRequest(imageBlobs, params, workflowData?, workflowFilename?)` used by Comic Creator's Nanobanana+ tab (Local mode): image *i* goes to the workflow's *i*-th LoadImage node (extra images are ignored), and optional width / height / steps / cfg / denoise / sampler / scheduler / seed are written through `setGenerationParams`; returns `{ ok, url, slotCount, usedImages }`
- **Revert button** (v0.3.70) — a ↺ button next to each Apply button reverts the textarea to the node's currently applied value (the reverse of Apply)
- **Emphasis weight editing** (v0.3.70) — select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust `(text:weight)` by ±0.05, A1111/native-ComfyUI style; parentheses are removed automatically when the weight returns to 1.0
- **Mask slot for inpainting** (v0.3.71) — LoadImage slots whose MASK output feeds an inpaint node (e.g. `VAEEncodeForInpaint`) show an additional Mask drop zone; when a mask is set, image + mask are composited into a single RGBA upload (mask baked into the alpha channel) matching ComfyUI's native alpha→MASK extraction — no extra nodes required
@@ -276,9 +277,9 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **File conversion** (v0.8.0) — a **Convert...** button in the Gallery bulk bar (shown when the selection contains audio or video) converts audio files to FLAC / MP3 / Opus / M4A / WAV, or extracts the audio track of videos, using PyAV (no system ffmpeg needed); bitrate, sample rate (44.1 / 48 kHz) and channels (mono / stereo) are selectable, output goes next to the source as a new file (`name.ext`, or `name_converted.ext` if taken). ComfyUI `prompt` / `workflow` tags (and title / artist / album tags) are carried over to formats that can hold them — WAV cannot, so they are skipped there; favorite / tags / memo / groups can be carried over, and the original can optionally be deleted after a successful conversion (with a confirmation). `.ogg` is readable but not offered as an output (the bundled PyAV has no Vorbis encoder)
- **Move To folder filter** (v0.8.0) — the Move To dialog (detail panel and bulk bar) has a filter box that narrows the folder list by name or path (space = AND), Enter moves to the first match; the move toast now reads "Moved N file(s)" since audio/video files are moved too
- **Semantic Search** (v0.8.2) — find images by meaning instead of keywords. The **S** button next to the search box turns it on: the search box then takes a free-text description (e.g. "sunset city street"), Enter searches, and results are ordered by similarity with a score badge on each thumbnail. Turning **S** on also shows a second toolbar row (left-aligned): **Similar** (lists images similar to the selected one; selecting another image keeps the list, **↻** re-runs it for the newly selected image, pressing Similar again returns to the normal list), the **⚙** settings button, and the result count. Searches cover the selected folder and its subfolders; sort and tag/group filters do not apply to semantic results
- **Index window (⚙)** — three tabs. **Index**: target folder (optionally with subfolders), "new/changed only" or "rebuild all", progress bar, stop, delete all. **Model**: choose with radio buttons between **Gemini Embedding 2** (API; set `GEMINI_API_KEY` in the plugin's `.env` and restart ComfyUI — the free tier exists but content sent on it may be used by Google to improve its products, beyond it the API is paid) and **EmbeddingGemma 2** (runs locally, free, no key; the ~300 MB q4 ONNX model is downloaded on first use), plus vector size (Gemini 768 / 1536 / 3072, EmbeddingGemma 2 128 / 256 / 512 / 768), and for the local model the device (auto / CPU / GPU CUDA), CPU thread count (default: half the cores) and image precision (high / standard ≈2.5× faster / light ≈5× faster). **Search**: minimum score for similar-image results (e.g. `0.6` shows only images scoring 0.6 or higher), minimum score for text search, and maximum results — stored per model because score levels differ between models
- **Index window (⚙)** — three tabs. **Index**: target folder (optionally with subfolders), "new/changed only" or "rebuild all", progress bar, stop, delete all. **Model**: choose with radio buttons between **Gemini Embedding 2** (API; set `GEMINI_API_KEY` in the plugin's `.env` and restart ComfyUI — the free tier exists but content sent on it may be used by Google to improve its products, beyond it the API is paid) and **EmbeddingGemma 2** (runs locally in Ollama, free, no key), plus vector size (Gemini 768 / 1536 / 3072, EmbeddingGemma 2 128 / 256 / 512 / 768), and for EmbeddingGemma 2 the Ollama URL and the model size (740m or 440m). **Search**: minimum score for similar-image results (e.g. `0.6` shows only images scoring 0.6 or higher), minimum score for text search, and maximum results — stored per model because score levels differ between models
- **Index state in the folder tree** — a green dot next to a folder's image count means every image directly in that folder is indexed; the index is one shared store, so folders can be indexed one at a time. Images, plus videos / PSD via their thumbnails (audio is skipped), are embedded; changing the model, vector size or image precision requires "Rebuild all"
- **Local GPU** — EmbeddingGemma 2 is a port of Transformers.js' pipeline onto `onnxruntime` (no `transformers` support needed). On an RTX 4070 it indexes ≈0.13 s per image with CUDA versus ≈6 s on the CPU (≈45× faster, identical vectors); to use the GPU, install `onnxruntime-gpu` in place of `onnxruntime` (`pip uninstall onnxruntime onnxruntime-gpu` then `pip install onnxruntime-gpu`). DirectML is not supported (its vision model fails). The model is released from memory when indexing finishes
- **EmbeddingGemma 2 in Ollama** — download the model with `ollama pull embeddinggemma-2:740m` (text + image + audio) or `ollama pull embeddinggemma-2:440m` (text + image, smaller). Both return identical vectors, so you can switch sizes without rebuilding (`:latest` is the same as 740m and is used when 740m is missing; 270m / 570m cannot embed images). Images are sent 4 per request (≈0.1–0.2 s per image on an NVIDIA GPU) and retried automatically when Ollama drops a connection. The model is unloaded from VRAM when indexing finishes. Indexes built with the earlier built-in ONNX runtime keep working (cos ≈0.97 with the Ollama vectors); use "rebuild all" to regenerate them exactly. Other Ollama hosts must be listed in `WFS_ALLOWED_BACKEND_HOSTS`
- **Audio waveform colors** (v0.8.0) — waveform thumbnails are colored per format (MP3 blue, WAV green, FLAC amber, OGG/Opus purple, M4A rose)
- **Info tab: dimensions & duration** (v0.5.1) — the detail panel's Info tab now also shows image dimensions (width×height) or video duration, in addition to filename, size, date, tags, and memo
- **Multi-select** — Ctrl+click to select multiple images; Bulk Bar appears for batch operations: select group → "Add to Group" / "Remove from Group"; Favorite All / Unfavorite All; Compare (2–4 images); Move To...; **Export** (downloads all selected images as a ZIP file); **Create PSD** (v0.6.0, combines the selected images into one layered PSD file, positioned top-left on a canvas sized to the largest image); **Edit as Layers** (v0.6.0, opens all selected images in the Image Edit tab at once, each as its own layer); Delete File
@@ -301,7 +302,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Send GenUI Image button** — toolbar button (next to Image Edit); uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; requires a workflow with at least one LoadImage node to be loaded
- **Send to LI node button** (v0.5.2) — toolbar button (next to Send GenUI Image); uploads the selected image and writes its filename into the `image` widget of the node currently selected on the ComfyUI canvas (falling back to the first LoadImage-type node found) — same destination and cross-window bridge as the Image Edit tab's **Send to LI node** button (renamed from "Send to Workflow" in this same release), so both entry points now share one consistent name; requires Workflow Studio to have been opened from ComfyUI's top menu button
- **Send to LV node button** (v0.7.14) — toolbar button (next to Send to LI node), the video equivalent: uploads the selected video and writes its filename into the `file` widget of the node currently selected on the ComfyUI canvas, restricted to ComfyUI's native **Load Video** node (`LoadVideo`) since `file` as a widget name isn't unique enough to search for generically the way `image` is; only enabled when the selected item is a video (mp4/webm); same cross-window bridge and launch requirement as Send to LI node
- **Send CC button** (v0.3.69) — toolbar button, shown only when this Gallery tab is embedded as an iframe inside ComfyUI Comic Creator (a separate custom node); sends the selected image directly into Comic Creator's currently selected panel/overlay; when the selected file is an MP4 video (v0.6.3), it is routed to Comic Creator's Layout-tab Video tool instead — inserted as a new video object in the selected panel (playable, capturable to a still frame) rather than as a flattened image; sending a video while the Image tab is the intended destination is not yet supported and shows an info toast instead
- **Send CC Layout / Send CC Image buttons** (v0.3.69, split in v0.8.11) — toolbar buttons, shown only when this Gallery tab is embedded as an iframe inside ComfyUI Comic Creator (a separate custom node). **Send CC Layout** sends the selected image directly into Comic Creator's Layout tab (the currently selected panel/overlay); when the selected file is an MP4 video (v0.6.3), it is routed to the Layout-tab Video tool instead — inserted as a new video object in the selected panel (playable, capturable to a still frame) rather than as a flattened image. **Send CC Image** (v0.8.11) switches Comic Creator to its Image tab and loads the selected image there — as a new layer if a document is already open, otherwise as a new canvas; videos are not supported there and show an info toast. Requires a Comic Creator version that provides `window.sendImageToImageTab` (the one released together with v0.8.11).
- **Search clear (✕)** — inline ✕ button appears inside the search box whenever text is entered; click to clear immediately
- **Clear all filters (✕ Clear)** — toolbar button next to the view-mode (Thumbnail/Table) switch (v0.5.2, moved from the toolbar's rightmost position so it sits with the other display-affecting controls); resets search text, tag filter, group filter, and favorites filter in one click (sort order is preserved)
- **Workflow auto-save** — images generated from the Generate UI tab have their workflow automatically saved to gallery metadata
@@ -415,6 +416,22 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
</details>
<details>
<summary><h3>TagSpace Tab (v0.9.0)</h3></summary>
- **Choose tags visually in a 3D latent space** — WFS's own data is placed in the EmbeddingGemma 2 vector space and shown in 3D (three.js, bundled): **Cards** (ImagePrompt images with their prompt, drawn as thumbnails), **Tags** (words split out of ImagePrompt prompts, the positive prompts embedded in Gallery images, wildcards, the Tagger DB and the Prompt library, colored by source) and **Gallery points** (a sample of indexed Gallery images as a faint background, each carrying the tags from its own prompt). Nearby items have similar meanings
- **Build / Update** — collects the cards, adds card images that are not yet indexed to the Gallery semantic index, reads the positive prompt embedded in each indexed Gallery image (followed upstream from the sampler's `positive` input, never the negative; cached in `tagspace_prompts.json`, deleted images are skipped), embeds new tags with Ollama (cached in `tagspace_tags.npz`) and projects everything to 3D with PCA. Prompts are split only at commas (and `|` `{}` `BREAK`), not at spaces; phrases over 5 words are dropped. **Tags** sets how many tags are kept — each source is ranked by how many prompts use a tag and the sources take turns, so the many Gallery prompts do not crowd out the others; **Gallery points** sets how many Gallery images are shown. Images and text form two separate clusters in the same space (modality gap), so each is centered on its own mean (images: the cards) before PCA, which makes cards and their matching tags overlap. First build: about 2.5 min for ~1,000 cards plus about 2 min to read the prompts of 29,000 Gallery images (64% had a readable positive prompt); rebuilds with caches: about 15 s
- **Choosing tags** — **All tags** uses every candidate tag instead of the Tags number (up to 20,000); **Min uses** drops tags used in fewer prompts than that (all sources combined); **Wildcards** turns wildcard files on or off as a tag source. Words found only in wildcards are most of the distinct tags (about 37,000 of 47,600 in testing), so All tags without wildcards gives about 10,400 tags (about 6,800 with Min uses 2); ~32,000 points still render at 60 fps. Wildcard YAML is read with a YAML parser, so multi-line (`- >-`) items are included; JSON fragments embedded in prompts (e.g. MOSS-Image bbox layouts) and model file names are not turned into tags
- **Explore** — drag to rotate, right-drag to pan, wheel to zoom; hover shows name, thumbnail and prompt/sources; layer checkboxes for Cards / Thumbnails / Tags / Gallery, and source checkboxes (ImagePrompt / Gallery prompts / Tagger DB / Prompt library / Wildcards) that show or hide tags by origin — a tag stays visible while any of its sources is on, and hidden tags are left out of the nearby/search lists. The search box (Enter, any language) places a marker for the text and lists the nearest items
- **Search with a card's or Gallery image's tags** — a selected card or Gallery point lists its prompt tags as buttons; pick some and search the space with them (joined in prompt order); while tags are picked, the Add button becomes "Add selected (N)" and adds only those tags. A selected Gallery point also has **Open in Gallery**, which opens its folder in the Gallery tab with the image selected (filters are cleared)
- **Make a prompt** — click a card or tag to select it and list nearby items (clicking does not change the prompt); double-click it, press **Add** next to its name under Selection, or press **+** in the list to add it (again to remove); cards and tags are ranked separately and interleaved, so a card also shows its closest tags. Adding a Gallery point adds all tags from that image's prompt as one chip (images without readable tags cannot be added); clicking one lists similar Gallery images together with nearby tags and cards (cards, tags and searches never list Gallery images). The prompt joins the chips with duplicates removed; **Add to GenerateUI (Positive)** appends it to the loaded workflow's positive prompt, **Copy** puts it on the clipboard
- **Tagger fill** — Gallery images without a readable prompt (about a third) can be tagged with a Tagger model (ONNX models from the Tagger tab) during Build / Update — either only the sampled Gallery points or every indexed image without prompt tags. Default thresholds, rating labels dropped, results cached per image and model in `tagspace_tagger.json` (stopping keeps finished images). The tags form the **Tagger fill** source and become the tags of those Gallery points. The status shows CUDA/CPU: on the CPU it is about 0.5 s per image, so make sure `onnxruntime-gpu` is active before tagging everything
- **Glow / Twinkle** — points are drawn as glowing stars on a night-sky background (Gallery points dimmed so dense areas don't wash out); **Twinkle** makes tags, cards and Gallery points twinkle slowly with individual rhythms (selection/nearby highlights stay steady). Both are toolbar toggles; turning Glow off restores the plain dots
- **Hover preview** — hovering the image under Selection or a thumbnail in the Nearby list shows an enlarged preview without changing the selection; the Add / Remove button sits on Selection's title row so it stays reachable while the text scrolls
- **Requirements** — Ollama with EmbeddingGemma 2 (Gallery > Semantic settings > Model); a Gallery semantic index built with Gemini must be rebuilt with EmbeddingGemma 2 first
</details>
<details>
<summary><h3>Image Edit Tab (v0.3.65)</h3></summary>
@@ -429,7 +446,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **Text** — click to place; configure font, size, bold/italic, align, and color; placed as an exact-size text layer sized to the measured bounding box; double-click to re-edit
- **Shape** — drag to draw geometric shapes (Rect / Ellipse / Line / FreeLine); options: shape type, Rounded toggle (Rect/Ellipse), Fill color, Stroke color + width, Opacity; each committed shape becomes an independent draw layer; Stroke None hidden for Line/FreeLine (stroke always active)
- **Fill** (v0.6.2) — bucket fill; click a contiguous same-color region on the active layer to flood-fill it (scanline-based, ported from the Comic Creator plugin's Image tab); **Properties pane**: Mode (Solid / Gradient) — Solid: Color picker; Gradient: Shape (Linear / Radial), a draggable color-stop Ramp (click a stop to select it, drag to reposition, +/- to add/remove stops, color swatch to edit the selected stop's color), and a Direction dial (drag to set angle/radius); both Tolerance (0–255, color-match threshold) and Opacity apply to either mode; Ramp and Direction dial are pointer-event based with pointer capture, so pen tablets work the same as mouse
- **Mask** — 7 sub-tools for painting masks onto a dedicated mask layer; click **Mask** on the second row of the Layers header (renamed from "M" and moved to its own row in v0.6.0) to add a mask layer (Mask tool activates automatically); clicking a mask layer in the list also switches to the Mask tool; **Tool Options bar**: sub-tool buttons (Paint / Color / Alpha / Text / Vector / Shape / SAM3), Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); the overlay is only shown for the currently active mask layer, other mask layers stay hidden until selected (v0.3.70); SAM3 requires Mask Editor One (disabled when not installed); Color / Alpha / Text / Vector / Shape work without Mask Editor One; **Properties pane — Paint**: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); brush size responds to pen pressure on a tablet (v0.6.2, same as the Draw tool); **MASK EDITOR ONE section** (Paint sub-tool, visible when installed): Select opens the ABR stamp-brush library; ✕ clears back to Circle; when an image brush is active, Hardness is disabled and Spacing (5–100%), Angle (0–359°), Sz Jitter (0–100%), Rot. Jitter (on/off) appear; **Edit in Mask Editor One →** (v0.4.0) — sends the current canvas composite (plus the active mask layer's content, if one is selected) to a MaskEditorOne node on the ComfyUI canvas — the currently selected node if it is one, otherwise the first MaskEditorOne node found in the graph (same selection logic as **Send to LI node**) — and opens its full interactive editor (paint, SAM3, BiRefNet, shapes, etc.) in the ComfyUI browser tab; clicking Apply there imports the result back here as a new mask layer; requires Workflow Studio to have been launched from ComfyUI's top-menu button and at least one MaskEditorOne node to exist on the ComfyUI canvas; **Properties pane — Color**: click canvas to flood-select pixels by color similarity; Mode (Add / Subtract), Tolerance (0–255), Feather % (0–100); **Properties pane — Alpha**: extract the active layer's transparency as a mask; Threshold, Invert checkbox, Extract Alpha button; **Properties pane — Text**: click canvas to open a stamp overlay — enter text, set Font / Size / Bold / Italic / Align / Mode (Add / Erase), Stamp or Ctrl+Enter to apply; multi-line supported; **Properties pane — Vector**: click to add Catmull-Rom spline points; Enter (or click first point) closes and fills the polygon; Backspace removes the last point; Esc resets; Mode (Add / Erase); **Properties pane — Shape**: drag to draw Rect or Ellipse; hold Shift for square/circle; blue dashed outline preview while dragging; Mode (Add / Erase); **Properties pane — SAM3**: enter a text prompt, set Max candidates (3/6/9/12), click Segment; select candidate thumbnails (multi-select), Apply Selected (N) applies with current Mode; **Mask layer A/S operation**: A/S toggle — Add (green) composites normally, Subtract (red) cuts the mask from below; **✂ clipping mask button** clips the layer below to the painted area; brush cursor shown as size-accurate circle; strokes can start from outside the canvas margin and continue past the edge
- **Mask** — 7 sub-tools for painting masks onto a dedicated mask layer; click **Mask** on the second row of the Layers header (renamed from "M" and moved to its own row in v0.6.0) to add a mask layer (Mask tool activates automatically); clicking a mask layer in the list also switches to the Mask tool; **Tool Options bar**: sub-tool buttons (Paint / Color / Alpha / Text / Vector / Shape / SAM3), Invert checkbox, Overlay color picker (default red), Blur slider (0–50 px); the overlay is only shown for the currently active mask layer, other mask layers stay hidden until selected (v0.3.70); SAM3 requires Mask Editor One (disabled when not installed); Color / Alpha / Text / Vector / Shape work without Mask Editor One; **Properties pane — Paint**: Mode (Add / Erase), Size (1–200 px), Hardness (0–100%); brush size responds to pen pressure on a tablet (v0.6.2, same as the Draw tool); **MASK EDITOR ONE section** (Paint sub-tool, visible when installed): Select opens the ABR stamp-brush library; ✕ clears back to Circle; when an image brush is active, Hardness is disabled and Spacing (5–100%), Angle (0–359°), Sz Jitter (0–100%), Rot. Jitter (on/off) appear; **Edit in Mask Editor One →** (v0.4.0) — sends the current canvas composite (plus the active mask layer's content, if one is selected) to a MaskEditorOne node on the ComfyUI canvas — the currently selected node if it is one, otherwise the first MaskEditorOne node found in the graph (same selection logic as **Send to LI node**) — and opens its full interactive editor (paint, SAM3, BiRefNet, shapes, etc.) in the ComfyUI browser tab; clicking Apply there imports the result back here as a new mask layer; requires Workflow Studio to have been launched from ComfyUI's top-menu button and at least one MaskEditorOne node to exist on the ComfyUI canvas; **Properties pane — Color**: click canvas to flood-select pixels by color similarity; Mode (Add / Subtract), Tolerance (0–255), Feather % (0–100); **Properties pane — Alpha**: extract the active layer's transparency as a mask; Threshold, Invert checkbox, Extract Alpha button; **Properties pane — Text**: click canvas to open a stamp overlay — enter text, set Font / Size / Bold / Italic / Align / Mode (Add / Erase), Stamp or Ctrl+Enter to apply; multi-line supported; **Properties pane — Vector**: click to add Catmull-Rom spline points; Enter (or click first point) closes and fills the polygon; Backspace removes the last point; Esc resets; Mode (Add / Erase); **Properties pane — Shape**: drag to draw Rect or Ellipse; hold Shift for square/circle; blue dashed outline preview while dragging; Mode (Add / Erase); **Properties pane — SAM3**: enter a text prompt, set Max candidates (3/6/9/12), click Segment; select candidate thumbnails (multi-select), Apply Selected (N) applies with current Mode; **Mask layer A/S operation**: A/S toggle — Add (green) composites normally, Subtract (red) cuts the mask from below; **✂ clipping mask button** clips the layer below to the painted area; brush cursor shown as size-accurate circle; strokes can start from outside the canvas margin and continue past the edge Since v0.8.13 the sent image is also saved to the node's `node.properties.bg_image` (via `node._persistBgDataUrl`, Mask Editor One v0.1.12 or later; ignored on older versions) and the mask layer data carries the image `width`/`height`, so the image and the mask preview survive a ComfyUI page reload or workflow tab switch instead of an older image being restored.
- **Blur** — **Whole Blur**: Gaussian blur to the entire active layer with intensity slider (1–50 px); **Whole Mosaic**: pixelation mosaic with block-size slider (5–100 px); **Rect Blur / Rect Mosaic**: enable the toggle then drag a rectangle on the canvas to apply blur or mosaic to that region only (blue preview for blur, orange for mosaic); Rect Blur and Rect Mosaic are mutually exclusive; all operations support Undo
- **BG Remove** — remove the background from the active layer; **Lightweight (@imgly)**: runs entirely in the browser via CDN (no server required; ~40 MB model downloaded on first use); **BiRefNet**: high-quality removal via Mask Editor One's Python backend (requires Mask Editor One installed and `birefnet.safetensors` in `ComfyUI/models/background_removal/`); **New Layer** option (default on) adds the result as a new layer above the original; when off, replaces the active layer in-place
- **Filter (G'MIC)** — apply G'MIC-Qt filter effects to the active image layer; click **Edit with G'MIC** to launch G'MIC-Qt GUI; select a filter and click OK — a "G'MIC-Qt filter output" window appears; close it to save the result back as the active layer; requires G'MIC-Qt Standalone installed and path configured in Settings → G'MIC-Qt Executable Path
@@ -447,7 +464,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
<details>
<summary><h3>Video Tab (v0.5.0 – v0.7.4)</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
- **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), Wan2.2 (Text to Video), and FastH3 OmniRef (MiniMax H3 Reference 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
- **Plan subtab** (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)
- **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)
- **Edit subtab** (v0.7.0) — a lightweight clip timeline for trimming and concatenating video/image clips outside of generation: add clips via the Video Source panel's **Add to Edit** button or the Asset subtab's **Send to Edit** button, drag blocks to reorder (or use the ◀/▶ toolbar buttons), Duplicate/Delete the selected clip, Clear to empty the timeline. The trim panel for a selected video clip shows a Clipchamp-style scrubber — a time ruler, a draggable playhead synced to the Source preview, and draggable in/out handles with time badges (image clips get a simple hold-duration field instead); the playhead's own time badge sits a row above the in/out handle badges (v0.7.2) so it stays legible even when the playhead lands right on a trim point, and the scrubber has extra headroom/height and spacing from the clip name above it (v0.7.2). **▶ Preview** plays every ready clip back-to-back (trimmed to its in/out points) in the result preview, and **Export** builds and runs the actual ComfyUI graph (trim → crop → concatenate if more than one clip → save), tagging the result into Video Temp automatically. Multi-clip exports keep each clip's own audio (v0.7.4 — previously they were always silent). **Clear** empties the clips and also resets the Audio section to its defaults (v0.7.4)
@@ -465,7 +482,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
- **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** — 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
- **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, a Wan2.2 Text-to-Video node, or a FastH3 OmniRef (MiniMax H3 Reference-to-Video) node — for FastH3 / Pika-H3-Flex the First Image and Last Image fields become Reference Image (ref_image_0) and Reference Image 2 (ref_image_1); leaving either one empty (None / Clear) disconnects that reference input even if the workflow had an image wired to it; Reference Image 2 is never used as the previous block's last frame for "Use previous block's last frame" (the actually generated last frame is used instead) 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); an optional **Add to Video Assets group** checkbox (v0.7.0) also tags the saved frame into Gallery's Video Assets group
- **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
@@ -578,10 +595,10 @@ Samples for the Feeder tab: `ws_sdxl_image_feeder_i2i` / `ws_dwpose_image_feeder
## Manual
A beginner-oriented manual (covers v0.8.9, text-only edition without screenshots) is available in [`docs/manual/`](docs/manual/):
A beginner-oriented manual (covers v0.9.1, text-only edition without screenshots) is available in [`docs/manual/`](docs/manual/):
- English: [`docs/manual/en/`](docs/manual/en/) — ZIP: `Workflow_Studio_Manual_v0.8.9_en.zip`
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.8.9.zip`
- English: [`docs/manual/en/`](docs/manual/en/) — ZIP: `Workflow_Studio_Manual_v0.9.1_en.zip`
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.9.1.zip`
---
@@ -623,7 +640,7 @@ Click the **camera icon** (next to the W button) in ComfyUI's top bar to capture
- **[LM Studio](https://lmstudio.ai/)** — alternative backend for translation and VLM (OpenAI-compatible API)
- **[Lemonade Server](https://lemonade-server.ai/)** — alternative backend for translation, chat, and VLM (OpenAI-compatible API)
- **[Unsloth](https://unsloth.ai/)** — alternative backend for translation, chat, and VLM (OpenAI-compatible API); needs an API key set via `UNSLOTH_API_KEY` in a `.env` file, or Unsloth's Keyless API access → "Chat and inference" turned on — `pip install -r requirements.txt` for `python-dotenv`
- **Gemini API key / EmbeddingGemma 2** (v0.8.2) — only for the Gallery's Semantic Search: either set `GEMINI_API_KEY` in the plugin's `.env` (key from [Google AI Studio](https://aistudio.google.com); free tier available, paid beyond it), or use the local **EmbeddingGemma 2** (no key; `onnxruntime`, `tokenizers` and `huggingface_hub` — normally already present with ComfyUI; the model downloads on first use). `onnxruntime-gpu` makes the local model ≈45× faster on NVIDIA GPUs
- **Gemini API key / EmbeddingGemma 2** (v0.8.2) — only for the Gallery's Semantic Search: either set `GEMINI_API_KEY` in the plugin's `.env` (key from [Google AI Studio](https://aistudio.google.com); free tier available, paid beyond it), or use the local **EmbeddingGemma 2** in [Ollama](https://ollama.com) (no key; `ollama pull embeddinggemma-2:740m` or `embeddinggemma-2:440m`)
- **[Eagle](https://eagle.cool/)** — for auto-saving generated images with metadata
- **[comfyui-mask-editor-one](https://github.com/ketle-man/comfyui-mask-editor-one) (v0.1.9+)** — enables BiRefNet background removal, SAM3 text-prompt segmentation, and ABR stamp-brush library in the Image Edit Mask tool; `birefnet.safetensors` must be placed in `ComfyUI/models/background_removal/` for BiRefNet
- **[psd-tools](https://pypi.org/project/psd-tools/)** (v0.6.0) — enables all PSD (Photoshop) features: Gallery bulk "Create PSD" export, Gallery browsing/thumbnails for `.psd` files, and Image Edit's Save PSD / Open PSD buttons; `pip install -r requirements.txt` (ships prebuilt wheels, no C compiler required); without it, PSD-related actions show an error toast with the install command instead of failing silently
@@ -663,7 +680,8 @@ ComfyUI-Workflow-Studio/
│ │ ├── settings_routes.py # Settings API
│ │ ├── ollama_routes.py # Ollama proxy API
│ │ ├── eagle_routes.py # Eagle integration API
│ │ └── gallery_routes.py # Gallery tab API (Output + ImagePrompt + Style_Catalog sub-tabs)
│ │ ├── gallery_routes.py # Gallery tab API (Output + ImagePrompt + Style_Catalog sub-tabs)
│ │ └── tagspace_routes.py # TagSpace tab API (build / space / search / neighbors)
│ └── services/
│ ├── workflow_service.py # Workflow file operations
│ ├── nodes_service.py # Node metadata & node sets
+3 -3
View File
@@ -2,12 +2,12 @@
ノードが苦手でも大丈夫 ― 画像生成をもっと手軽に、もっと整理して
- 対象バージョン:Workflow Studio v0.8.9
- 対象バージョン:Workflow Studio v0.9.1
- 著者:ketle-man
- © 2026 ketle-man
このマニュアルは、Kindle版をもとにした **画像なしのテキスト版** です。
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.8.9.md` です。
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.9.1.md` です。
画面の例は省略しているため、実際の画面はWorkflow Studioのヘルプタブとあわせてご覧ください。
## 目次
@@ -29,4 +29,4 @@
- [13_付録](chapters/13_付録.md)
- [14_おわりに](chapters/14_おわりに.md)
全章まとめ:[Workflow_Studio_Manual_v0.8.9.md](Workflow_Studio_Manual_v0.8.9.md)
全章まとめ:[Workflow_Studio_Manual_v0.9.1.md](Workflow_Studio_Manual_v0.9.1.md)
Binary file not shown.
@@ -2,12 +2,12 @@
ノードが苦手でも大丈夫 ― 画像生成をもっと手軽に、もっと整理して
- 対象バージョン:Workflow Studio v0.8.9
- 対象バージョン:Workflow Studio v0.9.1
- 著者:ketle-man
- © 2026 ketle-man
このマニュアルは、Kindle版をもとにした **画像なしのテキスト版** です。
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.8.9.md` です。
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.9.1.md` です。
画面の例は省略しているため、実際の画面はWorkflow Studioのヘルプタブとあわせてご覧ください。
---
@@ -97,6 +97,7 @@ Workflow Studioは、そうして作り上げたワークフローを **素早
- **画像編集(Image Edit)** - レイヤー付きの簡易編集、マスクを使った部分的な描き直し(インペイント)
- **ローカルAI連携** - 日本語からのプロンプト翻訳、画像からのプロンプト・タグ作成
- **Tagger・Video** - 画像からのタグ自動生成、動画の生成と簡単な編集
- **TagSpace** - 手持ちのプロンプト・タグ・生成画像を「意味の近さ」で3Dの空間に並べ、眺めながらタグを選ぶ
---
@@ -142,7 +143,7 @@ ComfyUIの「自由さ」はそのままに、「分かりやすさ」と「手
## 本書の対象バージョンと環境
- **Workflow Studio**:v0.8.9
- **Workflow Studio**:v0.9.1
- **ComfyUI**:本書執筆時点の最新版
- **OS**:Windows(画面の例はWindowsのものです)
@@ -358,7 +359,8 @@ Workflow Studioの基本機能は、ComfyUIが動いていれば追加の準備
### あとから必要に応じて
次のものは、特定の機能を使うときだけ必要です。最初は気にしなくてかまいません。
- **Ollama / LM Studio など** - プロンプトの翻訳やAIチャットなどのAI補助機能(第10章)
- **Ollama / LM Studio など** - プロンプトの翻訳やAIチャットなどのAI補助機能(第10章)。
ギャラリーのセマンティック検索をローカルで行うとき(第8章)と、TagSpaceタブ(第11章)には **Ollama** が必要です
- **Eagle** - 生成画像を画像管理ソフトEagleに自動保存する機能(第8章)
- **追加のPythonパッケージ** - Tagger(画像からのタグ生成)やPSD書き出しなど(第11章)
@@ -619,6 +621,7 @@ Workflow Studioを開くと、画面の上部にタブが横一列に並んで
| Image Edit | Image Edit | 画像の簡易編集・マスク作成 | | 第11章 |
| Video | Video | 動画生成・動画編集 | | 第11章 |
| Tagger | Tagger | 画像からタグ(プロンプト)を自動生成 | | 第11章 |
| TagSpace | TagSpace | タグ・プロンプト・生成画像を意味の近さで3D表示し、タグを選ぶ | | 第11章 |
| 設定 | Settings | 言語・テーマ・フォルダなどの設定 | | 本章・第11章 |
| ヘルプ | Help | 機能一覧・ショートカット・トラブル対処 | | 本章 |
| AI TOOL | AI TOOL | ローカルAIによる翻訳・チャット・画像解析 | | 第10章 |
@@ -630,7 +633,7 @@ Workflow Studioを開くと、画面の上部にタブが横一列に並んで
手持ちの素材を一覧にして、探しやすくするタブです。
- **作る** - 生成UI/Image Edit/Video
実際に画像や動画を作ったり、手を加えたりするタブです。
- **補助する** - AI TOOL/Tagger/設定/ヘルプ
- **補助する** - AI TOOL/Tagger/TagSpace/設定/ヘルプ
他のタブでの作業を助けたり、全体の設定をしたりするタブです。
> **ポイント**
@@ -1123,6 +1126,9 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
フォームで値を変えると、ここにも反映されます。
慣れないうちは、ここは「見るだけ」にしておきましょう。
Inputサブタブでは、Raw JSONの上端にある **»** ボタンで、Raw JSONを右端の細い帯に折りたためます(v0.8.12〜)。
プロンプトや画像の欄が広くなります。もう一度押すと元に戻り、折りたたんだ状態は次回も記憶されます。
---
## 5-3 はじめての1枚を生成する
@@ -1130,7 +1136,7 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
いよいよ生成です。最低限、次の3つを確認・設定します。
1. どのモデルで描くか(Model)
2. 何を描くか(Input → Prompt)
2. 何を描くか(Input)
3. 生成する(Generate)
### 手順1:モデルを選ぶ(Model)
@@ -1163,7 +1169,9 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
> 緑色でない項目は、変更してもこのワークフローには影響しません。
### 手順2:プロンプトを書く(Input)
1. サブタブの **Input** を開き、その中の **Prompt** を選びます。
1. サブタブの **Input** を開きます。
左側にプロンプト(Prompt)の欄、右側に入力画像(Image)の欄が並んでいます(v0.8.12〜。それまではPrompt/Imageを切り替える形でした)。
画面の幅が狭いときは、Imageの欄はプロンプトの下に回ります。
2. **Positive Prompt** の欄に、描いてほしい内容を英語で入力します。
```
@@ -1482,8 +1490,8 @@ v0.8.6〜は、こうしたノードを含むワークフローも生成UIで実
### 使い方
1. ワークフロータブで、Nano Bananaのサンプル(`ws_nano_banana_2_1_t2i`)を生成UIに読み込みます。
2. **Prompt** サブタブでプロンプトを編集し、**Apply** を押します。
3. 参考画像を使うときは、**Image** サブタブの画像カードで指定します。
2. **Input** サブタブの左側(Prompt)でプロンプトを編集し、**Apply** を押します。
3. 参考画像を使うときは、**Input** サブタブの右側(Image)の画像カードで指定します。
4. **Generate** を押します。
> **ポイント**
@@ -1500,6 +1508,8 @@ v0.8.6〜は、こうしたノードを含むワークフローも生成UIで実
| Qwen Image 2.1 Turbo | ComfyUI公式テンプレートの文章から画像(T2I)・画像から画像(I2I)。プロンプトエンハンサー(プロンプトを自動で補う機能)の入力欄にも、編集が反映される |
| Flux.3 Klein | 公式テンプレート4種(KleinとKlein SDのT2IとImage Edit) |
| MOSS-Image | Base/SFTのT2Iと、枠で位置を指定するバウンディングボックス版 |
| Fibo 2.0 Edit(v0.8.14〜) | 画像編集のワークフロー。プロンプト強化(PE)を使う構成でも、プロンプト欄の編集がPEのオン・オフどちらにも反映される。ネガティブの欄にはVGL形式(JSON)の説明文がそのまま入る。幅・高さ(Settings)は0で自動 |
| FastH3 OmniRef/Pika-H3-Flex(v0.8.14〜) | MiniMax H3の「参照画像から動画」(Reference to Video)。動画のワークフローとして扱われ、Videoタブ(第11章)でも使える |
| ネイティブLoRAスタック | ComfyUI v0.40のLoRAをまとめて読み込むノード(LoadLoraModel/LoadLoraTextEncoder)。Apply・バイパス・Metadata表示に対応 |
> **注意**
@@ -2119,7 +2129,8 @@ ComfyUIのノード画面に、その画像を作ったワークフローが読
| Send GenUI Image | 選んだ画像を、生成UIのワークフローの入力画像(LoadImageノード)にセットする |
| Send to LI node | 選んだ画像を、ComfyUIのノード画面で選んでいる画像読み込みノードにセットする |
| Image Edit | 選んだ画像を Image Edit タブで開く(第11章) |
| Send CC | 選んだ画像を Comic Creator のコマに送る(Comic Creatorの中でギャラリーを開いたときだけ表示。第11章 11-6) |
| Send CC Layout | 選んだ画像を Comic Creator のレイアウトタブ(選択中のコマ/オーバーレイ)に送る(Comic Creatorの中でギャラリーを開いたときだけ表示。第11章 11-6) |
| Send CC Image | 選んだ画像を Comic Creator の Image タブに送る(作業中のレイヤーがあれば新規レイヤー、なければ新規キャンバス。動画は未対応。表示条件は Send CC Layout と同じ) |
I2I(画像から画像を作る)ワークフローで、生成した画像をさらに描き直していくときに便利です。
@@ -2204,7 +2215,7 @@ Eagleで画像を管理している方は、試してみてください。
| モデル | 特徴 | 準備 |
| --- | --- | --- |
| Gemini Embedding 2 | Googleのサービスで計算する。速い。画像をGoogleに送る | APIキーを取得し、プラグインの `.env` に `GEMINI_API_KEY=キー` と書いて、ComfyUIを再起動する |
| EmbeddingGemma 2 | パソコンの中で計算する(ローカル)。外部に送らない | 追加の準備は不要。初回だけモデルが自動でダウンロードされる |
| EmbeddingGemma 2 | パソコンの中で、**Ollama** を使って計算する(ローカル・無料)。外部に送らない | Ollamaをインストールして起動し、`ollama pull embeddinggemma-2:740m`(または軽量版の `embeddinggemma-2:440m`)を実行する。モデル設定タブで **Ollama URL**(通常は変更不要)と **モデルサイズ** を選ぶ |
> **注意:Geminiを使うとき**
> 画像がGoogleのサービスに送られます。無料枠で送った内容は、Googleの製品改善に使われる場合があります。
@@ -2216,13 +2227,14 @@ Eagleで画像を管理している方は、試してみてください。
2. 「新規のみ」か「全件再作成」を選んで開始します。進み具合が表示され、途中で停止もできます。
3. インデックスは全フォルダで共通の1つです。フォルダごとに少しずつ作っても構いません。
モデルやベクトル次元、画像の精度を変えたときは、**全件再作成** が必要です。
モデルやベクトル次元を変えたときは、**全件再作成** が必要です。
### 速さの目安と設定
- ローカルのEmbeddingGemma 2は、初期設定ではCPUで動き、1枚あたり数秒かかります。
**画像の精度** を「標準」や「軽量」にすると速くなります(変えたら全件再作成)。
**CPUスレッド数** を減らすと、画像生成中のパソコンの負荷が軽くなります。
- NVIDIAのGPUがあれば、ComfyUIのPythonに `onnxruntime-gpu` を入れると、1枚あたり約0.1秒になります(対処は第12章 12-5)。
- ローカルのEmbeddingGemma 2は、v0.8.14からOllamaで動くようになりました(それまでの、ComfyUIのPythonで動かす方式は廃止)。
NVIDIAのGPUなら1枚あたり約0.1〜0.2秒です。インデックスを作り終えると、モデルはGPUメモリから自動で降ろされます。
- インデックスを作るときと、検索するときは、Ollamaが起動している必要があります。
- モデルサイズの740m(テキスト+画像+音声)と440m(テキスト+画像・軽量)は同じ結果を返すので、切り替えても全件再作成は不要です。
v0.8.13以前に作ったインデックスも、そのまま使えます。
- **検索設定** タブで、類似画像・文章検索それぞれの「最小スコア」と最大表示件数を決められます。
スコアの水準はモデルによって違うため、モデルごとに保存されます。
@@ -2702,6 +2714,9 @@ Taggerを使うには、次の準備が必要です。
1. **タグ付け用のモデル**(WD Tagger など)を、ComfyUIの `models/tagger/(モデル名)/` フォルダに置きます。
フォルダには、`.onnx` ファイルと `selected_tags.csv` を入れます。
**PixAI Tagger v1.0**(v0.8.10〜)も使えます。Hugging Faceのコミュニティ変換版(`Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8`)から、
`.onnx` を1つ(GPUなら `model_fp16.onnx` がおすすめ)と、`selected_tags.csv`・`preprocess.json` を同じフォルダに入れると、自動で判別されます。
PixAIのモデルを選ぶと、しきい値のスライダーが、PixAIの推奨値(0.17/0.27)に切り替わります。
2. **追加のPythonパッケージ** をインストールします。
Workflow Studioのフォルダにある `requirements.txt` を使います。
@@ -2717,6 +2732,10 @@ Taggerを使うには、次の準備が必要です。
> 必ず、**ComfyUIが使っているPython** にインストールしてください。
> 分からない場合は、ComfyUI Managerの機能でパッケージをインストールする方法もあります。
> **注意:GPUで動いているか確認する**
> Taggerは、NVIDIAのGPUで動かすと1枚あたり1秒かからないのに対し、CPUで動くとPixAIでは1枚あたり20秒ほどかかります。
> とても遅いときは、GPU用のパッケージが正しく入っているか確認してください(第12章 12-5)。
> **ポイント**
> ローカルAI(第10章)の画像読み取り(VLM)と組み合わせて、両方の結果をまとめたタグを作ることもできます。
@@ -2767,6 +2786,7 @@ Image Editのいちばん便利な使い方が、**インペイント** です
- **MiniMax H3**(画像から動画)
- **LTX-2.5**(文章から動画、画像から動画、最初と最後の画像を指定して動画)
- **Wan2.2**(文章から動画)
- **FastH3 OmniRef/Pika-H3-Flex**(MiniMax H3の参照画像から動画。v0.8.14〜)
対応するワークフローを、ワークフロータブの **Videoに読み込み** で読み込んで使います(第4章 4-6)。
@@ -2790,6 +2810,21 @@ Image Editのいちばん便利な使い方が、**インペイント** です
- 動画ソースパネルは少し広くなり、ファイル名が1行で表示され、ボタンも横一列に並ぶようになりました。
### 参照画像から動画(FastH3 OmniRef/Pika-H3-Flex)(v0.8.14〜)
このタイプのワークフローは、最初と最後の画像ではなく、**参照画像** をもとに動画を作ります。
そのため、Planサブタブの画像の欄は、次のように名前が変わります。
| 欄 | このタイプでの意味 |
| --- | --- |
| Reference Image | 1枚目の参照画像(ふだんの First Image の欄) |
| Reference Image 2 (optional) | 2枚目の参照画像(ふだんの Last Image の欄) |
- プロンプト・長さ(秒)・縦横比などは、ほかの動画ワークフローと同じように使えます。
- 画像の欄を **None** や **Clear** で空にしたブロックは、ワークフローに参照画像が設定されていても、その画像を使わずに生成します。
「+ Block」で追加したブロックは画像が空の状態で始まるので、参照画像が必要なブロックでは、それぞれ画像を指定してください。
- 画像の選び方で **Use previous block's last frame**(前のブロックの最後のフレームを使う)を選ぶと、前のブロックで実際に生成された動画の最後のフレームが、そのブロックの1枚目の参照画像になります。
- Assetサブタブのボタンも「Reference Imageに設定」「Reference Image 2に設定」に変わります。
> **注意**
> 動画生成は、画像生成よりもはるかに多くのGPUメモリと時間を使います。
> 使うモデルの必要スペックを確認してから試しましょう。
@@ -2857,11 +2892,12 @@ Workflow Studioとは別にインストールするソフトですが、両方
両方をインストールすると、次のような連携ができます。
- **Comic Creatorの中でWorkflow Studioのギャラリーを使う**
Comic Creatorの中にWorkflow Studioのギャラリーが表示され、生成した画像を選んで **Send CC** ボタンでコマに送れます。
Comic Creatorの中にWorkflow Studioのギャラリーが表示され、生成した画像を選んで **Send CC Layout**(レイアウトタブのコマ/オーバーレイへ)または **Send CC Image**(Imageタブへ)ボタンで送れます。
(Send CCボタンは、Comic Creatorの中で開いたギャラリーにだけ表示されます)
- **Comic Creatorから画像を生成する**
Comic Creatorの画面から、Workflow Studio(生成UI)を通して、コマに入れる画像を生成したり(T2I)、
描いたラフや配置した画像をもとに描き直したり(I2I・インペイント)できます。
Comic CreatorのNanobanana+タブ(ローカルモード)からは、複数の参照画像を使う画像編集のワークフロー(Flux.3 Klein、Qwen Image 2.1 など)も実行できます(v0.8.12〜)。
「Workflow Studioで画像を作る → Comic Creatorでマンガにまとめる」という流れで、
画像生成からマンガの完成までを、ComfyUIの中だけで行えます。
@@ -2883,6 +2919,74 @@ Workflow Studioとは別にインストールするソフトですが、両方
---
## 11-7 TagSpace - タグとプロンプトを「意味の地図」から選ぶ(v0.9.0〜)
**TagSpace** タブは、Workflow Studioの中にあるプロンプトやタグ、生成した画像を、
**意味の近さ** にしたがって3Dの空間に並べて表示する機能です。
近くにあるものほど意味が近いので、「この雰囲気に近いタグは何だろう」と眺めながら、タグを選んでプロンプトを作れます。
### 空間に並ぶもの
| 種類 | 中身 | 表示 |
| --- | --- | --- |
| カード | ギャラリーの **ImagePrompt**(第8章 8-4)の見本画像と、そのプロンプト | サムネイル |
| タグ | ImagePromptのプロンプト・生成画像に埋め込まれたプロンプト・ワイルドカード・Tagger DB・Promptライブラリの文を、カンマで区切った語 | 出典ごとに色分けした点 |
| Gallery点 | ギャラリーの生成画像の一部(それぞれ、自分のプロンプトのタグを持つ) | 薄い点 |
### 準備
ギャラリーのセマンティック検索(第8章 8-6)と同じく、**Ollama** と **EmbeddingGemma 2** が必要です。
ギャラリーのセマンティック検索の索引を、Gemini Embedding 2で作っている場合は、先にEmbeddingGemma 2で作り直してください。
### 空間を作る
ツールバーで設定を選び、**作成 / 更新** を押します。
| 項目 | 内容 |
| --- | --- |
| タグ数 | 空間に入れるタグの数。出典ごとに、よく使われている順に交互に選ぶ |
| 全タグ | オンにすると、タグ数の代わりに候補のタグをすべて使う(上限2万件) |
| 最低出現回数 | この回数未満しか使われていないタグを除く。2にすると、1回だけの表記ゆれなどが消える |
| ワイルドカード | ワイルドカードをタグの材料に含めるかどうか |
| Gallery点数 | 表示する生成画像の数(0で表示なし) |
| Tagger補完 | プロンプトを取り出せない生成画像に、Taggerのモデルでタグを付ける(OFF/モデル名。「Gallery点のみ」か「プロンプトの無い全画像」を選ぶ) |
- 1回目は、画像のプロンプトの読み取りやタグの準備に数分かかります。2回目からは、前回の結果を使うので数秒〜数十秒で終わります。
- 状態表示に、カード・タグ・Gallery点の数が出ます。候補の一部だけを使ったときは「(候補 N)」と出ます。
> **ポイント**
> タグの種類の大半は、ワイルドカードにしか出てこない語です。
> 「ワイルドカード」をオフにして「全タグ」をオンにすると、自分が実際に使ってきたタグだけを全部並べられます(検証環境では約1万種)。
> **注意**
> Tagger補完は、CPUで動くと1枚あたり0.5秒ほどかかります。「プロンプトの無い全画像」を選ぶ前に、TaggerがGPUで動いているか確認してください(第12章 12-5)。
### 見る・探す
- **ドラッグ** で回転、**右ドラッグ** で移動、**ホイール** でズームします。
- 点にカーソルを合わせると、名前・サムネイル・プロンプトや出典が表示されます。
- ツールバーのチェックボックスで、カード・サムネイル・タグ・Galleryの表示や、**発光**(夜空に光る星のような表示)・**またたき** を切り替えます。
出典ごとのチェックボックスで、タグを出典ごとに表示・非表示にできます。
- 右上の検索欄に言葉や文章を入れて **Enter** を押すと(日本語も可)、その意味の位置に白い印が付き、近いカードやタグが一覧に出ます。
### タグを選んでプロンプトを作る
1. カードやタグをクリックすると選択され、右の **近くの要素** に、意味の近いカード・タグが並びます。
(Gallery点をクリックすると、似ている生成画像も並びます)
2. プロンプトに入れたいものを **ダブルクリック** するか、**選択中** の **追加**、または一覧の **+** を押します。
カードはプロンプト全体、タグはタグそのもの、Gallery点はその画像のタグが、右端の **プロンプト** 欄に入ります。
3. **GenerateUIへ追記(Positive)** で、生成UIに読み込んだワークフローのポジティブプロンプトに追記します(先に生成UIでワークフローを読み込んでおきます)。
**コピー** でクリップボードにコピーすることもできます。
### カードや生成画像のタグで探す
カードやGallery点を選ぶと、**選択中** に、そのプロンプトのタグがボタンで並びます。
タグをクリックして選び(もう一度で解除)、**選択したタグで空間検索** を押すと、選んだタグで空間を検索します。
「この画像の、髪型と服装だけに近いものを探したい」といったときに便利です。
タグを選んでいる間は、**選択中** の **追加** ボタンが **選択したタグを追加(N)** に変わり、選んだタグだけをプロンプト欄に追加できます。
タグを選んでいなければ、これまでどおり全体(カードはプロンプト全文、Gallery点はすべてのタグ)が追加されます。
Gallery点を選んでいるときは、**選択中** に **Galleryで開く** ボタンも表示されます。
押すとギャラリータブに切り替わり、その画像のフォルダが選ばれ、画像一覧でその画像が選択された状態になります(右の詳細も開きます)。
画像が一覧に必ず出るよう、ギャラリーの検索・お気に入り・タグ・グループの絞り込みは解除されます。
カードのプロンプト全文は、**プロンプト全文** を開くと読めます。
---
> **この章のまとめ**
> - ノードタブでインストール済みのノードを一覧・整理でき、WS Libraryで使える
> - Taggerは画像からタグを自動生成する。モデルと追加パッケージの準備が必要
@@ -2890,6 +2994,7 @@ Workflow Studioとは別にインストールするソフトですが、両方
> - Videoタブで、対応する動画生成モデルを使った動画作りと簡単な編集ができる
> - 設定タブの「デフォルトCheckpoint」と「データ管理(バックアップ)」は特に便利
> - 同じ作者の Comic Creator と組み合わせると、生成した画像でマンガを作れる
> - TagSpaceでは、手持ちのタグ・プロンプト・生成画像を意味の近さで3Dに並べ、眺めながらタグを選んでプロンプトを作れる
---
@@ -3038,6 +3143,11 @@ Ollamaの場合は `ollama pull (モデル名)` でモデルをダウンロ
- `ComfyUI/models/tagger/(モデル名)/` フォルダに、`.onnx` ファイル(と `selected_tags.csv`)が入っているか確認します。
- 追加のPythonパッケージ(onnxruntime)が、**ComfyUIが使っているPython** にインストールされているか確認します(第11章 11-2)。
### Taggerがとても遅い(GPUが使われない)
ComfyUIのPythonに、CPU版の `onnxruntime` とGPU版の `onnxruntime-gpu` が両方入っていると、GPUが使われなくなります。
(ほかのカスタムノードのインストールで、CPU版が入ることがあります)
ComfyUIを停止し、ComfyUIのPythonで `pip uninstall -y onnxruntime onnxruntime-gpu` のあと `pip install onnxruntime-gpu` を実行して、ComfyUIを再起動してください(DirectMLは非対応)。
### PSD関連の機能がエラーになる
追加のPythonパッケージ(psd-tools)が必要です。
エラーメッセージに表示されるインストール用のコマンドを、ComfyUIが使っているPythonで実行してから、ComfyUIを再起動してください。
@@ -3045,9 +3155,18 @@ Ollamaの場合は `ollama pull (モデル名)` でモデルをダウンロ
### セマンティック検索(Gallery)がうまく動かない
| 症状 | 原因 | 対処 |
| --- | --- | --- |
| GPUが検出されない(設定に「GPU未検出」と出る、実行がCPUになる) | ComfyUIのPythonに入っているonnxruntimeがCPU版 | ComfyUIを停止し、ComfyUIのPythonで `pip uninstall -y onnxruntime onnxruntime-gpu` のあと `pip install onnxruntime-gpu` を実行して、ComfyUIを再起動する(DirectMLは非対応) |
| 「Ollamaに接続できません」と出る | Ollamaが起動していない、またはOllama URLが違う | Ollamaを起動する(インデックス作成中と検索時に必要)。歯車ボタンのモデル設定タブでOllama URLを確認する |
| 「Ollamaのモデルが未取得です」と出る | EmbeddingGemma 2をダウンロードしていない | `ollama pull embeddinggemma-2:740m`(または `embeddinggemma-2:440m`)を実行する |
| インデックス作成が「connection was forcibly closed」などでときどき失敗する | セキュリティソフト(AdGuardなど)がOllamaの通信に割り込んでいる | Ollamaをフィルタの対象から外す。失敗した画像は、次回の「新規・変更された画像のみ」で作り直される |
| Geminiで「GEMINI_API_KEYが未設定」と出る・キーが拒否される | `.env` にキーが無い、または行頭に `#` が付いている | プラグインの `.env`(`.env.example` をコピー)に `GEMINI_API_KEY=キー` と書き、ComfyUIを再起動する。`.env` は起動時にしか読み込まれない |
| 検索やSimilarの結果が出ない | 選んだフォルダにインデックス済みの画像が無い | 歯車ボタンでインデックスを作る。緑の点があるフォルダを選ぶ。モデルや精度を変えたときは「全件再作成」 |
| 検索やSimilarの結果が出ない | 選んだフォルダにインデックス済みの画像が無い | 歯車ボタンでインデックスを作る。緑の点があるフォルダを選ぶ。モデルやベクトル次元を変えたときは「全件再作成」 |
### TagSpaceの空間が作れない
| 症状 | 原因 | 対処 |
| --- | --- | --- |
| 「OllamaのEmbeddingGemma 2が必要です」と出る | Ollamaが起動していない、またはモデルが無い | セマンティック検索と同じ準備をする(上の表) |
| 「Galleryのセマンティック索引は … で作られています」と出る | ギャラリーの索引をGeminiで作っている | ギャラリーのセマンティック設定でEmbeddingGemma 2を選び、「全件再作成」する |
| 作成にとても時間がかかる | 1回目は、画像のプロンプトの読み取りと、新しいタグの準備に時間がかかる | 2回目からは速くなる。Tagger補完を使うときは、TaggerがGPUで動いているか確認する(上の「Taggerがとても遅い」) |
### パートナーAPI(Nano Banana)が「認証に失敗しました」と出る
`.env` にComfy APIキーが無いのが原因です。プラグインの `.env` に `COMFY_API_KEY=キー`(platform.comfy.orgで発行)を書き、ComfyUIを再起動してください(第5章 5-8)。
@@ -3141,6 +3260,7 @@ Workflow Studioの **ヘルプ** タブにも、トラブルシューティン
| LoRA | 絵柄やキャラクターなどを追加で覚えさせる小さなモデル | 第6章 |
| Ollama | ローカルAIを手軽に動かせるソフト | 第10章 |
| T2I(Text to Image) | 文章(プロンプト)から画像を作ること | 第5章 |
| TagSpace | タグ・プロンプト・生成画像を意味の近さで3Dの空間に並べて表示するタブ | 第11章 |
| VAE | 画像の色合いや細部を仕上げるモデル | 第6章 |
| VLM | 画像を読み取れるAIモデル | 第10章 |
| VRAM | GPU(グラフィックボード)のメモリ | 第10章 |
Binary file not shown.
+2 -1
View File
@@ -83,6 +83,7 @@ Workflow Studioは、そうして作り上げたワークフローを **素早
- **画像編集(Image Edit)** - レイヤー付きの簡易編集、マスクを使った部分的な描き直し(インペイント)
- **ローカルAI連携** - 日本語からのプロンプト翻訳、画像からのプロンプト・タグ作成
- **Tagger・Video** - 画像からのタグ自動生成、動画の生成と簡単な編集
- **TagSpace** - 手持ちのプロンプト・タグ・生成画像を「意味の近さ」で3Dの空間に並べ、眺めながらタグを選ぶ
---
@@ -128,7 +129,7 @@ ComfyUIの「自由さ」はそのままに、「分かりやすさ」と「手
## 本書の対象バージョンと環境
- **Workflow Studio**:v0.8.9
- **Workflow Studio**:v0.9.1
- **ComfyUI**:本書執筆時点の最新版
- **OS**:Windows(画面の例はWindowsのものです)
@@ -19,7 +19,8 @@ Workflow Studioの基本機能は、ComfyUIが動いていれば追加の準備
### あとから必要に応じて
次のものは、特定の機能を使うときだけ必要です。最初は気にしなくてかまいません。
- **Ollama / LM Studio など** - プロンプトの翻訳やAIチャットなどのAI補助機能(第10章)
- **Ollama / LM Studio など** - プロンプトの翻訳やAIチャットなどのAI補助機能(第10章)。
ギャラリーのセマンティック検索をローカルで行うとき(第8章)と、TagSpaceタブ(第11章)には **Ollama** が必要です
- **Eagle** - 生成画像を画像管理ソフトEagleに自動保存する機能(第8章)
- **追加のPythonパッケージ** - Tagger(画像からのタグ生成)やPSD書き出しなど(第11章)
@@ -24,6 +24,7 @@ Workflow Studioを開くと、画面の上部にタブが横一列に並んで
| Image Edit | Image Edit | 画像の簡易編集・マスク作成 | | 第11章 |
| Video | Video | 動画生成・動画編集 | | 第11章 |
| Tagger | Tagger | 画像からタグ(プロンプト)を自動生成 | | 第11章 |
| TagSpace | TagSpace | タグ・プロンプト・生成画像を意味の近さで3D表示し、タグを選ぶ | | 第11章 |
| 設定 | Settings | 言語・テーマ・フォルダなどの設定 | | 本章・第11章 |
| ヘルプ | Help | 機能一覧・ショートカット・トラブル対処 | | 本章 |
| AI TOOL | AI TOOL | ローカルAIによる翻訳・チャット・画像解析 | | 第10章 |
@@ -35,7 +36,7 @@ Workflow Studioを開くと、画面の上部にタブが横一列に並んで
手持ちの素材を一覧にして、探しやすくするタブです。
- **作る** - 生成UI/Image Edit/Video
実際に画像や動画を作ったり、手を加えたりするタブです。
- **補助する** - AI TOOL/Tagger/設定/ヘルプ
- **補助する** - AI TOOL/Tagger/TagSpace/設定/ヘルプ
他のタブでの作業を助けたり、全体の設定をしたりするタブです。
> **ポイント**
@@ -72,6 +72,9 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
フォームで値を変えると、ここにも反映されます。
慣れないうちは、ここは「見るだけ」にしておきましょう。
Inputサブタブでは、Raw JSONの上端にある **»** ボタンで、Raw JSONを右端の細い帯に折りたためます(v0.8.12〜)。
プロンプトや画像の欄が広くなります。もう一度押すと元に戻り、折りたたんだ状態は次回も記憶されます。
---
## 5-3 はじめての1枚を生成する
@@ -79,7 +82,7 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
いよいよ生成です。最低限、次の3つを確認・設定します。
1. どのモデルで描くか(Model)
2. 何を描くか(Input → Prompt)
2. 何を描くか(Input)
3. 生成する(Generate)
### 手順1:モデルを選ぶ(Model)
@@ -112,7 +115,9 @@ Input・Model・Settingsの右側には、ワークフローの中身がJSON形
> 緑色でない項目は、変更してもこのワークフローには影響しません。
### 手順2:プロンプトを書く(Input)
1. サブタブの **Input** を開き、その中の **Prompt** を選びます。
1. サブタブの **Input** を開きます。
左側にプロンプト(Prompt)の欄、右側に入力画像(Image)の欄が並んでいます(v0.8.12〜。それまではPrompt/Imageを切り替える形でした)。
画面の幅が狭いときは、Imageの欄はプロンプトの下に回ります。
2. **Positive Prompt** の欄に、描いてほしい内容を英語で入力します。
```
@@ -196,8 +196,8 @@ v0.8.6〜は、こうしたノードを含むワークフローも生成UIで実
### 使い方
1. ワークフロータブで、Nano Bananaのサンプル(`ws_nano_banana_2_1_t2i`)を生成UIに読み込みます。
2. **Prompt** サブタブでプロンプトを編集し、**Apply** を押します。
3. 参考画像を使うときは、**Image** サブタブの画像カードで指定します。
2. **Input** サブタブの左側(Prompt)でプロンプトを編集し、**Apply** を押します。
3. 参考画像を使うときは、**Input** サブタブの右側(Image)の画像カードで指定します。
4. **Generate** を押します。
> **ポイント**
@@ -214,6 +214,8 @@ v0.8.6〜は、こうしたノードを含むワークフローも生成UIで実
| Qwen Image 2.1 Turbo | ComfyUI公式テンプレートの文章から画像(T2I)・画像から画像(I2I)。プロンプトエンハンサー(プロンプトを自動で補う機能)の入力欄にも、編集が反映される |
| Flux.3 Klein | 公式テンプレート4種(KleinとKlein SDのT2IとImage Edit) |
| MOSS-Image | Base/SFTのT2Iと、枠で位置を指定するバウンディングボックス版 |
| Fibo 2.0 Edit(v0.8.14〜) | 画像編集のワークフロー。プロンプト強化(PE)を使う構成でも、プロンプト欄の編集がPEのオン・オフどちらにも反映される。ネガティブの欄にはVGL形式(JSON)の説明文がそのまま入る。幅・高さ(Settings)は0で自動 |
| FastH3 OmniRef/Pika-H3-Flex(v0.8.14〜) | MiniMax H3の「参照画像から動画」(Reference to Video)。動画のワークフローとして扱われ、Videoタブ(第11章)でも使える |
| ネイティブLoRAスタック | ComfyUI v0.40のLoRAをまとめて読み込むノード(LoadLoraModel/LoadLoraTextEncoder)。Apply・バイパス・Metadata表示に対応 |
> **注意**
@@ -154,7 +154,8 @@ ComfyUIのノード画面に、その画像を作ったワークフローが読
| Send GenUI Image | 選んだ画像を、生成UIのワークフローの入力画像(LoadImageノード)にセットする |
| Send to LI node | 選んだ画像を、ComfyUIのノード画面で選んでいる画像読み込みノードにセットする |
| Image Edit | 選んだ画像を Image Edit タブで開く(第11章) |
| Send CC | 選んだ画像を Comic Creator のコマに送る(Comic Creatorの中でギャラリーを開いたときだけ表示。第11章 11-6) |
| Send CC Layout | 選んだ画像を Comic Creator のレイアウトタブ(選択中のコマ/オーバーレイ)に送る(Comic Creatorの中でギャラリーを開いたときだけ表示。第11章 11-6) |
| Send CC Image | 選んだ画像を Comic Creator の Image タブに送る(作業中のレイヤーがあれば新規レイヤー、なければ新規キャンバス。動画は未対応。表示条件は Send CC Layout と同じ) |
I2I(画像から画像を作る)ワークフローで、生成した画像をさらに描き直していくときに便利です。
@@ -239,7 +240,7 @@ Eagleで画像を管理している方は、試してみてください。
| モデル | 特徴 | 準備 |
| --- | --- | --- |
| Gemini Embedding 2 | Googleのサービスで計算する。速い。画像をGoogleに送る | APIキーを取得し、プラグインの `.env` に `GEMINI_API_KEY=キー` と書いて、ComfyUIを再起動する |
| EmbeddingGemma 2 | パソコンの中で計算する(ローカル)。外部に送らない | 追加の準備は不要。初回だけモデルが自動でダウンロードされる |
| EmbeddingGemma 2 | パソコンの中で、**Ollama** を使って計算する(ローカル・無料)。外部に送らない | Ollamaをインストールして起動し、`ollama pull embeddinggemma-2:740m`(または軽量版の `embeddinggemma-2:440m`)を実行する。モデル設定タブで **Ollama URL**(通常は変更不要)と **モデルサイズ** を選ぶ |
> **注意:Geminiを使うとき**
> 画像がGoogleのサービスに送られます。無料枠で送った内容は、Googleの製品改善に使われる場合があります。
@@ -251,13 +252,14 @@ Eagleで画像を管理している方は、試してみてください。
2. 「新規のみ」か「全件再作成」を選んで開始します。進み具合が表示され、途中で停止もできます。
3. インデックスは全フォルダで共通の1つです。フォルダごとに少しずつ作っても構いません。
モデルやベクトル次元、画像の精度を変えたときは、**全件再作成** が必要です。
モデルやベクトル次元を変えたときは、**全件再作成** が必要です。
### 速さの目安と設定
- ローカルのEmbeddingGemma 2は、初期設定ではCPUで動き、1枚あたり数秒かかります。
**画像の精度** を「標準」や「軽量」にすると速くなります(変えたら全件再作成)。
**CPUスレッド数** を減らすと、画像生成中のパソコンの負荷が軽くなります。
- NVIDIAのGPUがあれば、ComfyUIのPythonに `onnxruntime-gpu` を入れると、1枚あたり約0.1秒になります(対処は第12章 12-5)。
- ローカルのEmbeddingGemma 2は、v0.8.14からOllamaで動くようになりました(それまでの、ComfyUIのPythonで動かす方式は廃止)。
NVIDIAのGPUなら1枚あたり約0.1〜0.2秒です。インデックスを作り終えると、モデルはGPUメモリから自動で降ろされます。
- インデックスを作るときと、検索するときは、Ollamaが起動している必要があります。
- モデルサイズの740m(テキスト+画像+音声)と440m(テキスト+画像・軽量)は同じ結果を返すので、切り替えても全件再作成は不要です。
v0.8.13以前に作ったインデックスも、そのまま使えます。
- **検索設定** タブで、類似画像・文章検索それぞれの「最小スコア」と最大表示件数を決められます。
スコアの水準はモデルによって違うため、モデルごとに保存されます。
@@ -54,6 +54,9 @@ Taggerを使うには、次の準備が必要です。
1. **タグ付け用のモデル**(WD Tagger など)を、ComfyUIの `models/tagger/(モデル名)/` フォルダに置きます。
フォルダには、`.onnx` ファイルと `selected_tags.csv` を入れます。
**PixAI Tagger v1.0**(v0.8.10〜)も使えます。Hugging Faceのコミュニティ変換版(`Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8`)から、
`.onnx` を1つ(GPUなら `model_fp16.onnx` がおすすめ)と、`selected_tags.csv`・`preprocess.json` を同じフォルダに入れると、自動で判別されます。
PixAIのモデルを選ぶと、しきい値のスライダーが、PixAIの推奨値(0.17/0.27)に切り替わります。
2. **追加のPythonパッケージ** をインストールします。
Workflow Studioのフォルダにある `requirements.txt` を使います。
@@ -69,6 +72,10 @@ Taggerを使うには、次の準備が必要です。
> 必ず、**ComfyUIが使っているPython** にインストールしてください。
> 分からない場合は、ComfyUI Managerの機能でパッケージをインストールする方法もあります。
> **注意:GPUで動いているか確認する**
> Taggerは、NVIDIAのGPUで動かすと1枚あたり1秒かからないのに対し、CPUで動くとPixAIでは1枚あたり20秒ほどかかります。
> とても遅いときは、GPU用のパッケージが正しく入っているか確認してください(第12章 12-5)。
> **ポイント**
> ローカルAI(第10章)の画像読み取り(VLM)と組み合わせて、両方の結果をまとめたタグを作ることもできます。
@@ -119,6 +126,7 @@ Image Editのいちばん便利な使い方が、**インペイント** です
- **MiniMax H3**(画像から動画)
- **LTX-2.5**(文章から動画、画像から動画、最初と最後の画像を指定して動画)
- **Wan2.2**(文章から動画)
- **FastH3 OmniRef/Pika-H3-Flex**(MiniMax H3の参照画像から動画。v0.8.14〜)
対応するワークフローを、ワークフロータブの **Videoに読み込み** で読み込んで使います(第4章 4-6)。
@@ -142,6 +150,21 @@ Image Editのいちばん便利な使い方が、**インペイント** です
- 動画ソースパネルは少し広くなり、ファイル名が1行で表示され、ボタンも横一列に並ぶようになりました。
### 参照画像から動画(FastH3 OmniRef/Pika-H3-Flex)(v0.8.14〜)
このタイプのワークフローは、最初と最後の画像ではなく、**参照画像** をもとに動画を作ります。
そのため、Planサブタブの画像の欄は、次のように名前が変わります。
| 欄 | このタイプでの意味 |
| --- | --- |
| Reference Image | 1枚目の参照画像(ふだんの First Image の欄) |
| Reference Image 2 (optional) | 2枚目の参照画像(ふだんの Last Image の欄) |
- プロンプト・長さ(秒)・縦横比などは、ほかの動画ワークフローと同じように使えます。
- 画像の欄を **None** や **Clear** で空にしたブロックは、ワークフローに参照画像が設定されていても、その画像を使わずに生成します。
「+ Block」で追加したブロックは画像が空の状態で始まるので、参照画像が必要なブロックでは、それぞれ画像を指定してください。
- 画像の選び方で **Use previous block's last frame**(前のブロックの最後のフレームを使う)を選ぶと、前のブロックで実際に生成された動画の最後のフレームが、そのブロックの1枚目の参照画像になります。
- Assetサブタブのボタンも「Reference Imageに設定」「Reference Image 2に設定」に変わります。
> **注意**
> 動画生成は、画像生成よりもはるかに多くのGPUメモリと時間を使います。
> 使うモデルの必要スペックを確認してから試しましょう。
@@ -209,11 +232,12 @@ Workflow Studioとは別にインストールするソフトですが、両方
両方をインストールすると、次のような連携ができます。
- **Comic Creatorの中でWorkflow Studioのギャラリーを使う**
Comic Creatorの中にWorkflow Studioのギャラリーが表示され、生成した画像を選んで **Send CC** ボタンでコマに送れます。
Comic Creatorの中にWorkflow Studioのギャラリーが表示され、生成した画像を選んで **Send CC Layout**(レイアウトタブのコマ/オーバーレイへ)または **Send CC Image**(Imageタブへ)ボタンで送れます。
(Send CCボタンは、Comic Creatorの中で開いたギャラリーにだけ表示されます)
- **Comic Creatorから画像を生成する**
Comic Creatorの画面から、Workflow Studio(生成UI)を通して、コマに入れる画像を生成したり(T2I)、
描いたラフや配置した画像をもとに描き直したり(I2I・インペイント)できます。
Comic CreatorのNanobanana+タブ(ローカルモード)からは、複数の参照画像を使う画像編集のワークフロー(Flux.3 Klein、Qwen Image 2.1 など)も実行できます(v0.8.12〜)。
「Workflow Studioで画像を作る → Comic Creatorでマンガにまとめる」という流れで、
画像生成からマンガの完成までを、ComfyUIの中だけで行えます。
@@ -235,6 +259,74 @@ Workflow Studioとは別にインストールするソフトですが、両方
---
## 11-7 TagSpace - タグとプロンプトを「意味の地図」から選ぶ(v0.9.0〜)
**TagSpace** タブは、Workflow Studioの中にあるプロンプトやタグ、生成した画像を、
**意味の近さ** にしたがって3Dの空間に並べて表示する機能です。
近くにあるものほど意味が近いので、「この雰囲気に近いタグは何だろう」と眺めながら、タグを選んでプロンプトを作れます。
### 空間に並ぶもの
| 種類 | 中身 | 表示 |
| --- | --- | --- |
| カード | ギャラリーの **ImagePrompt**(第8章 8-4)の見本画像と、そのプロンプト | サムネイル |
| タグ | ImagePromptのプロンプト・生成画像に埋め込まれたプロンプト・ワイルドカード・Tagger DB・Promptライブラリの文を、カンマで区切った語 | 出典ごとに色分けした点 |
| Gallery点 | ギャラリーの生成画像の一部(それぞれ、自分のプロンプトのタグを持つ) | 薄い点 |
### 準備
ギャラリーのセマンティック検索(第8章 8-6)と同じく、**Ollama** と **EmbeddingGemma 2** が必要です。
ギャラリーのセマンティック検索の索引を、Gemini Embedding 2で作っている場合は、先にEmbeddingGemma 2で作り直してください。
### 空間を作る
ツールバーで設定を選び、**作成 / 更新** を押します。
| 項目 | 内容 |
| --- | --- |
| タグ数 | 空間に入れるタグの数。出典ごとに、よく使われている順に交互に選ぶ |
| 全タグ | オンにすると、タグ数の代わりに候補のタグをすべて使う(上限2万件) |
| 最低出現回数 | この回数未満しか使われていないタグを除く。2にすると、1回だけの表記ゆれなどが消える |
| ワイルドカード | ワイルドカードをタグの材料に含めるかどうか |
| Gallery点数 | 表示する生成画像の数(0で表示なし) |
| Tagger補完 | プロンプトを取り出せない生成画像に、Taggerのモデルでタグを付ける(OFF/モデル名。「Gallery点のみ」か「プロンプトの無い全画像」を選ぶ) |
- 1回目は、画像のプロンプトの読み取りやタグの準備に数分かかります。2回目からは、前回の結果を使うので数秒〜数十秒で終わります。
- 状態表示に、カード・タグ・Gallery点の数が出ます。候補の一部だけを使ったときは「(候補 N)」と出ます。
> **ポイント**
> タグの種類の大半は、ワイルドカードにしか出てこない語です。
> 「ワイルドカード」をオフにして「全タグ」をオンにすると、自分が実際に使ってきたタグだけを全部並べられます(検証環境では約1万種)。
> **注意**
> Tagger補完は、CPUで動くと1枚あたり0.5秒ほどかかります。「プロンプトの無い全画像」を選ぶ前に、TaggerがGPUで動いているか確認してください(第12章 12-5)。
### 見る・探す
- **ドラッグ** で回転、**右ドラッグ** で移動、**ホイール** でズームします。
- 点にカーソルを合わせると、名前・サムネイル・プロンプトや出典が表示されます。
- ツールバーのチェックボックスで、カード・サムネイル・タグ・Galleryの表示や、**発光**(夜空に光る星のような表示)・**またたき** を切り替えます。
出典ごとのチェックボックスで、タグを出典ごとに表示・非表示にできます。
- 右上の検索欄に言葉や文章を入れて **Enter** を押すと(日本語も可)、その意味の位置に白い印が付き、近いカードやタグが一覧に出ます。
### タグを選んでプロンプトを作る
1. カードやタグをクリックすると選択され、右の **近くの要素** に、意味の近いカード・タグが並びます。
(Gallery点をクリックすると、似ている生成画像も並びます)
2. プロンプトに入れたいものを **ダブルクリック** するか、**選択中** の **追加**、または一覧の **+** を押します。
カードはプロンプト全体、タグはタグそのもの、Gallery点はその画像のタグが、右端の **プロンプト** 欄に入ります。
3. **GenerateUIへ追記(Positive)** で、生成UIに読み込んだワークフローのポジティブプロンプトに追記します(先に生成UIでワークフローを読み込んでおきます)。
**コピー** でクリップボードにコピーすることもできます。
### カードや生成画像のタグで探す
カードやGallery点を選ぶと、**選択中** に、そのプロンプトのタグがボタンで並びます。
タグをクリックして選び(もう一度で解除)、**選択したタグで空間検索** を押すと、選んだタグで空間を検索します。
「この画像の、髪型と服装だけに近いものを探したい」といったときに便利です。
タグを選んでいる間は、**選択中** の **追加** ボタンが **選択したタグを追加(N)** に変わり、選んだタグだけをプロンプト欄に追加できます。
タグを選んでいなければ、これまでどおり全体(カードはプロンプト全文、Gallery点はすべてのタグ)が追加されます。
Gallery点を選んでいるときは、**選択中** に **Galleryで開く** ボタンも表示されます。
押すとギャラリータブに切り替わり、その画像のフォルダが選ばれ、画像一覧でその画像が選択された状態になります(右の詳細も開きます)。
画像が一覧に必ず出るよう、ギャラリーの検索・お気に入り・タグ・グループの絞り込みは解除されます。
カードのプロンプト全文は、**プロンプト全文** を開くと読めます。
---
> **この章のまとめ**
> - ノードタブでインストール済みのノードを一覧・整理でき、WS Libraryで使える
> - Taggerは画像からタグを自動生成する。モデルと追加パッケージの準備が必要
@@ -242,3 +334,4 @@ Workflow Studioとは別にインストールするソフトですが、両方
> - Videoタブで、対応する動画生成モデルを使った動画作りと簡単な編集ができる
> - 設定タブの「デフォルトCheckpoint」と「データ管理(バックアップ)」は特に便利
> - 同じ作者の Comic Creator と組み合わせると、生成した画像でマンガを作れる
> - TagSpaceでは、手持ちのタグ・プロンプト・生成画像を意味の近さで3Dに並べ、眺めながらタグを選んでプロンプトを作れる
@@ -143,6 +143,11 @@ Ollamaの場合は `ollama pull (モデル名)` でモデルをダウンロ
- `ComfyUI/models/tagger/(モデル名)/` フォルダに、`.onnx` ファイル(と `selected_tags.csv`)が入っているか確認します。
- 追加のPythonパッケージ(onnxruntime)が、**ComfyUIが使っているPython** にインストールされているか確認します(第11章 11-2)。
### Taggerがとても遅い(GPUが使われない)
ComfyUIのPythonに、CPU版の `onnxruntime` とGPU版の `onnxruntime-gpu` が両方入っていると、GPUが使われなくなります。
(ほかのカスタムノードのインストールで、CPU版が入ることがあります)
ComfyUIを停止し、ComfyUIのPythonで `pip uninstall -y onnxruntime onnxruntime-gpu` のあと `pip install onnxruntime-gpu` を実行して、ComfyUIを再起動してください(DirectMLは非対応)。
### PSD関連の機能がエラーになる
追加のPythonパッケージ(psd-tools)が必要です。
エラーメッセージに表示されるインストール用のコマンドを、ComfyUIが使っているPythonで実行してから、ComfyUIを再起動してください。
@@ -150,9 +155,18 @@ Ollamaの場合は `ollama pull (モデル名)` でモデルをダウンロ
### セマンティック検索(Gallery)がうまく動かない
| 症状 | 原因 | 対処 |
| --- | --- | --- |
| GPUが検出されない(設定に「GPU未検出」と出る、実行がCPUになる) | ComfyUIのPythonに入っているonnxruntimeがCPU版 | ComfyUIを停止し、ComfyUIのPythonで `pip uninstall -y onnxruntime onnxruntime-gpu` のあと `pip install onnxruntime-gpu` を実行して、ComfyUIを再起動する(DirectMLは非対応) |
| 「Ollamaに接続できません」と出る | Ollamaが起動していない、またはOllama URLが違う | Ollamaを起動する(インデックス作成中と検索時に必要)。歯車ボタンのモデル設定タブでOllama URLを確認する |
| 「Ollamaのモデルが未取得です」と出る | EmbeddingGemma 2をダウンロードしていない | `ollama pull embeddinggemma-2:740m`(または `embeddinggemma-2:440m`)を実行する |
| インデックス作成が「connection was forcibly closed」などでときどき失敗する | セキュリティソフト(AdGuardなど)がOllamaの通信に割り込んでいる | Ollamaをフィルタの対象から外す。失敗した画像は、次回の「新規・変更された画像のみ」で作り直される |
| Geminiで「GEMINI_API_KEYが未設定」と出る・キーが拒否される | `.env` にキーが無い、または行頭に `#` が付いている | プラグインの `.env`(`.env.example` をコピー)に `GEMINI_API_KEY=キー` と書き、ComfyUIを再起動する。`.env` は起動時にしか読み込まれない |
| 検索やSimilarの結果が出ない | 選んだフォルダにインデックス済みの画像が無い | 歯車ボタンでインデックスを作る。緑の点があるフォルダを選ぶ。モデルや精度を変えたときは「全件再作成」 |
| 検索やSimilarの結果が出ない | 選んだフォルダにインデックス済みの画像が無い | 歯車ボタンでインデックスを作る。緑の点があるフォルダを選ぶ。モデルやベクトル次元を変えたときは「全件再作成」 |
### TagSpaceの空間が作れない
| 症状 | 原因 | 対処 |
| --- | --- | --- |
| 「OllamaのEmbeddingGemma 2が必要です」と出る | Ollamaが起動していない、またはモデルが無い | セマンティック検索と同じ準備をする(上の表) |
| 「Galleryのセマンティック索引は … で作られています」と出る | ギャラリーの索引をGeminiで作っている | ギャラリーのセマンティック設定でEmbeddingGemma 2を選び、「全件再作成」する |
| 作成にとても時間がかかる | 1回目は、画像のプロンプトの読み取りと、新しいタグの準備に時間がかかる | 2回目からは速くなる。Tagger補完を使うときは、TaggerがGPUで動いているか確認する(上の「Taggerがとても遅い」) |
### パートナーAPI(Nano Banana)が「認証に失敗しました」と出る
`.env` にComfy APIキーが無いのが原因です。プラグインの `.env` に `COMFY_API_KEY=キー`(platform.comfy.orgで発行)を書き、ComfyUIを再起動してください(第5章 5-8)。
+1
View File
@@ -52,6 +52,7 @@
| LoRA | 絵柄やキャラクターなどを追加で覚えさせる小さなモデル | 第6章 |
| Ollama | ローカルAIを手軽に動かせるソフト | 第10章 |
| T2I(Text to Image) | 文章(プロンプト)から画像を作ること | 第5章 |
| TagSpace | タグ・プロンプト・生成画像を意味の近さで3Dの空間に並べて表示するタブ | 第11章 |
| VAE | 画像の色合いや細部を仕上げるモデル | 第6章 |
| VLM | 画像を読み取れるAIモデル | 第10章 |
| VRAM | GPU(グラフィックボード)のメモリ | 第10章 |
+3 -3
View File
@@ -2,12 +2,12 @@
Don't Be Afraid of Nodes - Generate Images More Easily and Keep Them Organized
- Covers: Workflow Studio v0.8.9
- Covers: Workflow Studio v0.9.1
- Author: ketle-man
- (c) 2026 ketle-man
This is the **text-only edition** (without screenshots) of the Kindle book.
Chapter files are in the `chapters/` folder; the whole book in one file is `Workflow_Studio_Manual_v0.8.9_en.md`.
Chapter files are in the `chapters/` folder; the whole book in one file is `Workflow_Studio_Manual_v0.9.1_en.md`.
Screen examples are omitted, so please use the book together with Workflow Studio's Help tab.
## Contents
@@ -29,4 +29,4 @@ Screen examples are omitted, so please use the book together with Workflow Studi
- [13_Appendix](chapters/13_Appendix.md)
- [14_Afterword](chapters/14_Afterword.md)
Whole book: [Workflow_Studio_Manual_v0.8.9_en.md](Workflow_Studio_Manual_v0.8.9_en.md)
Whole book: [Workflow_Studio_Manual_v0.9.1_en.md](Workflow_Studio_Manual_v0.9.1_en.md)
Binary file not shown.
@@ -2,12 +2,12 @@
Don't Be Afraid of Nodes - Generate Images More Easily and Keep Them Organized
- Covers: Workflow Studio v0.8.9
- Covers: Workflow Studio v0.9.1
- Author: ketle-man
- (c) 2026 ketle-man
This is the **text-only edition** (without screenshots) of the Kindle book.
Chapter files are in the `chapters/` folder; the whole book in one file is `Workflow_Studio_Manual_v0.8.9_en.md`.
Chapter files are in the `chapters/` folder; the whole book in one file is `Workflow_Studio_Manual_v0.9.1_en.md`.
Screen examples are omitted, so please use the book together with Workflow Studio's Help tab.
---
@@ -97,6 +97,7 @@ Together with the supporting features, it makes moving between the two screens s
- **Image Edit** - simple layer-based editing, and redrawing parts with a mask (inpainting)
- **Local AI integration** - translating prompts from Japanese, creating prompts and tags from images
- **Tagger and Video** - automatic tag generation from images, and video generation with simple editing
- **TagSpace** - lays out your own prompts, tags and generated images in a 3D space by closeness of meaning, so you can browse it and pick tags
---
@@ -142,7 +143,7 @@ It is written so that you can follow it if you know basic computer operations (c
## Version and environment covered
- **Workflow Studio**: v0.8.9
- **Workflow Studio**: v0.9.1
- **ComfyUI**: the latest version at the time of writing
- **OS**: Windows (screen examples are from Windows)
@@ -355,7 +356,8 @@ The basic features of Workflow Studio work with no extra preparation as long as
### Later, as needed
The following are needed only when you use particular features. You can ignore them at first.
- **Ollama, LM Studio and similar** - AI support features such as prompt translation and AI chat (Chapter 10)
- **Ollama, LM Studio and similar** - AI support features such as prompt translation and AI chat (Chapter 10).
**Ollama** is also needed for local semantic search in the Gallery (Chapter 8) and for the TagSpace tab (Chapter 11)
- **Eagle** - a feature that automatically saves generated images to the image-management software Eagle (Chapter 8)
- **Extra Python packages** - Tagger (tag generation from images), PSD export and the like (Chapter 11)
@@ -616,6 +618,7 @@ It is enough to learn the tabs marked with a star under "Often used" first.
| Image Edit | Simple image editing, making masks | | Chapter 11 |
| Video | Video generation and video editing | | Chapter 11 |
| Tagger | Automatically generating tags (prompts) from images | | Chapter 11 |
| TagSpace | Showing tags, prompts and generated images in 3D by closeness of meaning, and picking tags | | Chapter 11 |
| Settings | Language, theme, folders and other settings | | This chapter, Chapter 11 |
| Help | Feature list, shortcuts, troubleshooting | | This chapter |
| AI TOOL | Translation, chat and image analysis with local AI | | Chapter 10 |
@@ -627,7 +630,7 @@ If the number of tabs makes you lose your way, it helps to think of them in thes
Tabs that list your materials so they are easy to find.
- **Create** - GenerateUI / Image Edit / Video
Tabs for actually making images and videos, or touching them up.
- **Support** - AI TOOL / Tagger / Settings / Help
- **Support** - AI TOOL / Tagger / TagSpace / Settings / Help
Tabs that help with work in other tabs, or hold overall settings.
> **Tip**
@@ -1121,6 +1124,9 @@ To the right of Input, Model and Settings, the contents of the workflow are show
When you change values in the form, they are reflected here too.
Until you are used to it, treat this as "view only".
On the Input subtab, the **>>** button at the top of the Raw JSON folds it into a thin strip at the right edge (v0.8.12 and later),
which gives the prompt and image areas more room. Press it again to unfold it; the folded state is remembered.
---
## 5-3 Generating your first image
@@ -1128,7 +1134,7 @@ Until you are used to it, treat this as "view only".
Now, to generate. At minimum, you check and set these three things.
1. Which model to draw with (Model)
2. What to draw (Input -> Prompt)
2. What to draw (Input)
3. Generate (Generate)
### Step 1: Choose a model (Model)
@@ -1161,7 +1167,9 @@ Now, to generate. At minimum, you check and set these three things.
> Items that are not green have no effect on this workflow even if you change them.
### Step 2: Write a prompt (Input)
1. Open the **Input** subtab and choose **Prompt** inside it.
1. Open the **Input** subtab.
The prompt area (Prompt) is on the left and the input image area (Image) is on the right (v0.8.12 and later; before that you switched between Prompt and Image).
When the screen is narrow, the Image area moves below the prompts.
2. In the **Positive Prompt** field, enter in English what you want drawn.
```
@@ -1479,8 +1487,8 @@ If you run without a key, a message says that partner API authentication failed
### How to use
1. In the Workflow tab, load the Nano Banana sample (`ws_nano_banana_2_1_t2i`) into GenerateUI.
2. Edit the prompt in the **Prompt** subtab and press **Apply**.
3. To use reference images, specify them on the image cards in the **Image** subtab.
2. Edit the prompt on the left side (Prompt) of the **Input** subtab and press **Apply**.
3. To use reference images, specify them on the image cards on the right side (Image) of the **Input** subtab.
4. Press **Generate**.
> **Tip**
@@ -1495,6 +1503,8 @@ The workflows you can use in GenerateUI have increased as follows. They are used
- **Qwen Image 2.1 Turbo** - ComfyUI's official templates for text to image (T2I) and image to image (I2I). Edits also carry over to the prompt enhancer's input (the feature that expands your prompt automatically).
- **Flux.3 Klein** - the four official templates (T2I and Image Edit, for Klein and Klein SD).
- **MOSS-Image** - Base/SFT T2I, and the bounding-box versions that specify positions with frames.
- **Fibo 2.0 Edit** (v0.8.14 and later) - an image-editing workflow. With the prompt enhancer (PE) setup, edits in the prompt area apply whether PE is on or off. The negative area holds a VGL-format (JSON) description as is. Width and height (Settings) of 0 mean automatic.
- **FastH3 OmniRef / Pika-H3-Flex** (v0.8.14 and later) - MiniMax H3 reference to video. Treated as video workflows, and also usable in the Video tab (Chapter 11).
- **Native LoRA stack** - ComfyUI v0.40's nodes that load several LoRAs at once (LoadLoraModel / LoadLoraTextEncoder). Apply, bypass and the Metadata display are supported.
> **Caution**
@@ -2109,7 +2119,8 @@ You can also use a Gallery image as an "input image" for generation.
| Send GenUI Image | Sets the chosen image as the input image (LoadImage node) of the GenerateUI workflow |
| Send to LI node | Sets the chosen image on the image-loading node currently selected on ComfyUI's node screen |
| Image Edit | Opens the chosen image in the Image Edit tab (Chapter 11) |
| Send CC | Sends the chosen image to a panel in Comic Creator (shown only when the Gallery is opened inside Comic Creator; Chapter 11, section 11-6) |
| Send CC Layout | Sends the chosen image to Comic Creator's Layout tab (the selected panel / overlay) (shown only when the Gallery is opened inside Comic Creator; Chapter 11, section 11-6) |
| Send CC Image | Sends the chosen image to Comic Creator's Image tab (as a new layer if a document is open, otherwise as a new canvas; videos are not supported; shown under the same condition as Send CC Layout) |
Handy when redrawing a generated image further with an I2I (image to image) workflow.
@@ -2194,7 +2205,7 @@ You can also bring up a list of **similar images** to the one you choose.
| Model | Characteristics | Preparation |
| --- | --- | --- |
| Gemini Embedding 2 | Computed on Google's service. Fast. Images are sent to Google | Get an API key, write `GEMINI_API_KEY=key` in the plugin's `.env`, and restart ComfyUI |
| EmbeddingGemma 2 | Computed inside your computer (local). Nothing is sent outside | No extra preparation. The model is downloaded automatically only the first time |
| EmbeddingGemma 2 | Computed inside your computer with **Ollama** (local, free). Nothing is sent outside | Install and start Ollama, then run `ollama pull embeddinggemma-2:740m` (or the lighter `embeddinggemma-2:440m`). On the Model tab, choose the **Ollama URL** (usually unchanged) and the **Model size** |
> **Caution: when using Gemini**
> Images are sent to Google's service. Content sent under the free tier may be used by Google to improve its products.
@@ -2206,13 +2217,14 @@ You can also bring up a list of **similar images** to the one you choose.
2. Choose "new only" or "rebuild all" and start. Progress is shown, and you can stop partway.
3. The index is one shared across all folders. You may build it a little at a time, folder by folder.
When you change the model, the vector dimension or the image precision, a **rebuild of everything** is needed.
When you change the model or the vector dimension, a **rebuild of everything** is needed.
### Speed guidelines and settings
- The local EmbeddingGemma 2 runs on the CPU by default and takes a few seconds per image.
Setting the **image precision** to "standard" or "light" makes it faster (rebuild everything after changing it).
Reducing the **number of CPU threads** lightens the computer's load while generating images.
- If you have an NVIDIA GPU, installing `onnxruntime-gpu` into ComfyUI's Python brings it to about 0.1 second per image (the fix is in Chapter 12, section 12-5).
- Since v0.8.14 the local EmbeddingGemma 2 runs in Ollama (the earlier way of running it in ComfyUI's Python was removed).
On an NVIDIA GPU it takes about 0.1 to 0.2 second per image. When indexing finishes, the model is unloaded from GPU memory automatically.
- Ollama must be running while you build the index and while you search.
- The 740m (text + image + audio) and 440m (text + image, lighter) model sizes return the same results, so switching does not need a rebuild.
Indexes made with v0.8.13 or earlier keep working as they are.
- In the **Search** tab, you can decide the "minimum score" for similar-image and text search, and the maximum number of results.
Because the score level differs by model, it is saved per model.
@@ -2692,6 +2704,9 @@ To use Tagger, you need the following preparation.
1. Put a **model for tagging** (such as WD Tagger) in ComfyUI's `models/tagger/(model name)/` folder.
Put a `.onnx` file and `selected_tags.csv` in the folder.
**PixAI Tagger v1.0** (v0.8.10 and later) also works. From the community conversion on Hugging Face (`Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8`),
put one `.onnx` file (`model_fp16.onnx` is recommended for a GPU) together with `selected_tags.csv` and `preprocess.json` in one folder, and it is detected automatically.
When you choose a PixAI model, the threshold sliders switch to PixAI's recommended values (0.17 / 0.27).
2. Install the **extra Python packages**.
Use the `requirements.txt` in the Workflow Studio folder.
@@ -2707,6 +2722,10 @@ To use Tagger, you need the following preparation.
> Always install into **the Python that ComfyUI uses**.
> If you are not sure, there is also a method of installing packages with a ComfyUI Manager feature.
> **Caution: check that it runs on the GPU**
> On an NVIDIA GPU, Tagger takes less than a second per image, but on the CPU, PixAI takes about 20 seconds per image.
> If it is very slow, check that the GPU package is installed correctly (Chapter 12, section 12-5).
> **Tip**
> You can also combine it with the local AI image reading (VLM) from Chapter 10 to make tags that combine both results.
@@ -2757,6 +2776,7 @@ The **Video** tab is a dedicated screen for making short videos from images or t
- **MiniMax H3** (image to video)
- **LTX-2.5** (text to video, image to video, and video from specified first and last images)
- **Wan2.2** (text to video)
- **FastH3 OmniRef / Pika-H3-Flex** (MiniMax H3 reference to video, v0.8.14 and later)
You load a matching workflow with **Load in Video** in the Workflow tab and use it (Chapter 4, section 4-6).
@@ -2780,6 +2800,19 @@ There are also the **Frame** feature, which saves a favorite scene of a video as
- The Video Source panel is a little wider, the file name shows on one line, and the buttons sit in a single row.
### Reference to video (FastH3 OmniRef / Pika-H3-Flex) (v0.8.14 and later)
These workflows make a video from **reference images** instead of a first and last frame,
so the image fields in the Plan subtab are renamed:
- **Reference Image** - the first reference image (the usual First Image field)
- **Reference Image 2 (optional)** - the second reference image (the usual Last Image field)
- Prompt, duration (seconds), aspect ratio and so on work the same as for other video workflows.
- A block whose image field is left empty with **None** or **Clear** is generated without that image, even if the workflow has a reference image wired in.
Blocks added with "+ Block" start with empty images, so set an image on each block that needs a reference.
- Choosing **Use previous block's last frame** makes the last frame of the video actually generated by the previous block the first reference image of that block.
- The Asset subtab buttons also change to "Set as Reference Image" and "Set as Reference Image 2".
> **Caution**
> Video generation uses far more GPU memory and time than image generation.
> Check the required specs of the model before trying it.
@@ -2847,11 +2880,12 @@ It is software you install separately from Workflow Studio, but if you install b
If you install both, the following integrations are possible.
- **Use Workflow Studio's Gallery inside Comic Creator**
Workflow Studio's Gallery appears inside Comic Creator, and you can choose generated images and send them to panels with the **Send CC** button.
(The Send CC button is shown only in a Gallery opened inside Comic Creator)
Workflow Studio's Gallery appears inside Comic Creator, and you can choose generated images and send them to panels with **Send CC Layout** (Layout tab panel / overlay) or to the Image tab with **Send CC Image**.
(The Send CC buttons are shown only in a Gallery opened inside Comic Creator)
- **Generate images from Comic Creator**
From the Comic Creator screen, through Workflow Studio (GenerateUI), you can generate images to put in panels (T2I),
or redraw based on a rough you drew or an image you placed (I2I and inpainting).
From Comic Creator's Nanobanana+ tab (local mode), you can also run image-editing workflows that use several reference images (Flux.3 Klein, Qwen Image 2.1 and so on) (v0.8.12 and later).
With the flow "make images in Workflow Studio -> put them together as manga in Comic Creator",
you can go from image generation to finished manga entirely inside ComfyUI.
@@ -2873,6 +2907,70 @@ you can go from image generation to finished manga entirely inside ComfyUI.
---
## 11-7 TagSpace - picking tags and prompts from a "map of meaning" (v0.9.0 and later)
The **TagSpace** tab lays out the prompts, tags and generated images inside Workflow Studio in a 3D space
according to **closeness of meaning**. Things close together mean similar things, so you can browse the space
("which tags are close to this mood?") and pick tags to build a prompt.
### What is in the space
- **Cards** - the sample images of the Gallery's **ImagePrompt** (Chapter 8, section 8-4) with their prompts, shown as thumbnails
- **Tags** - words taken (split at commas) from ImagePrompt prompts, prompts embedded in generated images, wildcards, the Tagger DB and the Prompt library, shown as dots colored by source
- **Gallery points** - some of your generated images, shown as faint dots (each carries the tags of its own prompt)
### Preparation
As with the Gallery's semantic search (Chapter 8, section 8-6), **Ollama** and **EmbeddingGemma 2** are needed.
If the Gallery's semantic index was made with Gemini Embedding 2, rebuild it with EmbeddingGemma 2 first.
### Building the space
Choose the settings in the toolbar and press **Build / Update**.
- **Tags** - how many tags to include. The sources take turns, each in order of how often a tag is used
- **All tags** - when on, every candidate tag is used instead of the Tags number (up to 20,000)
- **Min uses** - leaves out tags used fewer times than this. 2 removes one-off spelling variants and the like
- **Wildcards** - whether wildcards are used as a tag source
- **Gallery points** - how many generated images to show (0 = none)
- **Tagger fill** - tags generated images whose prompt cannot be read, using a Tagger model (OFF / a model name; choose "Gallery points only" or "All images without a prompt")
- The first build takes a few minutes to read image prompts and prepare tags. Later builds reuse the previous results and finish in seconds to tens of seconds.
- The status line shows the numbers of cards, tags and Gallery points. When only part of the candidates is used, "(of N candidates)" is shown.
> **Tip**
> Most distinct tags are words that only appear in wildcards.
> Turning "Wildcards" off and "All tags" on lays out every tag you have actually used (about 10,000 in testing).
> **Caution**
> Tagger fill takes about 0.5 second per image on the CPU. Before choosing "All images without a prompt", check that Tagger runs on the GPU (Chapter 12, section 12-5).
### Looking and searching
- **Drag** to rotate, **right-drag** to pan, and use the **wheel** to zoom.
- Hovering over a point shows its name, thumbnail and prompt or sources.
- The toolbar checkboxes switch Cards, Thumbnails, Tags and Gallery on or off, as well as **Glow** (stars shining in a night sky) and **Twinkle**.
The checkboxes for each source show or hide tags by source.
- Type words or a sentence in the search box at the top right and press **Enter** (any language). A white mark is placed at that meaning, and nearby cards and tags are listed.
### Picking tags to build a prompt
1. Click a card or tag to select it. Cards and tags close in meaning are listed under **Nearby** on the right.
(Clicking a Gallery point also lists similar generated images)
2. **Double-click** what you want in the prompt, or press **Add** in **Selection**, or the **+** in the list.
A card adds its whole prompt, a tag adds the tag itself, and a Gallery point adds that image's tags to the **Prompt** area at the far right.
3. **Add to GenerateUI (Positive)** appends it to the positive prompt of the workflow loaded in GenerateUI (load a workflow in GenerateUI first).
You can also **Copy** it to the clipboard.
### Searching with the tags of a card or generated image
When you select a card or Gallery point, its prompt tags are shown as buttons under **Selection**.
Click tags to choose them (click again to deselect) and press **Search with selected** to search the space with them.
This helps when you want to find things close to, say, only the hairstyle and clothing of an image.
While tags are selected, the **Add** button in **Selection** becomes **Add selected (N)** and adds only those tags to the prompt area.
With no tags selected it adds the whole item as before (a card's whole prompt, or all tags of a Gallery point).
When a Gallery point is selected, **Selection** also shows an **Open in Gallery** button.
It switches to the Gallery tab, selects the image's folder, and selects the image in the list (its details open on the right).
So that the image is sure to appear, the Gallery's search, favorite, tag and group filters are cleared.
A card's whole prompt can be read under **Full prompt**.
---
> **Summary of this chapter**
> - In the Nodes tab you can list and organize installed nodes, and use them in the WS Library
> - Tagger automatically generates tags from images. A model and extra packages must be prepared
@@ -2880,6 +2978,7 @@ you can go from image generation to finished manga entirely inside ComfyUI.
> - In the Video tab, you can make videos with supported video-generation models and do simple editing
> - "Default Checkpoint" and "Data Management (backup)" in the Settings tab are especially handy
> - Combined with Comic Creator by the same author, you can make manga from generated images
> - TagSpace lays out your tags, prompts and generated images in 3D by closeness of meaning, so you can browse it and pick tags for a prompt
---
@@ -3028,6 +3127,11 @@ You need to set the environment variable `WFS_ALLOWED_BACKEND_HOSTS` (Chapter 10
- Check that a `.onnx` file (and `selected_tags.csv`) is in the `ComfyUI/models/tagger/(model name)/` folder.
- Check that the extra Python package (onnxruntime) is installed in **the Python that ComfyUI uses** (Chapter 11, section 11-2).
### Tagger is very slow (the GPU is not used)
If ComfyUI's Python has both the CPU package `onnxruntime` and the GPU package `onnxruntime-gpu`, the GPU stops being used.
(Installing other custom nodes can bring in the CPU package.)
Stop ComfyUI, then in ComfyUI's Python run `pip uninstall -y onnxruntime onnxruntime-gpu` followed by `pip install onnxruntime-gpu`, and restart ComfyUI (DirectML is not supported).
### PSD-related features give an error
An extra Python package (psd-tools) is needed.
Run the installation command shown in the error message in the Python that ComfyUI uses, then restart ComfyUI.
@@ -3035,9 +3139,18 @@ Run the installation command shown in the error message in the Python that Comfy
### Semantic search (Gallery) does not work well
| Symptom | Cause | What to do |
| --- | --- | --- |
| The GPU is not detected (settings say no GPU detected, or runs on the CPU) | The onnxruntime in ComfyUI's Python is the CPU version | Stop ComfyUI, then in ComfyUI's Python run `pip uninstall -y onnxruntime onnxruntime-gpu` followed by `pip install onnxruntime-gpu`, and restart ComfyUI (DirectML is not supported) |
| "Cannot reach Ollama" is shown | Ollama is not running, or the Ollama URL is wrong | Start Ollama (it is needed while indexing and searching). Check the Ollama URL on the gear button's Model tab |
| "The Ollama model is not downloaded" is shown | EmbeddingGemma 2 has not been downloaded | Run `ollama pull embeddinggemma-2:740m` (or `embeddinggemma-2:440m`) |
| Indexing sometimes fails with "connection was forcibly closed" or similar | Security software (such as AdGuard) is intercepting Ollama's traffic | Exclude Ollama from filtering. Failed images are processed again by the next "New / changed images only" run |
| Gemini says "GEMINI_API_KEY is not set", or the key is rejected | There is no key in `.env`, or the line starts with `#` | Write `GEMINI_API_KEY=key` in the plugin's `.env` (copy `.env.example`) and restart ComfyUI. `.env` is only read at startup |
| Search or Similar gives no results | The selected folder has no indexed images | Build the index with the gear button. Choose a folder with a green dot. When you change the model or precision, "rebuild all" |
| Search or Similar gives no results | The selected folder has no indexed images | Build the index with the gear button. Choose a folder with a green dot. When you change the model or vector dimension, "rebuild all" |
### The TagSpace space cannot be built
| Symptom | Cause | What to do |
| --- | --- | --- |
| "EmbeddingGemma 2 in Ollama is required" is shown | Ollama is not running, or the model is missing | Prepare the same way as for semantic search (table above) |
| "The Gallery semantic index was made with ..." is shown | The Gallery index was made with Gemini | Choose EmbeddingGemma 2 in the Gallery's semantic settings and rebuild all |
| Building takes a very long time | The first build reads image prompts and prepares new tags | Later builds are faster. When using Tagger fill, check that Tagger runs on the GPU ("Tagger is very slow" above) |
### A partner API (Nano Banana) says authentication failed
The cause is a missing Comfy API key in `.env`. Write `COMFY_API_KEY=your key` (issued at platform.comfy.org) in the plugin's `.env` and restart ComfyUI (Chapter 5, section 5-8).
@@ -3123,6 +3236,7 @@ The main terms that appear in this book, in alphabetical order.
| Steps | The number of times drawing is repeated | Chapter 5 |
| Style | A mood template added to a prompt | Chapter 7 |
| T2I (Text to Image) | Making an image from text (a prompt) | Chapter 5 |
| TagSpace | A tab that lays out tags, prompts and generated images in 3D by closeness of meaning | Chapter 11 |
| Trigger word | A word to put in the prompt to bring out a LoRA's effect | Chapter 6 |
| VAE | The model that finishes an image's colors and fine details | Chapter 6 |
| VLM | An AI model that can read images | Chapter 10 |
Binary file not shown.
+2 -1
View File
@@ -83,6 +83,7 @@ Together with the supporting features, it makes moving between the two screens s
- **Image Edit** - simple layer-based editing, and redrawing parts with a mask (inpainting)
- **Local AI integration** - translating prompts from Japanese, creating prompts and tags from images
- **Tagger and Video** - automatic tag generation from images, and video generation with simple editing
- **TagSpace** - lays out your own prompts, tags and generated images in a 3D space by closeness of meaning, so you can browse it and pick tags
---
@@ -128,7 +129,7 @@ It is written so that you can follow it if you know basic computer operations (c
## Version and environment covered
- **Workflow Studio**: v0.8.9
- **Workflow Studio**: v0.9.1
- **ComfyUI**: the latest version at the time of writing
- **OS**: Windows (screen examples are from Windows)
@@ -19,7 +19,8 @@ The basic features of Workflow Studio work with no extra preparation as long as
### Later, as needed
The following are needed only when you use particular features. You can ignore them at first.
- **Ollama, LM Studio and similar** - AI support features such as prompt translation and AI chat (Chapter 10)
- **Ollama, LM Studio and similar** - AI support features such as prompt translation and AI chat (Chapter 10).
**Ollama** is also needed for local semantic search in the Gallery (Chapter 8) and for the TagSpace tab (Chapter 11)
- **Eagle** - a feature that automatically saves generated images to the image-management software Eagle (Chapter 8)
- **Extra Python packages** - Tagger (tag generation from images), PSD export and the like (Chapter 11)
@@ -24,6 +24,7 @@ It is enough to learn the tabs marked with a star under "Often used" first.
| Image Edit | Simple image editing, making masks | | Chapter 11 |
| Video | Video generation and video editing | | Chapter 11 |
| Tagger | Automatically generating tags (prompts) from images | | Chapter 11 |
| TagSpace | Showing tags, prompts and generated images in 3D by closeness of meaning, and picking tags | | Chapter 11 |
| Settings | Language, theme, folders and other settings | | This chapter, Chapter 11 |
| Help | Feature list, shortcuts, troubleshooting | | This chapter |
| AI TOOL | Translation, chat and image analysis with local AI | | Chapter 10 |
@@ -35,7 +36,7 @@ If the number of tabs makes you lose your way, it helps to think of them in thes
Tabs that list your materials so they are easy to find.
- **Create** - GenerateUI / Image Edit / Video
Tabs for actually making images and videos, or touching them up.
- **Support** - AI TOOL / Tagger / Settings / Help
- **Support** - AI TOOL / Tagger / TagSpace / Settings / Help
Tabs that help with work in other tabs, or hold overall settings.
> **Tip**
@@ -72,6 +72,9 @@ To the right of Input, Model and Settings, the contents of the workflow are show
When you change values in the form, they are reflected here too.
Until you are used to it, treat this as "view only".
On the Input subtab, the **>>** button at the top of the Raw JSON folds it into a thin strip at the right edge (v0.8.12 and later),
which gives the prompt and image areas more room. Press it again to unfold it; the folded state is remembered.
---
## 5-3 Generating your first image
@@ -79,7 +82,7 @@ Until you are used to it, treat this as "view only".
Now, to generate. At minimum, you check and set these three things.
1. Which model to draw with (Model)
2. What to draw (Input -> Prompt)
2. What to draw (Input)
3. Generate (Generate)
### Step 1: Choose a model (Model)
@@ -112,7 +115,9 @@ Now, to generate. At minimum, you check and set these three things.
> Items that are not green have no effect on this workflow even if you change them.
### Step 2: Write a prompt (Input)
1. Open the **Input** subtab and choose **Prompt** inside it.
1. Open the **Input** subtab.
The prompt area (Prompt) is on the left and the input image area (Image) is on the right (v0.8.12 and later; before that you switched between Prompt and Image).
When the screen is narrow, the Image area moves below the prompts.
2. In the **Positive Prompt** field, enter in English what you want drawn.
```
@@ -195,8 +195,8 @@ If you run without a key, a message says that partner API authentication failed
### How to use
1. In the Workflow tab, load the Nano Banana sample (`ws_nano_banana_2_1_t2i`) into GenerateUI.
2. Edit the prompt in the **Prompt** subtab and press **Apply**.
3. To use reference images, specify them on the image cards in the **Image** subtab.
2. Edit the prompt on the left side (Prompt) of the **Input** subtab and press **Apply**.
3. To use reference images, specify them on the image cards on the right side (Image) of the **Input** subtab.
4. Press **Generate**.
> **Tip**
@@ -211,6 +211,8 @@ The workflows you can use in GenerateUI have increased as follows. They are used
- **Qwen Image 2.1 Turbo** - ComfyUI's official templates for text to image (T2I) and image to image (I2I). Edits also carry over to the prompt enhancer's input (the feature that expands your prompt automatically).
- **Flux.3 Klein** - the four official templates (T2I and Image Edit, for Klein and Klein SD).
- **MOSS-Image** - Base/SFT T2I, and the bounding-box versions that specify positions with frames.
- **Fibo 2.0 Edit** (v0.8.14 and later) - an image-editing workflow. With the prompt enhancer (PE) setup, edits in the prompt area apply whether PE is on or off. The negative area holds a VGL-format (JSON) description as is. Width and height (Settings) of 0 mean automatic.
- **FastH3 OmniRef / Pika-H3-Flex** (v0.8.14 and later) - MiniMax H3 reference to video. Treated as video workflows, and also usable in the Video tab (Chapter 11).
- **Native LoRA stack** - ComfyUI v0.40's nodes that load several LoRAs at once (LoadLoraModel / LoadLoraTextEncoder). Apply, bypass and the Metadata display are supported.
> **Caution**
@@ -153,7 +153,8 @@ You can also use a Gallery image as an "input image" for generation.
| Send GenUI Image | Sets the chosen image as the input image (LoadImage node) of the GenerateUI workflow |
| Send to LI node | Sets the chosen image on the image-loading node currently selected on ComfyUI's node screen |
| Image Edit | Opens the chosen image in the Image Edit tab (Chapter 11) |
| Send CC | Sends the chosen image to a panel in Comic Creator (shown only when the Gallery is opened inside Comic Creator; Chapter 11, section 11-6) |
| Send CC Layout | Sends the chosen image to Comic Creator's Layout tab (the selected panel / overlay) (shown only when the Gallery is opened inside Comic Creator; Chapter 11, section 11-6) |
| Send CC Image | Sends the chosen image to Comic Creator's Image tab (as a new layer if a document is open, otherwise as a new canvas; videos are not supported; shown under the same condition as Send CC Layout) |
Handy when redrawing a generated image further with an I2I (image to image) workflow.
@@ -238,7 +239,7 @@ You can also bring up a list of **similar images** to the one you choose.
| Model | Characteristics | Preparation |
| --- | --- | --- |
| Gemini Embedding 2 | Computed on Google's service. Fast. Images are sent to Google | Get an API key, write `GEMINI_API_KEY=key` in the plugin's `.env`, and restart ComfyUI |
| EmbeddingGemma 2 | Computed inside your computer (local). Nothing is sent outside | No extra preparation. The model is downloaded automatically only the first time |
| EmbeddingGemma 2 | Computed inside your computer with **Ollama** (local, free). Nothing is sent outside | Install and start Ollama, then run `ollama pull embeddinggemma-2:740m` (or the lighter `embeddinggemma-2:440m`). On the Model tab, choose the **Ollama URL** (usually unchanged) and the **Model size** |
> **Caution: when using Gemini**
> Images are sent to Google's service. Content sent under the free tier may be used by Google to improve its products.
@@ -250,13 +251,14 @@ You can also bring up a list of **similar images** to the one you choose.
2. Choose "new only" or "rebuild all" and start. Progress is shown, and you can stop partway.
3. The index is one shared across all folders. You may build it a little at a time, folder by folder.
When you change the model, the vector dimension or the image precision, a **rebuild of everything** is needed.
When you change the model or the vector dimension, a **rebuild of everything** is needed.
### Speed guidelines and settings
- The local EmbeddingGemma 2 runs on the CPU by default and takes a few seconds per image.
Setting the **image precision** to "standard" or "light" makes it faster (rebuild everything after changing it).
Reducing the **number of CPU threads** lightens the computer's load while generating images.
- If you have an NVIDIA GPU, installing `onnxruntime-gpu` into ComfyUI's Python brings it to about 0.1 second per image (the fix is in Chapter 12, section 12-5).
- Since v0.8.14 the local EmbeddingGemma 2 runs in Ollama (the earlier way of running it in ComfyUI's Python was removed).
On an NVIDIA GPU it takes about 0.1 to 0.2 second per image. When indexing finishes, the model is unloaded from GPU memory automatically.
- Ollama must be running while you build the index and while you search.
- The 740m (text + image + audio) and 440m (text + image, lighter) model sizes return the same results, so switching does not need a rebuild.
Indexes made with v0.8.13 or earlier keep working as they are.
- In the **Search** tab, you can decide the "minimum score" for similar-image and text search, and the maximum number of results.
Because the score level differs by model, it is saved per model.
@@ -54,6 +54,9 @@ To use Tagger, you need the following preparation.
1. Put a **model for tagging** (such as WD Tagger) in ComfyUI's `models/tagger/(model name)/` folder.
Put a `.onnx` file and `selected_tags.csv` in the folder.
**PixAI Tagger v1.0** (v0.8.10 and later) also works. From the community conversion on Hugging Face (`Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8`),
put one `.onnx` file (`model_fp16.onnx` is recommended for a GPU) together with `selected_tags.csv` and `preprocess.json` in one folder, and it is detected automatically.
When you choose a PixAI model, the threshold sliders switch to PixAI's recommended values (0.17 / 0.27).
2. Install the **extra Python packages**.
Use the `requirements.txt` in the Workflow Studio folder.
@@ -69,6 +72,10 @@ To use Tagger, you need the following preparation.
> Always install into **the Python that ComfyUI uses**.
> If you are not sure, there is also a method of installing packages with a ComfyUI Manager feature.
> **Caution: check that it runs on the GPU**
> On an NVIDIA GPU, Tagger takes less than a second per image, but on the CPU, PixAI takes about 20 seconds per image.
> If it is very slow, check that the GPU package is installed correctly (Chapter 12, section 12-5).
> **Tip**
> You can also combine it with the local AI image reading (VLM) from Chapter 10 to make tags that combine both results.
@@ -119,6 +126,7 @@ The **Video** tab is a dedicated screen for making short videos from images or t
- **MiniMax H3** (image to video)
- **LTX-2.5** (text to video, image to video, and video from specified first and last images)
- **Wan2.2** (text to video)
- **FastH3 OmniRef / Pika-H3-Flex** (MiniMax H3 reference to video, v0.8.14 and later)
You load a matching workflow with **Load in Video** in the Workflow tab and use it (Chapter 4, section 4-6).
@@ -142,6 +150,19 @@ There are also the **Frame** feature, which saves a favorite scene of a video as
- The Video Source panel is a little wider, the file name shows on one line, and the buttons sit in a single row.
### Reference to video (FastH3 OmniRef / Pika-H3-Flex) (v0.8.14 and later)
These workflows make a video from **reference images** instead of a first and last frame,
so the image fields in the Plan subtab are renamed:
- **Reference Image** - the first reference image (the usual First Image field)
- **Reference Image 2 (optional)** - the second reference image (the usual Last Image field)
- Prompt, duration (seconds), aspect ratio and so on work the same as for other video workflows.
- A block whose image field is left empty with **None** or **Clear** is generated without that image, even if the workflow has a reference image wired in.
Blocks added with "+ Block" start with empty images, so set an image on each block that needs a reference.
- Choosing **Use previous block's last frame** makes the last frame of the video actually generated by the previous block the first reference image of that block.
- The Asset subtab buttons also change to "Set as Reference Image" and "Set as Reference Image 2".
> **Caution**
> Video generation uses far more GPU memory and time than image generation.
> Check the required specs of the model before trying it.
@@ -209,11 +230,12 @@ It is software you install separately from Workflow Studio, but if you install b
If you install both, the following integrations are possible.
- **Use Workflow Studio's Gallery inside Comic Creator**
Workflow Studio's Gallery appears inside Comic Creator, and you can choose generated images and send them to panels with the **Send CC** button.
(The Send CC button is shown only in a Gallery opened inside Comic Creator)
Workflow Studio's Gallery appears inside Comic Creator, and you can choose generated images and send them to panels with **Send CC Layout** (Layout tab panel / overlay) or to the Image tab with **Send CC Image**.
(The Send CC buttons are shown only in a Gallery opened inside Comic Creator)
- **Generate images from Comic Creator**
From the Comic Creator screen, through Workflow Studio (GenerateUI), you can generate images to put in panels (T2I),
or redraw based on a rough you drew or an image you placed (I2I and inpainting).
From Comic Creator's Nanobanana+ tab (local mode), you can also run image-editing workflows that use several reference images (Flux.3 Klein, Qwen Image 2.1 and so on) (v0.8.12 and later).
With the flow "make images in Workflow Studio -> put them together as manga in Comic Creator",
you can go from image generation to finished manga entirely inside ComfyUI.
@@ -235,6 +257,70 @@ you can go from image generation to finished manga entirely inside ComfyUI.
---
## 11-7 TagSpace - picking tags and prompts from a "map of meaning" (v0.9.0 and later)
The **TagSpace** tab lays out the prompts, tags and generated images inside Workflow Studio in a 3D space
according to **closeness of meaning**. Things close together mean similar things, so you can browse the space
("which tags are close to this mood?") and pick tags to build a prompt.
### What is in the space
- **Cards** - the sample images of the Gallery's **ImagePrompt** (Chapter 8, section 8-4) with their prompts, shown as thumbnails
- **Tags** - words taken (split at commas) from ImagePrompt prompts, prompts embedded in generated images, wildcards, the Tagger DB and the Prompt library, shown as dots colored by source
- **Gallery points** - some of your generated images, shown as faint dots (each carries the tags of its own prompt)
### Preparation
As with the Gallery's semantic search (Chapter 8, section 8-6), **Ollama** and **EmbeddingGemma 2** are needed.
If the Gallery's semantic index was made with Gemini Embedding 2, rebuild it with EmbeddingGemma 2 first.
### Building the space
Choose the settings in the toolbar and press **Build / Update**.
- **Tags** - how many tags to include. The sources take turns, each in order of how often a tag is used
- **All tags** - when on, every candidate tag is used instead of the Tags number (up to 20,000)
- **Min uses** - leaves out tags used fewer times than this. 2 removes one-off spelling variants and the like
- **Wildcards** - whether wildcards are used as a tag source
- **Gallery points** - how many generated images to show (0 = none)
- **Tagger fill** - tags generated images whose prompt cannot be read, using a Tagger model (OFF / a model name; choose "Gallery points only" or "All images without a prompt")
- The first build takes a few minutes to read image prompts and prepare tags. Later builds reuse the previous results and finish in seconds to tens of seconds.
- The status line shows the numbers of cards, tags and Gallery points. When only part of the candidates is used, "(of N candidates)" is shown.
> **Tip**
> Most distinct tags are words that only appear in wildcards.
> Turning "Wildcards" off and "All tags" on lays out every tag you have actually used (about 10,000 in testing).
> **Caution**
> Tagger fill takes about 0.5 second per image on the CPU. Before choosing "All images without a prompt", check that Tagger runs on the GPU (Chapter 12, section 12-5).
### Looking and searching
- **Drag** to rotate, **right-drag** to pan, and use the **wheel** to zoom.
- Hovering over a point shows its name, thumbnail and prompt or sources.
- The toolbar checkboxes switch Cards, Thumbnails, Tags and Gallery on or off, as well as **Glow** (stars shining in a night sky) and **Twinkle**.
The checkboxes for each source show or hide tags by source.
- Type words or a sentence in the search box at the top right and press **Enter** (any language). A white mark is placed at that meaning, and nearby cards and tags are listed.
### Picking tags to build a prompt
1. Click a card or tag to select it. Cards and tags close in meaning are listed under **Nearby** on the right.
(Clicking a Gallery point also lists similar generated images)
2. **Double-click** what you want in the prompt, or press **Add** in **Selection**, or the **+** in the list.
A card adds its whole prompt, a tag adds the tag itself, and a Gallery point adds that image's tags to the **Prompt** area at the far right.
3. **Add to GenerateUI (Positive)** appends it to the positive prompt of the workflow loaded in GenerateUI (load a workflow in GenerateUI first).
You can also **Copy** it to the clipboard.
### Searching with the tags of a card or generated image
When you select a card or Gallery point, its prompt tags are shown as buttons under **Selection**.
Click tags to choose them (click again to deselect) and press **Search with selected** to search the space with them.
This helps when you want to find things close to, say, only the hairstyle and clothing of an image.
While tags are selected, the **Add** button in **Selection** becomes **Add selected (N)** and adds only those tags to the prompt area.
With no tags selected it adds the whole item as before (a card's whole prompt, or all tags of a Gallery point).
When a Gallery point is selected, **Selection** also shows an **Open in Gallery** button.
It switches to the Gallery tab, selects the image's folder, and selects the image in the list (its details open on the right).
So that the image is sure to appear, the Gallery's search, favorite, tag and group filters are cleared.
A card's whole prompt can be read under **Full prompt**.
---
> **Summary of this chapter**
> - In the Nodes tab you can list and organize installed nodes, and use them in the WS Library
> - Tagger automatically generates tags from images. A model and extra packages must be prepared
@@ -242,3 +328,4 @@ you can go from image generation to finished manga entirely inside ComfyUI.
> - In the Video tab, you can make videos with supported video-generation models and do simple editing
> - "Default Checkpoint" and "Data Management (backup)" in the Settings tab are especially handy
> - Combined with Comic Creator by the same author, you can make manga from generated images
> - TagSpace lays out your tags, prompts and generated images in 3D by closeness of meaning, so you can browse it and pick tags for a prompt
@@ -143,6 +143,11 @@ You need to set the environment variable `WFS_ALLOWED_BACKEND_HOSTS` (Chapter 10
- Check that a `.onnx` file (and `selected_tags.csv`) is in the `ComfyUI/models/tagger/(model name)/` folder.
- Check that the extra Python package (onnxruntime) is installed in **the Python that ComfyUI uses** (Chapter 11, section 11-2).
### Tagger is very slow (the GPU is not used)
If ComfyUI's Python has both the CPU package `onnxruntime` and the GPU package `onnxruntime-gpu`, the GPU stops being used.
(Installing other custom nodes can bring in the CPU package.)
Stop ComfyUI, then in ComfyUI's Python run `pip uninstall -y onnxruntime onnxruntime-gpu` followed by `pip install onnxruntime-gpu`, and restart ComfyUI (DirectML is not supported).
### PSD-related features give an error
An extra Python package (psd-tools) is needed.
Run the installation command shown in the error message in the Python that ComfyUI uses, then restart ComfyUI.
@@ -150,9 +155,18 @@ Run the installation command shown in the error message in the Python that Comfy
### Semantic search (Gallery) does not work well
| Symptom | Cause | What to do |
| --- | --- | --- |
| The GPU is not detected (settings say no GPU detected, or runs on the CPU) | The onnxruntime in ComfyUI's Python is the CPU version | Stop ComfyUI, then in ComfyUI's Python run `pip uninstall -y onnxruntime onnxruntime-gpu` followed by `pip install onnxruntime-gpu`, and restart ComfyUI (DirectML is not supported) |
| "Cannot reach Ollama" is shown | Ollama is not running, or the Ollama URL is wrong | Start Ollama (it is needed while indexing and searching). Check the Ollama URL on the gear button's Model tab |
| "The Ollama model is not downloaded" is shown | EmbeddingGemma 2 has not been downloaded | Run `ollama pull embeddinggemma-2:740m` (or `embeddinggemma-2:440m`) |
| Indexing sometimes fails with "connection was forcibly closed" or similar | Security software (such as AdGuard) is intercepting Ollama's traffic | Exclude Ollama from filtering. Failed images are processed again by the next "New / changed images only" run |
| Gemini says "GEMINI_API_KEY is not set", or the key is rejected | There is no key in `.env`, or the line starts with `#` | Write `GEMINI_API_KEY=key` in the plugin's `.env` (copy `.env.example`) and restart ComfyUI. `.env` is only read at startup |
| Search or Similar gives no results | The selected folder has no indexed images | Build the index with the gear button. Choose a folder with a green dot. When you change the model or precision, "rebuild all" |
| Search or Similar gives no results | The selected folder has no indexed images | Build the index with the gear button. Choose a folder with a green dot. When you change the model or vector dimension, "rebuild all" |
### The TagSpace space cannot be built
| Symptom | Cause | What to do |
| --- | --- | --- |
| "EmbeddingGemma 2 in Ollama is required" is shown | Ollama is not running, or the model is missing | Prepare the same way as for semantic search (table above) |
| "The Gallery semantic index was made with ..." is shown | The Gallery index was made with Gemini | Choose EmbeddingGemma 2 in the Gallery's semantic settings and rebuild all |
| Building takes a very long time | The first build reads image prompts and prepares new tags | Later builds are faster. When using Tagger fill, check that Tagger runs on the GPU ("Tagger is very slow" above) |
### A partner API (Nano Banana) says authentication failed
The cause is a missing Comfy API key in `.env`. Write `COMFY_API_KEY=your key` (issued at platform.comfy.org) in the plugin's `.env` and restart ComfyUI (Chapter 5, section 5-8).
+1
View File
@@ -44,6 +44,7 @@ The main terms that appear in this book, in alphabetical order.
| Steps | The number of times drawing is repeated | Chapter 5 |
| Style | A mood template added to a prompt | Chapter 7 |
| T2I (Text to Image) | Making an image from text (a prompt) | Chapter 5 |
| TagSpace | A tab that lays out tags, prompts and generated images in 3D by closeness of meaning | Chapter 11 |
| Trigger word | A word to put in the prompt to bring out a LoRA's effect | Chapter 6 |
| VAE | The model that finishes an image's colors and fine details | Chapter 6 |
| VLM | An AI model that can read images | Chapter 10 |
+9
View File
@@ -52,6 +52,15 @@ def _maybe_use_selector_event_loop():
print("[Workflow Studio] Using WindowsSelectorEventLoopPolicy (windows_selector_event_loop enabled)")
except Exception as e:
print(f"[WARNING] Workflow Studio: failed to switch to selector event loop: {e}")
return
# Selector方式ではloop.sendfileがasyncioの_sendfile_fallbackになるが、これは16KBバッファを
# 使い回しつつ未送信分をコピーせずトランスポートに積むため、送信が詰まると後続ブロックで
# 上書きされ画像等が壊れて届く(Python 3.12で確認)。aiohttpのsendfileを無効化し、
# チャンクごとに新しいbytesを読む自前フォールバックを使わせる
os.environ["AIOHTTP_NOSENDFILE"] = "1"
fileresponse = sys.modules.get("aiohttp.web_fileresponse")
if fileresponse is not None:
fileresponse.NOSENDFILE = True
_maybe_use_selector_event_loop()
+18 -5
View File
@@ -73,6 +73,7 @@ def setup_routes(app: web.Application):
app.router.add_post("/wfm/gallery/semantic/similar", semantic_similar)
app.router.add_post("/wfm/gallery/semantic/clear", semantic_clear)
app.router.add_post("/wfm/gallery/semantic/test", semantic_test)
app.router.add_post("/wfm/gallery/semantic/options", semantic_options)
app.router.add_get("/wfm/gallery/images", list_images)
app.router.add_get("/wfm/gallery/image/meta", get_image_meta)
app.router.add_get("/wfm/gallery/image/workflow", get_image_workflow)
@@ -112,7 +113,7 @@ def setup_routes(app: web.Application):
# ──────────────────────────────────────────────────────────────
# セマンティック検索 (Gemini Embedding 2)
# セマンティック検索 (Gemini Embedding 2 / Ollama EmbeddingGemma 2)
# ──────────────────────────────────────────────────────────────
def _semantic_error(e: SemanticError) -> web.Response:
@@ -164,9 +165,9 @@ async def semantic_folders(request: web.Request) -> web.Response:
def _apply_local_options(body: dict) -> None:
"""リクエストに実行デバイス/スレッド数が含まれていれば反映・保存する"""
if "device" in body:
_semantic.set_local_options(str(body.get("device", "auto")), _num(body, "threads", 0, 0, 256))
"""リクエストに Ollama の接続先/モデルサイズが含まれていれば反映・保存する"""
if "ollama_url" in body:
_semantic.set_local_options(str(body.get("ollama_url", "")), str(body.get("ollama_tag", "")))
async def semantic_index(request: web.Request) -> web.Response:
@@ -180,7 +181,6 @@ async def semantic_index(request: web.Request) -> web.Response:
"all" if body.get("mode") == "all" else "missing",
str(body.get("model", SEMANTIC_DEFAULT_MODEL)),
_num(body, "dim", DEFAULT_DIM, 0, 100000),
_num(body, "soft", 280, 0, 100000),
)
return web.json_response({"ok": True})
except SemanticError as e:
@@ -848,3 +848,16 @@ async def get_psd_layers(request: web.Request) -> web.Response:
except Exception as e:
logger.error("Error reading PSD layers: %s", e)
return web.json_response({"error": str(e)}, status=500)
async def semantic_options(request: web.Request) -> web.Response:
"""Ollama の接続先/モデルサイズを保存して、新しい状態を返す"""
body = await _json_body(request)
try:
await asyncio.to_thread(_apply_local_options, body)
return web.json_response(await asyncio.to_thread(_semantic.status))
except SemanticError as e:
return _semantic_error(e)
except Exception as e:
logger.error("semantic_options error: %s", e)
return web.json_response({"error": str(e)}, status=500)
+83
View File
@@ -0,0 +1,83 @@
"""
TagSpace Routes - タグ/ImagePromptカード/Gallery画像を3D潜在空間に並べるタブ用API
"""
import asyncio
import logging
from aiohttp import web
from ..config import DATA_DIR
from ..services.tagspace_service import TagSpaceService, DEFAULT_MAX_TAGS, DEFAULT_BG, MAX_TAGS_LIMIT, MIN_COUNT_LIMIT
from ..services.semantic_service import SemanticError
from .gallery_routes import _service as _gallery, _semantic, _semantic_error, _num, _json_body
from .tagger_routes import _svc as _tagger
logger = logging.getLogger(__name__)
_tagspace = TagSpaceService(DATA_DIR, _gallery, _semantic, _tagger)
def setup_routes(app: web.Application):
app.router.add_get("/wfm/tagspace/status", tagspace_status)
app.router.add_get("/wfm/tagspace/space", tagspace_space)
app.router.add_post("/wfm/tagspace/build", tagspace_build)
app.router.add_post("/wfm/tagspace/cancel", tagspace_cancel)
app.router.add_post("/wfm/tagspace/search", tagspace_search)
app.router.add_post("/wfm/tagspace/neighbors", tagspace_neighbors)
async def _call(fn, *args) -> web.Response:
try:
return web.json_response(await asyncio.to_thread(fn, *args))
except SemanticError as e:
return _semantic_error(e)
except Exception as e:
logger.error("tagspace %s error: %s", getattr(fn, "__name__", fn), e)
return web.json_response({"error": str(e)}, status=500)
async def tagspace_status(request: web.Request) -> web.Response:
return await _call(_tagspace.status)
async def tagspace_space(request: web.Request) -> web.Response:
return await _call(_tagspace.space)
async def tagspace_build(request: web.Request) -> web.Response:
body = await _json_body(request)
try:
# max_tags=0 は全タグ(サービス側で ALL_TAGS_LIMIT まで)
max_tags = _num(body, "max_tags", DEFAULT_MAX_TAGS, 0, MAX_TAGS_LIMIT)
bg = _num(body, "background", DEFAULT_BG, 0, 20000)
min_count = _num(body, "min_count", 1, 1, MIN_COUNT_LIMIT)
except SemanticError as e:
return _semantic_error(e)
tagger_model = str(body.get("tagger_model", "") or "")
tagger_scope = str(body.get("tagger_scope", "background") or "background")
wildcard = body.get("wildcard", True) is not False
return await _call(lambda: (_tagspace.start_build(max_tags, bg, tagger_model, tagger_scope, min_count, wildcard),
{"ok": True})[1])
async def tagspace_cancel(request: web.Request) -> web.Response:
_tagspace.cancel()
return web.json_response({"ok": True})
async def tagspace_search(request: web.Request) -> web.Response:
body = await _json_body(request)
try:
k = _num(body, "k", 20, 1, 200)
except SemanticError as e:
return _semantic_error(e)
return await _call(_tagspace.search, str(body.get("query", "")), k)
async def tagspace_neighbors(request: web.Request) -> web.Response:
body = await _json_body(request)
try:
k = _num(body, "k", 20, 1, 200)
except SemanticError as e:
return _semantic_error(e)
return await _call(_tagspace.neighbors, str(body.get("id", "")), k)
-239
View File
@@ -1,239 +0,0 @@
"""
EmbeddingGemma 2 ローカル実行 (onnx-community/embeddinggemma-2-ONNX)
onnxruntime + tokenizers + huggingface_hub だけで動かす(transformers の対応を待たない)。
前処理は Transformers.js の Gemma4ImageProcessor / EmbeddingGemma2Processor の移植:
画像 -> アスペクト比維持でリサイズ(48px倍数, 最大2520パッチ) -> 16pxパッチ化 -> vision_encoder
-> image_features を text model の <|image|> トークン位置に差し込み -> sentence_embedding(768)
モデルは初回のみ固定リポジトリからダウンロードする(約300MB, q4)。
"""
import logging
import math
import os
import threading
from pathlib import Path
import numpy as np
logger = logging.getLogger(__name__)
REPO_ID = "onnx-community/embeddinggemma-2-ONNX"
LOCAL_MODEL = "embeddinggemma-2"
LOCAL_DIMS = (128, 256, 512, 768) # MRL対応次元
DEFAULT_LOCAL_DIM = 768
# 量子化精度 -> ファイル名サフィックス
DTYPES = {"q4": "_q4", "q8": "_quantized", "fp16": "_fp16", "fp32": ""}
DEFAULT_DTYPE = "q4"
_PATCH = 16
_POOL = 3
SOFT_TOKENS = (70, 140, 280) # 画像1枚あたりのソフトトークン数(多いほど高精度・低速)
DEFAULT_SOFT = 280
_MAX_TOKENS = 1024 # テキスト入力のトークン数上限(画像用プロンプトは約290トークン)
_MAX_IMAGE_SIDE = 2048 # 画像の長辺上限(超える場合は縮小してから処理)
_IMAGE_TOKEN = "<|image|>"
_BOI = "<|image>"
_EOI = "<image|>"
DEVICES = ("auto", "cpu", "cuda", "dml")
_PROVIDER_BY_DEVICE = {"cuda": "CUDAExecutionProvider", "dml": "DmlExecutionProvider"}
_lock = threading.Lock()
_runtime = None # ((dtype, device, threads), _Runtime)
_opts = {"device": "auto", "threads": 0} # 実行デバイス/CPUスレッド数(configureで更新)
def configure(device: str = "auto", threads: int = 0) -> None:
"""ローカル推論の実行設定。次回のensure_runtimeから反映(device/threads変更時はセッション再作成)。"""
_opts["device"] = device if device in DEVICES else "auto"
_opts["threads"] = max(0, min(int(threads), (os.cpu_count() or 1) * 2))
def current_config() -> dict:
return dict(_opts)
def release() -> None:
"""セッションを破棄してVRAM/RAMを解放する(インデックス作成後など)。次回利用時に再ロードされる。"""
global _runtime
with _lock:
_runtime = None
def active_provider() -> str:
"""直近にロードしたセッションの実行プロバイダ(未ロードなら空)"""
rt = _runtime[1] if _runtime else None
return rt.providers[0].replace("ExecutionProvider", "") if rt else ""
def available_devices() -> dict:
"""onnxruntime が使える実行デバイス。GPU用ビルド(onnxruntime-gpu / -directml)が無ければcpuのみ。"""
try:
import onnxruntime as ort
prov = ort.get_available_providers()
version = ort.__version__
except Exception:
return {"cpu": True, "cuda": False, "dml": False, "ort_version": ""}
return {"cpu": True, "cuda": "CUDAExecutionProvider" in prov, "dml": "DmlExecutionProvider" in prov,
"ort_version": version, "cpu_count": os.cpu_count() or 1}
def default_threads() -> int:
"""既定のCPUスレッド数: 画像生成と同居しても邪魔になりにくいよう、コアの半分(最低1)"""
return max(1, (os.cpu_count() or 2) // 2)
def _target_size(h: int, w: int, max_patches: int) -> tuple[int, int]:
"""Gemma4ImageProcessor の get_aspect_ratio_preserving_size"""
factor = math.sqrt(max_patches * _PATCH ** 2 / (h * w))
side = _POOL * _PATCH
th = int(math.floor(factor * h / side)) * side
tw = int(math.floor(factor * w / side)) * side
max_side = (max_patches // _POOL ** 2) * side
if th == 0 and tw == 0:
raise ValueError("image too small")
if th == 0:
th, tw = side, min((w // h) * side, max_side)
elif tw == 0:
tw, th = side, min((h // w) * side, max_side)
return th, tw
class _Runtime:
def __init__(self, model_dir: Path, dtype: str, device: str = "auto", threads: int = 0):
import onnxruntime as ort
from tokenizers import Tokenizer
sfx = DTYPES[dtype]
so = ort.SessionOptions()
so.log_severity_level = 3 # CUDA使用時のMemcpy警告などを抑止
if threads > 0:
so.intra_op_num_threads = threads
so.inter_op_num_threads = 1
avail = ort.get_available_providers()
if device in _PROVIDER_BY_DEVICE:
providers = [_PROVIDER_BY_DEVICE[device]] if _PROVIDER_BY_DEVICE[device] in avail else []
elif device == "cpu":
providers = []
else: # auto: 使えるGPUを優先
providers = [p for p in ("CUDAExecutionProvider", "DmlExecutionProvider") if p in avail]
if "DmlExecutionProvider" in providers:
# DirectMLは並列実行/メモリパターン最適化に非対応
so.enable_mem_pattern = False
so.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
providers.append("CPUExecutionProvider")
self.providers = providers
def make(name):
path = str(model_dir / "onnx" / f"{name}{sfx}.onnx")
try:
return ort.InferenceSession(path, so, providers=providers)
except Exception as e:
if providers == ["CPUExecutionProvider"]:
raise
logger.warning("EmbeddingGemma2: %s failed on %s (%s); falling back to CPU", name, providers[0], e)
self.providers = ["CPUExecutionProvider"]
return ort.InferenceSession(path, so, providers=["CPUExecutionProvider"])
self.text = make("model")
self.vision = make("vision_encoder")
self.tok = Tokenizer.from_file(str(model_dir / "tokenizer.json"))
self.tok.no_truncation()
self.tok.no_padding()
def _run_text(self, text: str, image_features: np.ndarray | None) -> np.ndarray:
ids = np.asarray([self.tok.encode(text).ids[:_MAX_TOKENS]], dtype=np.int64)
feeds = {
"input_ids": ids,
"attention_mask": np.ones_like(ids),
"image_features": image_features if image_features is not None else np.zeros((0, 512), np.float32),
"video_features": np.zeros((0, 512), np.float32),
"audio_features": np.zeros((0, 512), np.float32),
}
return self.text.run(["sentence_embedding"], feeds)[0][0]
def embed_text(self, text: str, prefix: str) -> np.ndarray:
return self._run_text(f"{prefix}{text.strip()}", None)
def embed_image(self, image, soft_tokens: int = DEFAULT_SOFT) -> np.ndarray:
from PIL import Image
im = image.convert("RGB")
if im.width < 1 or im.height < 1:
raise ValueError("empty image")
if max(im.size) > _MAX_IMAGE_SIDE: # 巨大画像でメモリを使い切らないよう先に縮小
im.thumbnail((_MAX_IMAGE_SIDE, _MAX_IMAGE_SIDE), Image.LANCZOS)
max_patches = soft_tokens * _POOL ** 2
th, tw = _target_size(im.height, im.width, max_patches)
if (th, tw) != (im.height, im.width):
im = im.resize((tw, th), Image.BICUBIC)
arr = np.asarray(im, dtype=np.float32) * (1.0 / 255.0) # H,W,3
ph, pw = th // _PATCH, tw // _PATCH
n = ph * pw
# (pH, dy, pW, dx, C) -> (pH, pW, dy, dx, C) -> (n, 768)
patches = arr.reshape(ph, _PATCH, pw, _PATCH, 3).transpose(0, 2, 1, 3, 4).reshape(n, _PATCH * _PATCH * 3)
# パディング無し(n個ちょうど)で渡す: 計算量が減り、パディングは出力に影響しない
pixel = patches[None].astype(np.float32)
pos = np.zeros((1, n, 2), dtype=np.int64)
rows, cols = np.divmod(np.arange(n), pw)
pos[0, :, 0], pos[0, :, 1] = cols, rows
feats = self.vision.run(["image_features"], {"pixel_values": pixel, "pixel_position_ids": pos})[0]
text = f"{_BOI}{_IMAGE_TOKEN * (n // _POOL ** 2)}{_EOI}"
return self._run_text(text, feats.astype(np.float32))
def model_dir(data_dir: Path) -> Path:
return data_dir / "models" / LOCAL_MODEL
def is_downloaded(data_dir: Path, dtype: str = DEFAULT_DTYPE) -> bool:
d, sfx = model_dir(data_dir), DTYPES.get(dtype, "_q4")
need = [d / "tokenizer.json"] + [d / "onnx" / f"{n}{sfx}.onnx{e}" for n in ("model", "vision_encoder") for e in ("", "_data")]
return all(p.exists() for p in need)
def ensure_runtime(data_dir: Path, dtype: str = DEFAULT_DTYPE, progress=None,
device: str | None = None, threads: int | None = None) -> _Runtime:
"""モデルをダウンロード(未取得時)してセッションを返す。dtype/device/threads変更時は作り直す。"""
global _runtime
if dtype not in DTYPES:
dtype = DEFAULT_DTYPE
device = _opts["device"] if device is None else device
threads = _opts["threads"] if threads is None else threads
if device not in DEVICES:
device = "auto"
key = (dtype, device, int(threads))
with _lock:
if _runtime and _runtime[0] == key:
return _runtime[1]
d, sfx = model_dir(data_dir), DTYPES[dtype]
if not is_downloaded(data_dir, dtype):
if progress:
progress("downloading")
from huggingface_hub import hf_hub_download
files = ["tokenizer.json"] + [f"onnx/{n}{sfx}.onnx{e}" for n in ("model", "vision_encoder") for e in ("", "_data")]
for f in files:
hf_hub_download(REPO_ID, f, local_dir=str(d))
if progress:
progress("loading")
_runtime = (key, _Runtime(d, dtype, device, int(threads)))
return _runtime[1]
def _finish(vec: np.ndarray, dim: int) -> np.ndarray:
v = np.asarray(vec, dtype=np.float32)
if dim < v.shape[0]:
v = v[:dim]
n = float(np.linalg.norm(v))
return v / n if n > 0 else v
def embed_text(data_dir: Path, text: str, dim: int, dtype: str = DEFAULT_DTYPE) -> np.ndarray:
rt = ensure_runtime(data_dir, dtype)
return _finish(rt.embed_text(text[:8000], "task: search result | query: "), dim)
def embed_image(data_dir: Path, image, dim: int, soft: int = DEFAULT_SOFT, dtype: str = DEFAULT_DTYPE) -> np.ndarray:
rt = ensure_runtime(data_dir, dtype)
return _finish(rt.embed_image(image, soft if soft in SOFT_TOKENS else DEFAULT_SOFT), dim)
+211
View File
@@ -0,0 +1,211 @@
"""
EmbeddingGemma 2 を Ollama で実行する (Gallery セマンティック検索のローカルバックエンド)
画像は /api/embed に input=[{"image": <base64>}] で渡す(images フィールドは無視されテキスト扱いになる)。
740m(テキスト+画像+音声) と 440m(テキスト+画像) は同じ重みで同じベクトルを返すため、
インデックスにはタグを区別せず LOCAL_MODEL として記録する。270m/570m は画像非対応なので選択肢に入れない。
接続先は url_guard で検査する(既定はループバックのみ)。
"""
import base64
import io
import json
import logging
import threading
import time
import urllib.error
import urllib.request
import numpy as np
from . import url_guard
logger = logging.getLogger(__name__)
LOCAL_MODEL = "embeddinggemma-2" # インデックス(npz)に記録するモデル名
LOCAL_DIMS = (128, 256, 512, 768) # MRL対応次元
DEFAULT_LOCAL_DIM = 768
TAGS = ("embeddinggemma-2:740m", "embeddinggemma-2:440m")
DEFAULT_TAG = TAGS[0]
# :latest は 740m と同じモデル(parent_model 740m-q8_0)。740m が無ければ代わりに使う
_ALIASES = {"embeddinggemma-2:740m": ("embeddinggemma-2:latest", "embeddinggemma-2")}
DEFAULT_URL = "http://localhost:11434"
QUERY_PREFIX = "task: search result | query: "
BATCH = 4 # 1リクエストで送る画像数(1枚ずつより約1.8倍速い)
_TIMEOUT = 120
_RETRIES = 5 # Ollama内部の接続切断(HTTP 400 "forcibly closed"等)は再試行で回復する
# Ollama はテキストごとに内部のランナーへ新しい接続を張るため、数千件を続けて埋め込むと
# Windows の一時ポートが TIME_WAIT で埋まり "Only one usage of each socket address" で失敗する
# (実測: ループバックの TIME_WAIT 14,228 / 16,384)。ポートが空くまで長めに待って再試行する
_PORT_WAIT = 30.0
_TAGS_TTL = 5.0 # /api/tags の結果をキャッシュする秒数(進捗ポーリングのたびに問い合わせない)
_opts = {"url": DEFAULT_URL, "tag": DEFAULT_TAG}
_tags_cache = {"at": 0.0, "url": "", "names": None, "error": ""}
_lock = threading.Lock()
class OllamaError(Exception):
"""code: ollama_unreachable / ollama_model_missing / local_error"""
def __init__(self, code: str, message: str = ""):
super().__init__(message or code)
self.code = code
def configure(url: str = DEFAULT_URL, tag: str = DEFAULT_TAG) -> None:
"""接続先とモデルサイズを設定する。許可されないURLは ValueError(url_guard.HINT)。"""
url = url_guard.require_backend_url((url or "").strip() or DEFAULT_URL)
with _lock:
_opts["url"] = url
_opts["tag"] = tag if tag in TAGS else DEFAULT_TAG
_tags_cache["at"] = 0.0
def current_config() -> dict:
return dict(_opts)
def _post(path: str, body: dict, timeout: float = _TIMEOUT) -> dict:
base = url_guard.require_backend_url(_opts["url"])
req = urllib.request.Request(base + path, data=json.dumps(body).encode("utf-8"), method="POST",
headers={"Content-Type": "application/json"})
with url_guard.urlopen(req, timeout) as res:
return json.loads(res.read().decode("utf-8"))
def _http_message(e: urllib.error.HTTPError) -> str:
try:
return json.loads(e.read().decode("utf-8")).get("error", "") or str(e.reason)
except Exception:
return str(e.reason)
def _transient(code: int, msg: str) -> bool:
low = msg.lower()
if "failed to load image" in low:
return False # 壊れた画像。再試行しても直らない
if code >= 500:
return True
return code == 400 and (_ports_exhausted(msg)
or any(k in low for k in ("forcibly closed", "wsarecv", "connection", "eof")))
def _ports_exhausted(msg: str) -> bool:
low = msg.lower()
return "only one usage of each socket address" in low or "wsaeaddrinuse" in low
def installed_tags(force: bool = False) -> tuple[list[str] | None, str]:
"""(インストール済みモデル名, エラー)。接続できなければ (None, エラー文)。"""
now = time.time()
with _lock:
c = dict(_tags_cache)
url = _opts["url"]
if not force and c["url"] == url and now - c["at"] < _TAGS_TTL:
return c["names"], c["error"]
names, err = None, ""
try:
base = url_guard.require_backend_url(url)
with url_guard.urlopen(urllib.request.Request(base + "/api/tags"), 3) as res:
data = json.loads(res.read().decode("utf-8"))
names = [m.get("name") or m.get("model") or "" for m in data.get("models", [])]
except Exception as e:
err = str(getattr(e, "reason", e))
with _lock:
_tags_cache.update(at=now, url=url, names=names, error=err)
return names, err
def _resolve(names: list[str], tag: str) -> str:
"""実際に呼ぶモデル名。未インストールなら空文字"""
for cand in (tag,) + _ALIASES.get(tag, ()):
if cand in names:
return cand
return ""
def status() -> dict:
names, err = installed_tags()
tag = _opts["tag"]
out = {"url": _opts["url"], "tag": tag, "tags": list(TAGS), "reachable": names is not None, "error": err,
"installed": {t: bool(names and _resolve(names, t)) for t in TAGS}}
out["ready"] = bool(out["reachable"] and out["installed"][tag])
return out
def _model_name() -> str:
names, err = installed_tags()
if names is None:
raise OllamaError("ollama_unreachable", f"{_opts['url']}: {err}")
name = _resolve(names, _opts["tag"])
if not name:
raise OllamaError("ollama_model_missing", _opts["tag"])
return name
def _embed(inputs: list) -> list[np.ndarray]:
model = _model_name()
last = ""
for attempt in range(_RETRIES + 1):
try:
data = _post("/api/embed", {"model": model, "input": inputs})
embs = data.get("embeddings") or []
if len(embs) != len(inputs):
raise OllamaError("local_error", f"expected {len(inputs)} embeddings, got {len(embs)}")
return [np.asarray(e, dtype=np.float32) for e in embs]
except urllib.error.HTTPError as e:
msg = _http_message(e)
last = f"HTTP {e.code}: {msg}"
if e.code == 404:
with _lock:
_tags_cache["at"] = 0.0 # 削除された可能性があるので次回は問い合わせ直す
raise OllamaError("ollama_model_missing", model)
if not _transient(e.code, msg) or attempt >= _RETRIES:
raise OllamaError("local_error", last)
if _ports_exhausted(msg):
logger.warning("Ollama: local ports exhausted, waiting %.0fs before retry", _PORT_WAIT)
time.sleep(_PORT_WAIT)
continue
except (urllib.error.URLError, TimeoutError, ConnectionError) as e:
last = str(getattr(e, "reason", e))
if attempt >= _RETRIES:
raise OllamaError("ollama_unreachable", f"{_opts['url']}: {last}")
time.sleep(min(4.0, 0.5 * (2 ** attempt)))
raise OllamaError("local_error", last)
def _finish(vec: np.ndarray, dim: int) -> np.ndarray:
v = vec[:dim] if dim < vec.shape[0] else vec
n = float(np.linalg.norm(v))
return v / n if n > 0 else v
def _image_b64(image) -> str:
buf = io.BytesIO()
image.convert("RGB").save(buf, "JPEG", quality=88)
return base64.b64encode(buf.getvalue()).decode("ascii")
def embed_text(text: str, dim: int) -> np.ndarray:
return embed_texts([text], dim)[0]
def embed_texts(texts: list[str], dim: int) -> list[np.ndarray]:
"""検索文(クエリ)として複数のテキストをまとめて埋め込む"""
return [_finish(v, dim) for v in _embed([QUERY_PREFIX + t[:8000].strip() for t in texts])]
def embed_images(images: list, dim: int) -> list[np.ndarray]:
"""PIL画像(RGB)のリストをまとめて埋め込む。1枚でも読めないとリクエスト全体が失敗する。"""
return [_finish(v, dim) for v in _embed([{"image": _image_b64(im)} for im in images])]
def release() -> None:
"""モデルをVRAMから外す(インデックス作成後)。次回利用時にOllamaが再ロードする。"""
try:
names, _ = installed_tags()
name = _resolve(names or [], _opts["tag"])
if name:
_post("/api/embed", {"model": name, "input": [], "keep_alive": 0}, timeout=30)
except Exception as e:
logger.debug("semantic_ollama: release failed: %s", e)
+137 -74
View File
@@ -1,7 +1,7 @@
"""
Semantic Service - Gallery用セマンティック検索(Gemini Embedding 2)
Semantic Service - Gallery用セマンティック検索(Gemini Embedding 2 / Ollama の EmbeddingGemma 2)
画像(動画・PSDはサムネイル)をGemini Embedding APIでベクトル化してローカルに保存し、
画像(動画・PSDはサムネイル)をGemini Embedding API または Ollama でベクトル化してローカルに保存し、
テキストクエリ/類似画像でコサイン類似度検索する。インデックス構築後の検索は
(テキストクエリの埋め込み1回を除き)ローカル処理でAPI費用はかからない。
@@ -21,13 +21,13 @@ from pathlib import Path
import numpy as np
from . import semantic_local as local
from . import semantic_ollama as local
logger = logging.getLogger(__name__)
API_BASE = "https://generativelanguage.googleapis.com/v1beta"
MODEL = "gemini-embedding-2" # Gemini API (クラウド)
LOCAL_MODEL = local.LOCAL_MODEL # EmbeddingGemma 2 (ローカルONNX)
LOCAL_MODEL = local.LOCAL_MODEL # EmbeddingGemma 2 (Ollama)
DEFAULT_DIM = 1536
VALID_DIMS = (768, 1536, 3072)
# バックエンド(モデル名) -> 選択可能な出力次元
@@ -126,7 +126,6 @@ class SemanticService:
self._stamp: dict[str, tuple[int, float]] = {} # path -> (size, mtime)
self._dim = 0 # インデックスの次元(0=空)
self._model = MODEL # インデックスを作ったモデル
self._soft = local.DEFAULT_SOFT # ローカルモデルの画像ソフトトークン数(インデックスと一致させる)
self._settings_file = data_dir / "semantic_settings.json"
self._load_settings()
self._mat_cache = None # (paths, matrix)
@@ -137,21 +136,22 @@ class SemanticService:
self._cancel = threading.Event()
self._thread: threading.Thread | None = None
# ── ローカル推論の実行設定(デバイス/スレッド数) ─────────────
# ── Ollama の接続先/モデルサイズ ────────────────────────
def _load_settings(self) -> None:
try:
if self._settings_file.exists():
d = json.loads(self._settings_file.read_text(encoding="utf-8"))
local.configure(str(d.get("device", "auto")), int(d.get("threads", 0)))
return
local.configure(str(d.get("url", local.DEFAULT_URL)), str(d.get("tag", local.DEFAULT_TAG)))
except Exception as e:
logger.warning("SemanticService: failed to load settings: %s", e)
local.configure("auto", local.default_threads())
def set_local_options(self, device: str, threads: int) -> None:
"""実行デバイス/CPUスレッド数を反映して保存する(検索時のクエリ埋め込みにも使われる)"""
local.configure(device, threads)
def set_local_options(self, url: str, tag: str) -> None:
"""Ollama の接続先/モデルサイズを反映して保存する(検索時のクエリ埋め込みにも使われる)"""
try:
local.configure(url, tag)
except ValueError as e:
raise SemanticError("bad_url", str(e))
try:
self._settings_file.write_text(json.dumps(local.current_config()), encoding="utf-8")
except Exception as e:
@@ -177,7 +177,6 @@ class SemanticService:
if model not in DIMS_BY_MODEL:
return
self._model = model
self._soft = int(z["soft"]) if "soft" in z.files else local.DEFAULT_SOFT
paths = [str(p) for p in z["paths"]]
sizes, mtimes, vecs = z["sizes"], z["mtimes"], z["vecs"]
self._dim = int(z["dim"])
@@ -201,7 +200,7 @@ class SemanticService:
tmp = self._file.with_suffix(".tmp.npz")
np.savez(
tmp,
model=np.array(self._model), dim=np.array(self._dim), soft=np.array(self._soft),
model=np.array(self._model), dim=np.array(self._dim),
paths=np.array(paths),
sizes=np.array([self._stamp[p][0] for p in paths], dtype=np.int64),
mtimes=np.array([self._stamp[p][1] for p in paths], dtype=np.float64),
@@ -228,24 +227,18 @@ class SemanticService:
def status(self, folder: str = "", recursive: bool = True) -> dict:
self._ensure_loaded()
ollama = local.status()
out = {
"has_key": bool(get_api_key()),
"model": MODEL,
"backends": {
MODEL: {"dims": list(VALID_DIMS), "default_dim": DEFAULT_DIM, "ready": bool(get_api_key())},
LOCAL_MODEL: {"dims": list(local.LOCAL_DIMS), "default_dim": local.DEFAULT_LOCAL_DIM,
"ready": True, "downloaded": local.is_downloaded(self.data_dir)},
"ready": ollama["ready"]},
},
"index_model": self._model,
"index_dim": self._dim,
"index_soft": self._soft,
"local": {
"devices": local.available_devices(),
"options": local.current_config(),
"default_threads": local.default_threads(),
"soft_tokens": list(local.SOFT_TOKENS),
"default_soft": local.DEFAULT_SOFT,
},
"ollama": ollama,
"indexed_total": len(self._vecs),
"job": dict(self._job),
}
@@ -279,8 +272,7 @@ class SemanticService:
# ── インデックス作成ジョブ ────────────────────────────
def start_index(self, folder: str, recursive: bool, mode: str, model: str, dim: int,
soft: int = local.DEFAULT_SOFT) -> None:
def start_index(self, folder: str, recursive: bool, mode: str, model: str, dim: int) -> None:
self._ensure_loaded()
if model not in DIMS_BY_MODEL:
raise SemanticError("bad_model", model)
@@ -288,15 +280,19 @@ class SemanticService:
raise SemanticError("no_api_key")
if dim not in DIMS_BY_MODEL[model]:
raise SemanticError("bad_dim", str(dim))
if model != LOCAL_MODEL or soft not in local.SOFT_TOKENS:
soft = local.DEFAULT_SOFT # ソフトトークン数はローカルモデルのみの設定
if model == LOCAL_MODEL:
st = local.status() # 接続できない/モデル未取得なら、ジョブを始める前に知らせる
if not st["reachable"]:
raise SemanticError("ollama_unreachable", f"{st['url']}: {st['error']}")
if not st["ready"]:
raise SemanticError("ollama_model_missing", st["tag"])
with self._lock:
if self._job["running"]:
raise SemanticError("already_running")
entries = self._scope_entries(folder, recursive)
mismatch = bool(self._vecs) and (self._dim != dim or self._model != model or self._soft != soft)
mismatch = bool(self._vecs) and (self._dim != dim or self._model != model)
if mismatch and mode != "all":
raise SemanticError("dim_mismatch", f"{self._model}/{self._dim}/{self._soft}")
raise SemanticError("dim_mismatch", f"{self._model}/{self._dim}")
if mode == "all":
# 範囲内の既存ベクトルを破棄して作り直す(モデル/次元違いなら全消去)
if mismatch:
@@ -309,14 +305,13 @@ class SemanticService:
self._mat_cache = None
self._dim = dim
self._model = model
self._soft = soft
todo = [e for e in entries if not self._is_fresh(e[1], e[2], e[3])]
# スコープ内で消えたファイルの残骸を掃除(スコープ配下のキーのみ)
self._prune_missing(folder, recursive, {e[1] for e in entries})
self._cancel.clear()
self._job = self._idle_job()
self._job.update(running=True, total=len(todo))
self._thread = threading.Thread(target=self._run_index, args=(todo, model, dim, soft), daemon=True)
self._thread = threading.Thread(target=self._run_index, args=(todo, model, dim), daemon=True)
self._thread.start()
def _prune_missing(self, folder: str, recursive: bool, existing: set[str]) -> None:
@@ -335,52 +330,78 @@ class SemanticService:
def cancel(self) -> None:
self._cancel.set()
def _run_index(self, todo: list, model: str, dim: int, soft: int = local.DEFAULT_SOFT) -> None:
def work(entry):
if self._cancel.is_set():
return
name, ap, size, mtime = entry
self._job["current"] = name
try:
vec = self._embed_image(model, dim, Path(ap), soft)
self._put(ap, vec, size, mtime)
self._job["done"] += 1
except SemanticError as e:
if e.code in ("no_api_key", "api_key_invalid"):
self._job["error_code"], self._job["error"] = e.code, str(e)
self._cancel.set()
else:
self._job["failed"] += 1
if not self._job["error"]:
self._job["error_code"], self._job["error"] = e.code, str(e)
except Exception as e:
logger.warning("SemanticService: embed failed for %s: %s", ap, e)
def _run_index(self, todo: list, model: str, dim: int) -> None:
def fail(e: SemanticError) -> None:
if e.code in ("no_api_key", "api_key_invalid", "ollama_unreachable", "ollama_model_missing"):
# 続けても全件失敗するので中止する
self._job["error_code"], self._job["error"] = e.code, str(e)
self._cancel.set()
else:
self._job["failed"] += 1
if not self._job["error"]:
self._job["error_code"], self._job["error"] = e.code, str(e)
def checkpoint() -> None:
if self._dirty >= _CHECKPOINT_EVERY:
try:
self._save()
except Exception as e:
logger.warning("SemanticService: checkpoint failed: %s", e)
def work(entry):
if self._cancel.is_set():
return
name, ap, size, mtime = entry
self._job["current"] = name
try:
vec = self._embed_image(model, dim, Path(ap))
self._put(ap, vec, size, mtime)
self._job["done"] += 1
except SemanticError as e:
fail(e)
except Exception as e:
logger.warning("SemanticService: embed failed for %s: %s", ap, e)
self._job["failed"] += 1
checkpoint()
def work_batch(batch):
"""Ollama: まとめて送る。失敗したら1枚ずつ送り直して原因の画像だけを失敗扱いにする"""
if self._cancel.is_set():
return
self._job["current"] = batch[0][0]
vecs = None
try:
ims = [self._load_local_image(Path(e[1])) for e in batch]
vecs = local.embed_images(ims, dim)
except local.OllamaError as e:
if e.code != "local_error":
fail(SemanticError(e.code, str(e)))
return
except Exception:
pass
if vecs is None:
for entry in batch:
work(entry)
return
for (name, ap, size, mtime), vec in zip(batch, vecs):
self._put(ap, vec, size, mtime)
self._job["done"] += 1
checkpoint()
try:
if model == LOCAL_MODEL:
# 初回はモデルのダウンロード/ロードを先に行う(失敗したらジョブ全体を中止)
try:
local.ensure_runtime(self.data_dir, progress=lambda ph: self._job.update(current=f"({ph} model...)"))
except Exception as e:
logger.warning("SemanticService: local model load failed: %s", e)
self._job["error_code"], self._job["error"] = "local_error", str(e)
self._cancel.set()
workers = 1 if model == LOCAL_MODEL else _WORKERS # ローカルはORT側がマルチスレッド
with ThreadPoolExecutor(max_workers=workers) as ex:
list(ex.map(work, todo))
for i in range(0, len(todo), local.BATCH):
work_batch(todo[i:i + local.BATCH])
else:
with ThreadPoolExecutor(max_workers=_WORKERS) as ex:
list(ex.map(work, todo))
finally:
try:
self._save()
except Exception as e:
logger.warning("SemanticService: save failed: %s", e)
if model == LOCAL_MODEL:
local.release() # 画像生成とVRAM/RAMを奪い合わないよう、作成後はモデルを解放(検索時に再ロード)
local.release() # 画像生成とVRAMを奪い合わないよう、作成後はモデルを外す(検索時にOllamaが再ロード)
self._job["running"] = False
self._job["finished"] = True
self._job["cancelled"] = self._cancel.is_set() and not self._job["error_code"]
@@ -401,18 +422,24 @@ class SemanticService:
im.thumbnail((IMAGE_MAX_SIZE, IMAGE_MAX_SIZE), Image.LANCZOS)
return im
def _embed_image(self, model: str, dim: int, path: Path, soft: int | None = None) -> np.ndarray:
def _load_local_image(self, path: Path):
"""Ollama用のRGB画像(透過部は白背景に合成)"""
from PIL import Image
im = self._load_pil(path)
if im.mode == "RGBA":
bg = Image.new("RGB", im.size, (255, 255, 255))
bg.paste(im, mask=im.getchannel("A"))
return bg
return im
def _embed_image(self, model: str, dim: int, path: Path) -> np.ndarray:
if model == LOCAL_MODEL:
if im.mode == "RGBA": # 透過部は白背景に合成
bg = Image.new("RGB", im.size, (255, 255, 255))
bg.paste(im, mask=im.getchannel("A"))
im = bg
im = self._load_local_image(path)
try:
return local.embed_image(self.data_dir, im, dim, self._soft if soft is None else soft)
except Exception as e:
raise SemanticError("local_error", str(e))
return local.embed_images([im], dim)[0]
except local.OllamaError as e:
raise SemanticError(e.code, str(e))
im = self._load_pil(path)
buf = io.BytesIO()
if im.mode == "RGBA":
im.save(buf, "PNG")
@@ -423,11 +450,47 @@ class SemanticService:
def _embed_text(self, model: str, dim: int, text: str) -> np.ndarray:
if model == LOCAL_MODEL:
try:
return local.embed_text(self.data_dir, text, dim)
except Exception as e:
raise SemanticError("local_error", str(e))
return local.embed_text(text, dim)
except local.OllamaError as e:
raise SemanticError(e.code, str(e))
return embed_text(text, dim)
# ── 他機能(TagSpace)向けの読み出し ─────────────────────
def index_info(self) -> dict:
self._ensure_loaded()
with self._lock:
return {"model": self._model, "dim": self._dim, "count": len(self._vecs)}
def job_status(self) -> dict:
return dict(self._job)
def vectors_for(self, entries: list) -> dict[str, np.ndarray]:
"""entries([(name, abs_path, size, mtime)])のうち、索引済みで最新のもののベクトル"""
self._ensure_loaded()
with self._lock:
return {ap: self._vecs[ap] for _, ap, sz, mt in entries
if ap in self._vecs and self._is_fresh(ap, sz, mt)}
def indexed_entries(self, exclude_prefix: str = "") -> list[tuple[str, int, float]]:
"""索引済みの (path, size, mtime) 一覧。exclude_prefix配下は除く"""
self._ensure_loaded()
with self._lock:
return [(p, *self._stamp[p]) for p in self._vecs
if not (exclude_prefix and p.startswith(exclude_prefix))]
def sample_vectors(self, n: int, exclude_prefix: str = "", seed: int = 0) -> tuple[list[str], np.ndarray]:
"""索引から最大n件を無作為に(seed固定で)取り出す。exclude_prefix配下は除く"""
self._ensure_loaded()
with self._lock:
paths = [p for p in self._vecs if not (exclude_prefix and p.startswith(exclude_prefix))]
if len(paths) > n:
pick = np.random.default_rng(seed).choice(len(paths), n, replace=False)
paths = [paths[i] for i in sorted(pick)]
mat = (np.stack([self._vecs[p] for p in paths]) if paths
else np.zeros((0, max(self._dim, 1)), np.float32))
return paths, mat
# ── 検索 ───────────────────────────────────────────────
def _matrix(self):
@@ -510,4 +573,4 @@ class SemanticService:
if dim not in DIMS_BY_MODEL[model]:
dim = DEFAULT_DIM_BY_MODEL[model]
n = int(self._embed_text(model, dim, "test").shape[0])
return {"dimensions": n, "provider": local.active_provider() if model == LOCAL_MODEL else "API"}
return {"dimensions": n, "provider": f"Ollama {local.current_config()['tag']}" if model == LOCAL_MODEL else "API"}
+23
View File
@@ -210,6 +210,29 @@ class TaggerService:
logger.error("predict error: %s", e)
return {"error": str(e)}
# WD Tagger の評価(rating)ラベル。TagSpace の補完では除く
_RATING_LABELS = {"general", "sensitive", "questionable", "explicit"}
def tag_image(self, img: Image.Image, model_name: str) -> list:
"""他機能(TagSpace)向け: ONNXモデルで画像1枚にタグを付ける。しきい値は既定値
(WD 0.35/0.85、PixAIは推奨値)。評価ラベルは除く。読み込めなければ RuntimeError。"""
data = self._load_model(model_name)
if data is None or data.get("type") != "onnx":
raise RuntimeError(f"Model '{model_name}' could not be loaded")
if data.get("pixai_categories"):
thr, char_thr = self._PIXAI_BASE["general"], self._PIXAI_BASE["character"]
else:
thr, char_thr = 0.35, 0.85
return [t for t in self._predict_onnx(img, data, thr, char_thr) if t not in self._RATING_LABELS]
def model_provider(self, model_name: str) -> str:
"""読み込み済みモデルの実行先(CUDA / CPU)。未読み込みなら空文字"""
data = self._cache.get(model_name)
try:
return data["session"].get_providers()[0].replace("ExecutionProvider", "") if data else ""
except Exception:
return ""
# PixAI Tagger v1.0 推奨しきい値(category番号 -> しきい値)。meta/ratingはタグに含めない。
# UIの2本のスライダーは推奨値(general 0.17 / character 0.27)を基準にした相対指定で、
# general側(0,1)はthreshold、character側(3,4)はchar_thresholdに追従する。
+686
View File
@@ -0,0 +1,686 @@
"""
TagSpace Service - WFSのデータを EmbeddingGemma 2 の同じベクトル空間に置き、3Dに投影する
カード : ImagePrompt(ws_image_prompt)の画像+プロンプト。ベクトルは Gallery セマンティック索引の画像ベクトル
タグ : ImagePrompt/ワイルドカード/Tagger DB/Promptライブラリの文をカンマ等で分解した語。Ollamaでテキスト埋め込み
背景 : Gallery 索引から間引いた画像(位置関係を見るための点群)
画像とテキストのベクトルは同じ空間でも別の塊に分かれる(modality gap)ため、
画像群とテキスト群をそれぞれの平均で中心化してからPCAで3軸を求める。
タグのベクトルはタグ文字列をキーに tagspace_tags.npz へキャッシュする(740m/440mは同じベクトル)。
"""
import json
import logging
import re
import sqlite3
import threading
import time
from collections import Counter
from pathlib import Path
import numpy as np
import yaml
from . import semantic_ollama as ollama
from .semantic_service import LOCAL_MODEL, SemanticError
logger = logging.getLogger(__name__)
DEFAULT_MAX_TAGS = 2000
MAX_TAGS_LIMIT = 6000
ALL_TAGS_LIMIT = 20000 # 「全タグ」(max_tags=0)でも超えない上限(ワイルドカード込み・出現1回以上だと約5万種になるため)
MIN_COUNT_LIMIT = 10
DEFAULT_BG = 4000
BG_LIMIT = 20000
_EMBED_BATCH = 32
_RADIUS = 10.0 # 3D座標の広がり(98パーセンタイル半径)
_IMG_EXTS = {".png", ".jpg", ".jpeg", ".webp"}
_VAULT_THUMB_DIRS = {"thumbnails", "thumbnails_option2"}
SOURCES = ("image_prompt", "gallery", "tagger_auto", "tagger", "prompt_library", "wildcard")
TAGGER_SCOPES = ("background", "all") # Tagger補完の対象: 背景の点のみ / プロンプトの無い全画像
_TAGGER_MAX_SIDE = 1024 # Taggerに渡す前の長辺上限(PixAIの1008pxより少し大きく)
_TAGGER_SAVE_EVERY = 100
_PROMPT_MAX = 4000 # キャッシュするプロンプトの最大文字数
# Positive をたどるときに文字列として拾う入力名(CLIPTextEncode系・Qwen/Flux系のエンコーダー・文字列ノード)
_TEXT_INPUTS = {"text", "prompt", "positive", "text_g", "text_l", "clip_l", "t5xxl", "string", "value",
"user_prompt", "system_prompt_text"}
_SKIP_INPUTS = {"negative", "negative_prompt", "neg"}
_SPLIT = re.compile(r"[,\n|{}]+|\bBREAK\b")
_WEIGHT = re.compile(r":\s*-?\d+(?:\.\d+)?\s*$")
_DP_WEIGHT = re.compile(r"^\s*\d+(?:\.\d+)?\s*::") # Dynamic Prompts の "2::option"
_JSON_KEY = re.compile(r'"\s*:') # "key": の形
_MODEL_FILE = re.compile(r"\.(safetensors|ckpt|pt|pth|bin|gguf)\b", re.I)
_HAS_WORD = re.compile(r"[a-z぀-ヿ一-鿿]")
_STOP = {"break", "and", "or", "the", "a", "an"}
def normalize_tag(raw: str) -> str:
"""プロンプトの断片をタグとして正規化する。タグにならなければ空文字"""
s = _DP_WEIGHT.sub("", raw).strip()
if not s or "<" in s or "__" in s or s.lower().startswith(("embedding:", "rating:")):
return ""
# プロンプトに埋め込まれたJSON(MOSS-Image のレイアウト指定 bbox / 文字入れ text 等)の断片と、モデルのファイル名
if _JSON_KEY.search(s) or _MODEL_FILE.search(s):
return ""
s = s.replace('"', "") # 分割で片側だけ残った引用符(blue" / "pink)
s = s.replace("\\(", "\x00").replace("\\)", "\x01") # danbooruのエスケープ括弧は残す
for _ in range(3):
while len(s) > 1 and s[0] in "([" and s[-1] in ")]":
s = s[1:-1].strip()
s = _WEIGHT.sub("", s).strip(" \"'.;")
if s.count("(") != s.count(")") or s.count("[") != s.count("]"):
s = re.sub(r"[()\[\]]", "", s).strip() # 分割で片側だけ残った括弧
s = s.replace("\x00", "(").replace("\x01", ")").replace("_", " ")
s = re.sub(r"\s+", " ", s).lower()
if len(s) < 2 or len(s) > 40 or len(s.split()) > 5 or s in _STOP or not _HAS_WORD.search(s):
return ""
if s.startswith(("embedding:", "rating:")): # (embedding:xxx:1) のように括弧を外してから現れる形
return ""
return s
def split_tags(text: str) -> list[str]:
return [t for t in (normalize_tag(p) for p in _SPLIT.split(text or "")) if t]
# C実装があれば使う(4万行のワイルドカードYAMLで 1.9秒 → 0.2秒)。どちらも任意のPythonオブジェクトは作らない
_YAML_LOADER = getattr(yaml, "CSafeLoader", yaml.SafeLoader)
def _yaml_leaves(node):
"""YAMLを読んだ値から文字列の葉だけを取り出す(キーはカテゴリ名なので除く。
yes/no 等が真偽値・数値に変換された葉はタグにならないので除く)"""
if isinstance(node, dict):
for v in node.values():
yield from _yaml_leaves(v)
elif isinstance(node, list):
for v in node:
yield from _yaml_leaves(v)
elif isinstance(node, str):
yield node
def _wildcard_yaml_texts(text: str):
"""ワイルドカードYAMLの項目。`- >-` 等のブロックスカラー(複数行)やエスケープもYAMLとして解釈する。
YAMLとして読めないファイルは、従来どおり "- " で始まる行を1項目として読む"""
try:
yield from _yaml_leaves(yaml.load(text, Loader=_YAML_LOADER))
except yaml.YAMLError:
for ln in text.splitlines():
s = ln.strip()
if s.startswith("- "):
yield s[2:].strip().strip("\"'")
def _upstream_texts(graph: dict, node_id: str, seen: set) -> list[str]:
"""API形式グラフで node_id から上流へたどり、プロンプト用の文字列入力を集める(negative側はたどらない)"""
if node_id in seen or node_id not in graph:
return []
seen.add(node_id)
out = []
for key, val in ((graph[node_id] or {}).get("inputs") or {}).items():
lk = key.lower()
if lk in _SKIP_INPUTS:
continue
if isinstance(val, str):
if lk in _TEXT_INPUTS and val.strip():
out.append(val.strip())
elif isinstance(val, list) and len(val) == 2 and isinstance(val[0], (str, int)):
out += _upstream_texts(graph, str(val[0]), seen)
return out
def positive_prompt(graph: dict) -> str:
"""API形式グラフの Positive プロンプト。サンプラー/ガイダーの positive(無ければ BasicGuider等の conditioning)から上流をたどる"""
if not isinstance(graph, dict) or "nodes" in graph:
return ""
texts = []
for node in graph.values():
ins = (node or {}).get("inputs") if isinstance(node, dict) else None
if not isinstance(ins, dict):
continue
link = ins.get("positive")
if not isinstance(link, list) and "negative" not in ins:
link = ins.get("conditioning") if "guider" in str(node.get("class_type", "")).lower() else None
if isinstance(link, list) and link:
texts += _upstream_texts(graph, str(link[0]), set())
return ", ".join(dict.fromkeys(texts))[:_PROMPT_MAX]
class TagSpaceService:
def __init__(self, data_dir: Path, gallery_service, semantic_service, tagger_service=None):
self.data_dir = data_dir
self.gallery = gallery_service
self.semantic = semantic_service
self.tagger = tagger_service
self._tag_file = data_dir / "tagspace_tags.npz"
self._space_file = data_dir / "tagspace_space.json"
self._mat_file = data_dir / "tagspace_space.npz"
self._prompt_file = data_dir / "tagspace_prompts.json" # Gallery画像の Positive {path: [size, mtime, text]}
self._tagger_file = data_dir / "tagspace_tagger.json" # Tagger補完 {path: [size, mtime, model, tags]}
self._lock = threading.RLock()
self._tag_cache: dict[str, np.ndarray] | None = None # tag -> 768次元(正規化済み)
self._space: dict | None = None # 3D表示用データ(JSON)
self._mat: dict | None = None # 近傍/検索用 {ids, vecs, kinds, mean_img, mean_txt, axes, scale}
self._job = self._idle_job()
self._cancel = threading.Event()
@staticmethod
def _idle_job() -> dict:
return {"running": False, "phase": "", "done": 0, "total": 0, "note": "", "error": "", "error_code": "",
"finished": False, "cancelled": False}
# ── 状態 ───────────────────────────────────────────────
def status(self) -> dict:
space = self._load_space()
meta = (space or {}).get("meta") or {}
return {"job": dict(self._job), "built": bool(space), "meta": meta, "tagger_models": self.tagger_models(),
"index": self.semantic.index_info(), "ollama": ollama.status(),
"semantic_job": self.semantic.job_status()}
def space(self) -> dict:
space = self._load_space()
if not space:
raise SemanticError("tagspace_not_built")
return space
def _load_space(self) -> dict | None:
with self._lock:
if self._space is None and self._space_file.exists():
try:
self._space = json.loads(self._space_file.read_text(encoding="utf-8"))
except Exception as e:
logger.warning("TagSpace: failed to load space: %s", e)
return self._space
def _load_mat(self) -> dict:
with self._lock:
if self._mat is None:
if not self._mat_file.exists():
raise SemanticError("tagspace_not_built")
with np.load(self._mat_file, allow_pickle=False) as z:
self._mat = {k: z[k] for k in z.files}
m = self._mat
m["ids"] = [str(x) for x in m["ids"]]
m["pos"] = {i: n for n, i in enumerate(m["ids"])}
m["bg_ids"] = [str(x) for x in m["bg_ids"]] if "bg_ids" in m else []
m["bg_pos"] = {i: n for n, i in enumerate(m["bg_ids"])}
# 中心化して正規化したブロック(カード/タグ/背景画像)。近傍・検索のたびに作り直さない
n_img = int(m["n_img"])
m["blocks"] = {
"card": (m["ids"][:n_img], self._centered(m["vecs"][:n_img], m["mean_img"])),
"tag": (m["ids"][n_img:], self._centered(m["vecs"][n_img:], m["mean_txt"])),
"image": (m["bg_ids"], self._centered(m["bg_vecs"], m["mean_img"]) if "bg_vecs" in m
else np.zeros((0, m["vecs"].shape[1]), np.float32)),
}
return self._mat
# ── 材料の収集 ─────────────────────────────────────────
def _cards(self) -> tuple[list[dict], list]:
"""ImagePromptの画像のうちプロンプトを持つもの。戻り値: (カード, スキャン結果)"""
root = self.gallery.get_image_prompt_root()
if not root:
return [], []
base = Path(root).resolve()
entries = [e for e in self.gallery._scan_folder_recursive(base) if Path(e[1]).suffix.lower() in _IMG_EXTS]
cards, used = [], []
for name, ap, size, mtime in entries:
prompt = self.gallery._read_sidecar_prompt(Path(ap))
if not prompt:
continue
rel = Path(ap).resolve().relative_to(base).parts[:-1]
folders = [p for p in rel if p.lower() not in _VAULT_THUMB_DIRS]
# tags: 詳細パネルでタグを選んで空間検索するための、プロンプトを分解したタグ(Gallery点の tags と同じ正規化)
cards.append({"id": ap, "kind": "card", "label": name.split(".")[0], "prompt": prompt.strip(),
"tags": list(dict.fromkeys(split_tags(prompt))),
"category": "/".join(folders[-2:]) or "(root)", "group": folders[0] if folders else "(root)"})
used.append((name, ap, size, mtime))
return cards, used
def _wildcard_texts(self):
folder = self.data_dir / "wildcard"
if not folder.is_dir():
return
for p in sorted(folder.rglob("*")):
if p.suffix.lower() == ".txt":
lines = p.read_text(encoding="utf-8", errors="replace").splitlines()
yield from (ln for ln in lines if ln.strip() and not ln.lstrip().startswith("#"))
elif p.suffix.lower() in (".yaml", ".yml"):
yield from _wildcard_yaml_texts(p.read_text(encoding="utf-8", errors="replace"))
def _tagger_texts(self):
db = self.data_dir / "tagger.db"
if not db.exists():
return
try:
with sqlite3.connect(f"file:{db}?mode=ro", uri=True) as conn:
for (text,) in conn.execute("SELECT all_tags FROM images"):
if text:
yield text
except sqlite3.Error as e:
logger.warning("TagSpace: tagger.db read failed: %s", e)
def _library_texts(self):
f = self.data_dir / "prompts.json"
try:
items = json.loads(f.read_text(encoding="utf-8")) if f.exists() else []
except Exception:
items = []
for it in items if isinstance(items, list) else []:
if isinstance(it, dict) and it.get("text"):
yield str(it["text"])
def tagger_models(self) -> list[str]:
"""Tagger補完に使えるモデル(ONNX)"""
if self.tagger is None:
return []
try:
return [m["name"] for m in self.tagger.list_models() if m.get("type") == "onnx"]
except Exception:
return []
def _tagger_fill(self, targets: list[tuple[str, int, float]], model: str) -> dict[str, str]:
"""targets([(path, size, mtime)])を Tagger でタグ付けする。同じ画像・同じモデルならキャッシュを使う。
中止しても、それまでの結果はキャッシュに残す。戻り値: {path: "tag, tag, ..."}"""
from PIL import Image
try:
cache = json.loads(self._tagger_file.read_text(encoding="utf-8")) if self._tagger_file.exists() else {}
except Exception as e:
logger.warning("TagSpace: failed to load tagger cache: %s", e)
cache = {}
job = self._job
job.update(phase="tagger", done=0, total=len(targets), note="")
out: dict[str, str] = {}
dirty = 0
was_loaded = model in getattr(self.tagger, "_cache", {})
def save():
tmp = self._tagger_file.with_suffix(".tmp.json")
tmp.write_text(json.dumps(cache, ensure_ascii=False), encoding="utf-8")
tmp.replace(self._tagger_file)
try:
for n, (path, size, mtime) in enumerate(targets):
if self._cancel.is_set():
break
hit = cache.get(path)
if hit and hit[0] == size and abs(hit[1] - mtime) < 1e-3 and hit[2] == model:
text = hit[3]
else:
try:
with Image.open(path) as im:
im.seek(0)
im = im.convert("RGBA") if im.mode in ("RGBA", "LA", "P") else im.convert("RGB")
im.thumbnail((_TAGGER_MAX_SIDE, _TAGGER_MAX_SIDE), Image.LANCZOS)
text = ", ".join(self.tagger.tag_image(im, model))
except RuntimeError as e: # モデルを読み込めない: 続けても全件失敗する
raise SemanticError("tagspace_tagger_model", str(e))
except Exception as e:
logger.warning("TagSpace: tagger failed for %s: %s", path, e)
text = ""
cache[path] = [size, mtime, model, text]
dirty += 1
if not job["note"]:
job["note"] = self.tagger.model_provider(model)
if dirty >= _TAGGER_SAVE_EVERY:
save()
dirty = 0
if text:
out[path] = text
job["done"] = n + 1
finally:
if dirty:
save()
if not was_loaded: # 補完のために読み込んだモデルはメモリから外す(Taggerタブで使用中のものは残す)
getattr(self.tagger, "_cache", {}).pop(model, None)
return out
def _gallery_prompts(self, exclude_prefix: str) -> dict[str, str]:
"""索引済み Gallery 画像の Positive プロンプト。(size, mtime)が同じならキャッシュを使う"""
try:
cache = json.loads(self._prompt_file.read_text(encoding="utf-8")) if self._prompt_file.exists() else {}
except Exception as e:
logger.warning("TagSpace: failed to load prompt cache: %s", e)
cache = {}
entries = [e for e in self.semantic.indexed_entries(exclude_prefix)
if Path(e[0]).suffix.lower() in _IMG_EXTS]
job = self._job
job.update(phase="prompts", done=0, total=len(entries))
new_cache, out = {}, {}
for n, (path, size, mtime) in enumerate(entries):
if self._cancel.is_set():
break
if not Path(path).is_file():
continue # 索引作成後に削除された画像(キャッシュにも残さない)
hit = cache.get(path)
if hit and hit[0] == size and abs(hit[1] - mtime) < 1e-3:
text = hit[2]
else:
try:
text = positive_prompt(self.gallery._extract_embedded_workflow(path, prefer="prompt"))
except Exception:
text = ""
new_cache[path] = [size, mtime, text]
if text:
out[path] = text
if n % 200 == 0:
job["done"] = n
job["done"] = len(entries)
if not self._cancel.is_set(): # 中止時は途中までの結果で既存のキャッシュを上書きしない
tmp = self._prompt_file.with_suffix(".tmp.json")
tmp.write_text(json.dumps(new_cache, ensure_ascii=False), encoding="utf-8")
tmp.replace(self._prompt_file)
return out
def collect_tags(self, cards: list[dict], max_tags: int, gallery_texts=(), tagger_texts=(),
min_count: int = 1, wildcard: bool = True) -> tuple[list[dict], int]:
"""全ソースのタグを数えて上位 max_tags 件を返す(max_tags=0 は全件、ただし ALL_TAGS_LIMIT まで)。
ソースごとに出現数の多い順に並べ、ソースを順番に1件ずつ取る(数の多いGalleryだけで埋まらないように)。
出現数は「そのタグを含む文の数」で数え、全出典の合計が min_count 未満のタグは候補から外す。
wildcard=False ならワイルドカードは材料にしない(ワイルドカードにしか無い語がタグの種類の大半を占めるため)。
戻り値: (タグ, 候補数)"""
per_src: dict[str, Counter] = {s: Counter() for s in SOURCES}
feeds = {"image_prompt": (c["prompt"] for c in cards), "gallery": iter(gallery_texts),
"tagger_auto": iter(tagger_texts), "tagger": self._tagger_texts(), "prompt_library": self._library_texts(),
"wildcard": self._wildcard_texts() if wildcard else iter(())}
for src, texts in feeds.items():
for text in texts:
per_src[src].update(set(split_tags(text)))
total = Counter()
for c in per_src.values():
total.update(c)
ok = {t for t, n in total.items() if n >= min_count}
if not max_tags:
max_tags = ALL_TAGS_LIMIT
queues = {s: sorted((t for t in c if t in ok), key=lambda t, c=c: (-c[t], t)) for s, c in per_src.items()}
queues = {s: q for s, q in queues.items() if q}
picked: list[str] = []
seen: set = set()
pos = dict.fromkeys(queues, 0)
while len(picked) < max_tags and queues:
for src in list(queues):
q, i = queues[src], pos[src]
while i < len(q) and q[i] in seen:
i += 1
if i >= len(q):
del queues[src]
continue
pos[src] = i + 1
seen.add(q[i])
picked.append(q[i])
if len(picked) >= max_tags:
break
return [{"id": f"tag:{t}", "kind": "tag", "label": t,
"count": total[t],
"sources": [s for s in SOURCES if per_src[s][t]]} for t in picked], len(ok)
# ── タグベクトルのキャッシュ ───────────────────────────
def _tag_vectors(self) -> dict[str, np.ndarray]:
with self._lock:
if self._tag_cache is None:
self._tag_cache = {}
if self._tag_file.exists():
try:
with np.load(self._tag_file, allow_pickle=False) as z:
self._tag_cache = dict(zip((str(t) for t in z["tags"]), z["vecs"]))
except Exception as e:
logger.warning("TagSpace: failed to load tag cache: %s", e)
return self._tag_cache
def _save_tag_vectors(self) -> None:
with self._lock:
cache = self._tag_cache or {}
if not cache:
return
tags = list(cache)
tmp = self._tag_file.with_suffix(".tmp.npz")
np.savez(tmp, tags=np.array(tags), vecs=np.stack([cache[t] for t in tags]).astype(np.float32))
tmp.replace(self._tag_file)
# ── 構築ジョブ ─────────────────────────────────────────
def start_build(self, max_tags: int, bg: int, tagger_model: str = "", tagger_scope: str = "background",
min_count: int = 1, wildcard: bool = True) -> None:
"""max_tags=0 は全タグ(ALL_TAGS_LIMIT まで)"""
if tagger_model and tagger_model not in self.tagger_models():
raise SemanticError("tagspace_tagger_model", tagger_model)
if tagger_scope not in TAGGER_SCOPES:
tagger_scope = TAGGER_SCOPES[0]
with self._lock:
if self._job["running"]:
raise SemanticError("already_running")
info = self.semantic.index_info()
if info["count"] and info["model"] != LOCAL_MODEL:
raise SemanticError("tagspace_index_model", info["model"])
st = ollama.status()
if not st["reachable"]:
raise SemanticError("ollama_unreachable", f"{st['url']}: {st['error']}")
if not st["ready"]:
raise SemanticError("ollama_model_missing", st["tag"])
self._cancel.clear()
self._job = self._idle_job()
self._job.update(running=True, phase="cards")
max_tags = 0 if int(max_tags) == 0 else max(50, min(int(max_tags), MAX_TAGS_LIMIT))
args = (max_tags, max(0, min(int(bg), BG_LIMIT)), tagger_model, tagger_scope,
max(1, min(int(min_count), MIN_COUNT_LIMIT)), bool(wildcard))
threading.Thread(target=self._run_build, args=args, daemon=True).start()
def cancel(self) -> None:
self._cancel.set()
if self._job.get("phase") == "index":
self.semantic.cancel()
def _run_build(self, max_tags: int, bg: int, tagger_model: str = "", tagger_scope: str = "background",
min_count: int = 1, wildcard: bool = True) -> None:
job = self._job
try:
cards, entries = self._cards()
root = self.gallery.get_image_prompt_root() or ""
# 1. カード画像を Gallery 索引に追加(未索引/更新分のみ)
if entries and not self._cancel.is_set():
job.update(phase="index", done=0, total=0)
info = self.semantic.index_info()
dim = info["dim"] or ollama.DEFAULT_LOCAL_DIM
self.semantic.start_index(root, True, "missing", LOCAL_MODEL, dim)
while True:
sj = self.semantic.job_status()
job.update(done=sj["done"] + sj["failed"], total=sj["total"])
if not sj["running"]:
break
time.sleep(0.5)
if sj.get("error_code") in ("ollama_unreachable", "ollama_model_missing"):
raise SemanticError(sj["error_code"], sj["error"])
card_vecs = self.semantic.vectors_for(entries)
cards = [c for c in cards if c["id"] in card_vecs]
dim = self.semantic.index_info()["dim"] or ollama.DEFAULT_LOCAL_DIM
# 2. Gallery 画像の Positive プロンプト(タグの材料と、背景点のタグ)
prefix = Path(root).resolve().as_posix().rstrip("/") + "/" if root else ""
gallery_prompts = self._gallery_prompts(prefix)
if self._cancel.is_set():
return
# 3. 背景の Gallery 画像(Tagger補完の対象を決めるため、タグ集めより先に選ぶ)
bg_paths, bg_mat = self.semantic.sample_vectors(bg + bg // 4, exclude_prefix=prefix) if bg else ([], None)
if bg_paths: # 索引作成後に削除された画像を除く(多めに取って bg 件に詰める)
keep = [i for i, p in enumerate(bg_paths) if Path(p).is_file()][:bg]
bg_paths, bg_mat = [bg_paths[i] for i in keep], bg_mat[keep]
# 4. Tagger補完: プロンプト由来のタグが無い画像
tagger_tags: dict[str, str] = {}
if tagger_model:
stamps = {p: (sz, mt) for p, sz, mt in self.semantic.indexed_entries(prefix)}
pool = bg_paths if tagger_scope == "background" else [
p for p in stamps if Path(p).suffix.lower() in _IMG_EXTS and Path(p).is_file()]
targets = [(p, *stamps[p]) for p in pool
if p in stamps and Path(p).suffix.lower() in _IMG_EXTS
and not split_tags(gallery_prompts.get(p, ""))]
tagger_tags = self._tagger_fill(targets, tagger_model)
if self._cancel.is_set():
return
# 5. タグを集めて未キャッシュ分を埋め込む
job.update(phase="tags", done=0, total=0, note="")
tags, available = self.collect_tags(cards, max_tags, gallery_prompts.values(), tagger_tags.values(),
min_count, wildcard)
cache = self._tag_vectors()
todo = [t["label"] for t in tags if t["label"] not in cache]
job.update(total=len(todo))
for i in range(0, len(todo), _EMBED_BATCH):
if self._cancel.is_set():
break
batch = todo[i:i + _EMBED_BATCH]
try:
vecs = ollama.embed_texts(batch, ollama.DEFAULT_LOCAL_DIM)
except ollama.OllamaError as e:
raise SemanticError(e.code, str(e))
with self._lock:
cache.update(zip(batch, vecs))
job["done"] = min(len(todo), i + len(batch))
if (i // _EMBED_BATCH) % 20 == 19:
self._save_tag_vectors()
self._save_tag_vectors()
tags = [t for t in tags if t["label"] in cache]
if self._cancel.is_set():
return
# 6. 投影
job.update(phase="project", done=0, total=0)
self._project(cards, card_vecs, tags, cache, dim, bg_paths, bg_mat, gallery_prompts, tagger_tags,
tagger_model if tagger_tags else "",
{"max_tags": max_tags, "min_count": min_count, "wildcard": wildcard, "tags_available": available})
except SemanticError as e:
job["error_code"], job["error"] = e.code, str(e)
except Exception as e:
logger.exception("TagSpace: build failed")
job["error_code"], job["error"] = "tagspace_error", str(e)
finally:
ollama.release()
job["running"] = False
job["finished"] = True
job["cancelled"] = self._cancel.is_set() and not job["error_code"]
job["phase"] = ""
@staticmethod
def _unit(m: np.ndarray, dim: int) -> np.ndarray:
m = m[:, :dim].astype(np.float32)
n = np.linalg.norm(m, axis=1, keepdims=True)
return m / np.where(n > 0, n, 1)
def _project(self, cards, card_vecs, tags, cache, dim, bg_paths, bg_mat, gallery_prompts=None,
tagger_tags=None, tagger_model: str = "", tag_meta: dict | None = None) -> None:
img = self._unit(np.stack([card_vecs[c["id"]] for c in cards]), dim) if cards else np.zeros((0, dim), np.float32)
txt = self._unit(np.stack([cache[t["label"]] for t in tags]), dim) if tags else np.zeros((0, dim), np.float32)
if len(img) + len(txt) < 3:
raise SemanticError("tagspace_too_few")
bg_u = self._unit(bg_mat, dim) if bg_mat is not None and len(bg_mat) else np.zeros((0, dim), np.float32)
# modality gap 対策: 画像とテキスト(タグ)をそれぞれの平均で中心化する。
# 画像側はカードの平均を使う(数の多い背景画像の平均だとカードがタグの塊から離れて見えるため)
img_ref = img if len(img) else bg_u
mean_img = img_ref.mean(axis=0) if len(img_ref) else np.zeros(dim, np.float32)
mean_txt = txt.mean(axis=0) if len(txt) else np.zeros(dim, np.float32)
x = np.concatenate([img - mean_img, txt - mean_txt])
_, s, vt = np.linalg.svd(x, full_matrices=False)
axes = vt[:3].astype(np.float32)
var = (s ** 2) / max(float((s ** 2).sum()), 1e-12)
pts = x @ axes.T
r98 = float(np.percentile(np.linalg.norm(pts, axis=1), 98)) or 1.0
scale = _RADIUS / r98
def xyz(m):
return [[round(float(v), 3) for v in row] for row in (m @ axes.T * scale)]
n_img = len(img)
for c, p in zip(cards, xyz(img - mean_img)):
c["xyz"] = p
for t, p in zip(tags, xyz(txt - mean_txt)):
t["xyz"] = p
gp, tt = gallery_prompts or {}, tagger_tags or {}
def bg_item(path, pos):
"""背景点にはその画像のタグを持たせる(クリックでまとめて追加)。プロンプト由来が無ければTagger補完"""
tags_p = list(dict.fromkeys(split_tags(gp.get(path, ""))))
if tags_p:
return {"id": path, "xyz": pos, "tags": tags_p, "tag_src": "prompt"}
tags_t = list(dict.fromkeys(split_tags(tt.get(path, ""))))
return {"id": path, "xyz": pos, "tags": tags_t, "tag_src": "tagger" if tags_t else ""}
bg_items = [bg_item(p, q) for p, q in zip(bg_paths, xyz(bg_u - mean_img))] if len(bg_u) else []
meta = {"built_at": time.strftime("%Y-%m-%d %H:%M:%S"), "cards": len(cards), "tags": len(tags),
"background": len(bg_items), "gallery_prompts": len(gp), "tagger_images": len(tt),
"tagger_model": tagger_model, "dim": dim, "model": LOCAL_MODEL,
"explained": [round(float(v), 4) for v in var[:3]], **(tag_meta or {})}
space = {"meta": meta, "cards": cards, "tags": tags, "background": bg_items}
ids = [c["id"] for c in cards] + [t["id"] for t in tags]
tmp = self._mat_file.with_suffix(".tmp.npz")
np.savez(tmp, ids=np.array(ids), vecs=np.concatenate([img, txt]).astype(np.float32),
n_img=np.array(n_img), mean_img=mean_img.astype(np.float32), mean_txt=mean_txt.astype(np.float32),
axes=axes, scale=np.array(scale, dtype=np.float32),
bg_ids=np.array([b["id"] for b in bg_items]), bg_vecs=bg_u.astype(np.float32))
tmp.replace(self._mat_file)
tmp_json = self._space_file.with_suffix(".tmp.json")
tmp_json.write_text(json.dumps(space, ensure_ascii=False), encoding="utf-8")
tmp_json.replace(self._space_file)
with self._lock:
self._space, self._mat = space, None
# ── 近傍・検索 ─────────────────────────────────────────
@staticmethod
def _centered(vecs: np.ndarray, mean: np.ndarray) -> np.ndarray:
c = vecs - mean
return c / np.maximum(np.linalg.norm(c, axis=1, keepdims=True), 1e-6)
def _rank(self, m: dict, q: np.ndarray, k: int, exclude: str = "", kind: str = "") -> list[dict]:
"""カード・タグ・画像は別々の塊なので、それぞれの平均を引いた空間で比べる(=中心化コサイン)。
同じ種類どうしの方がスコアが高く出るため、種類ごとに順位付けして交互に並べる。
Gallery画像(背景点)を候補に入れるのは、Gallery画像を基準にしたときだけ。"""
qc = q - (m["mean_txt"] if kind == "tag" else m["mean_img"])
qn = qc / max(float(np.linalg.norm(qc)), 1e-6)
order = {"tag": ("tag", "card"), "card": ("card", "tag"), "image": ("image", "tag", "card")}[kind or "card"]
lists = []
for name in order:
ids, mat = m["blocks"][name]
if not len(ids):
lists.append([])
continue
scores = mat @ qn
top = np.argsort(-scores)[:k + 1]
lists.append([{"id": ids[i], "score": round(float(scores[i]), 4)} for i in top if ids[i] != exclude][:k])
out = []
for i in range(k):
out += [lst[i] for lst in lists if i < len(lst)]
if len(out) >= k:
break
return out[:k]
def neighbors(self, item_id: str, k: int) -> list[dict]:
m = self._load_mat()
i = m["pos"].get(item_id)
if i is not None:
kind = "card" if i < int(m["n_img"]) else "tag"
return self._rank(m, m["vecs"][i], k, exclude=item_id, kind=kind)
j = m["bg_pos"].get(item_id)
if j is not None:
return self._rank(m, m["bg_vecs"][j], k, exclude=item_id, kind="image")
raise SemanticError("tagspace_unknown_item", item_id)
def search(self, query: str, k: int) -> dict:
query = (query or "").strip()[:500]
if not query:
return {"probe": None, "matches": []}
m = self._load_mat()
dim = m["vecs"].shape[1]
try:
q = ollama.embed_text(query, ollama.DEFAULT_LOCAL_DIM)
except ollama.OllamaError as e:
raise SemanticError(e.code, str(e))
q = self._unit(q[None, :], dim)[0]
p = (q - m["mean_txt"]) @ m["axes"].T * float(m["scale"])
return {"probe": [round(float(v), 3) for v in p], "matches": self._rank(m, q, k, kind="tag")}
+2 -1
View File
@@ -99,7 +99,7 @@ class WorkflowStudio:
app.router.add_get("/wfm", serve_index_page)
# API routes
from .routes import workflow_routes, settings_routes, ollama_routes, unsloth_routes, eagle_routes, nodes_routes, prompts_routes, models_routes, gallery_routes, wildcard_routes, tagger_routes, gmic_routes, skill_routes, lab_routes, video_routes, vram_routes, partner_routes
from .routes import workflow_routes, settings_routes, ollama_routes, unsloth_routes, eagle_routes, nodes_routes, prompts_routes, models_routes, gallery_routes, wildcard_routes, tagger_routes, gmic_routes, skill_routes, lab_routes, video_routes, vram_routes, partner_routes, tagspace_routes
workflow_routes.setup_routes(app)
settings_routes.setup_routes(app)
@@ -118,5 +118,6 @@ class WorkflowStudio:
lab_routes.setup_routes(app)
video_routes.setup_routes(app)
vram_routes.setup_routes(app)
tagspace_routes.setup_routes(app)
logger.info("Workflow Studio: Routes registered successfully")
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-workflow-studio"
description = "A comprehensive workflow, asset management, and generation UI plugin for ComfyUI. Manage workflows, models, images, and prompts; batch generation and Image Feeder in the GenerateUI tab; library side panel with canvas drag & drop and AI tools."
version = "0.8.10"
version = "0.9.2"
license = { file = "LICENSE" }
requires-python = ">= 3.10"
dependencies = ["jinja2"]
+3 -9
View File
@@ -34,12 +34,6 @@ psd-tools>=1.10
# (Gallery itself keeps working). Not pinned here on purpose — see torch note above.
# av>=17.0.0
# -- Gallery Semantic Search: local EmbeddingGemma 2 (optional) --
# Uses onnxruntime (above) + tokenizers + huggingface_hub (both normally pre-installed with ComfyUI's
# transformers). The model (~300 MB, q4) is downloaded to the data folder on first use.
# GPU (NVIDIA/CUDA): replace onnxruntime with onnxruntime-gpu
# pip uninstall onnxruntime onnxruntime-gpu
# pip install onnxruntime-gpu
# Local EmbeddingGemma 2 then indexes ~45x faster than on the CPU. DirectML is not supported.
# tokenizers
# huggingface_hub
# -- Gallery Semantic Search: EmbeddingGemma 2 (optional) --
# Runs in Ollama (no extra Python packages). Install Ollama and download the model:
# ollama pull embeddinggemma-2:740m (or embeddinggemma-2:440m - same vectors, no audio encoder)
+1
View File
@@ -1151,6 +1151,7 @@
.wfm-sem-pane { display: flex; flex-direction: column; gap: 10px; min-height: 230px; }
.wfm-sem-footer { justify-content: flex-end; border-top: 1px solid var(--wfm-border, #444); padding-top: 10px; }
.wfm-sem-num { width: 80px; }
.wfm-sem-url { width: 240px; max-width: 100%; }
.wfm-sem-danger { margin-left: auto; color: #ef4444; }
.wfm-sem-row .wfm-select { width: auto; min-width: 90px; }
+97
View File
@@ -984,6 +984,103 @@ body {
min-height: 0;
}
/* Input tab: Prompt (3) | Image (2) side by side. Wraps Image under Prompt when the column is narrow. */
.wfm-gen-params-col--input {
container-type: inline-size;
container-name: wfm-input;
min-width: 0;
}
.wfm-input-split {
display: flex;
flex: 1;
min-height: 0;
}
.wfm-input-inner-panel--prompt {
flex: 3 1 0;
min-width: 0;
border-right: 1px solid var(--wfm-border);
}
.wfm-input-inner-panel--image {
flex: 2 1 0;
min-width: 0;
}
.wfm-input-panel-title {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--wfm-text-secondary);
margin-bottom: 6px;
}
@container wfm-input (max-width: 720px) {
.wfm-input-split {
flex-direction: column;
overflow-y: auto;
}
.wfm-input-inner-panel--prompt,
.wfm-input-inner-panel--image {
flex: none;
overflow-y: visible;
border-right: none;
}
.wfm-input-inner-panel--prompt {
border-bottom: 1px solid var(--wfm-border);
}
}
/* Input tab Raw JSON: collapsible to a slim strip at the right edge */
.wfm-rawjson-collapse-btn {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
padding: 3px 10px;
background: var(--wfm-bg-secondary);
border: none;
border-bottom: 1px solid var(--wfm-border);
color: var(--wfm-text-secondary);
font-size: 11px;
cursor: pointer;
text-align: left;
}
.wfm-rawjson-collapse-btn:hover {
color: var(--wfm-text);
}
.wfm-rawjson-collapse-label {
display: none;
}
.wfm-gen-rawjson-col.wfm-gen-rawjson-col--collapsed {
width: 30px;
}
.wfm-gen-rawjson-col--collapsed .wfm-rawjson-collapse-btn {
flex: 1;
flex-direction: column;
justify-content: flex-start;
padding: 8px 0;
border-bottom: none;
border-left: 1px solid var(--wfm-border);
background: var(--wfm-bg-secondary);
}
.wfm-gen-rawjson-col--collapsed .wfm-rawjson-collapse-label {
display: block;
writing-mode: vertical-rl;
letter-spacing: 1px;
}
.wfm-gen-rawjson-col--collapsed #wfm-gen-rawjson-widget {
display: none !important;
}
/* Right sub-column: Raw JSON */
.wfm-gen-rawjson-col {
width: 540px;
+67
View File
@@ -0,0 +1,67 @@
/* TagSpace タブ */
#wfm-tab-tagspace.active { overflow: hidden; }
.wfm-ts { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.wfm-ts-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--wfm-border, #444); }
.wfm-ts-num { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--wfm-text-secondary, #aaa); }
.wfm-ts-num input { width: 72px; }
.wfm-ts-sep { width: 1px; height: 18px; background: var(--wfm-border, #444); }
.wfm-ts-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }
.wfm-ts-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; }
.wfm-ts-legend { display: inline-flex; gap: 10px; font-size: 11px; color: var(--wfm-text-secondary, #aaa); }
.wfm-ts-search { margin-left: auto; width: 240px; max-width: 100%; }
.wfm-ts-status { padding: 4px 12px; font-size: 12px; color: var(--wfm-text-secondary, #aaa); min-height: 22px; }
.wfm-ts-status-error { color: var(--wfm-danger, #ef4444); }
.wfm-ts-main { flex: 1; display: flex; min-height: 0; }
.wfm-ts-view { position: relative; flex: 1; min-width: 0; overflow: hidden; background: var(--wfm-bg, #111); }
.wfm-ts-view canvas { display: block; width: 100%; height: 100%; }
.wfm-ts-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wfm-ts-label { position: absolute; left: 0; top: 0; margin: -22px 0 0 6px; padding: 1px 6px; border-radius: 4px; font-size: 11px; white-space: nowrap; background: rgba(0, 0, 0, 0.6); color: #fff; }
.wfm-ts-label-chip { background: var(--wfm-primary, #6366f1); }
.wfm-ts-label-near { background: rgba(8, 145, 178, 0.85); }
.wfm-ts-label-hover { background: rgba(255, 255, 255, 0.92); color: #111; }
.wfm-ts-tooltip { position: absolute; z-index: 2; display: flex; gap: 8px; max-width: 360px; padding: 6px 8px; border-radius: 6px; font-size: 12px; pointer-events: none; background: var(--wfm-surface, #222); border: 1px solid var(--wfm-border, #444); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.wfm-ts-tooltip img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; }
.wfm-ts-tip-body { margin-top: 2px; color: var(--wfm-text-secondary, #aaa); }
.wfm-ts-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--wfm-text-secondary, #aaa); pointer-events: none; }
.wfm-ts-hint { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: var(--wfm-text-secondary, #aaa); opacity: 0.8; pointer-events: none; }
.wfm-ts-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px; overflow: hidden; border-left: 1px solid var(--wfm-border, #444); }
/* プロンプト列(右端): チップは中身の高さ(最大40%)、出力欄が残りの高さいっぱいに伸びる */
.wfm-ts-side-prompt .wfm-ts-chips { flex: 0 1 auto; max-height: 40%; align-content: flex-start; }
.wfm-ts-side-prompt .wfm-ts-output { flex: 1; min-height: 120px; resize: none; }
.wfm-ts-panel { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--wfm-border, #444); border-radius: var(--wfm-radius, 6px); background: var(--wfm-surface, transparent); min-height: 0; }
.wfm-ts-panel h4 { margin: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfm-ts-panel-grow { flex: 1; }
.wfm-ts-muted { color: var(--wfm-text-secondary, #aaa); font-size: 11px; }
.wfm-ts-detail { display: flex; flex-direction: column; gap: 4px; font-size: 12px; max-height: 260px; overflow: auto; }
.wfm-ts-detail-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding-bottom: 2px; background: var(--wfm-surface, #222); }
.wfm-ts-detail-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfm-ts-detail-head .wfm-btn { flex: none; }
.wfm-ts-detail-thumb { max-width: 100%; max-height: 140px; object-fit: contain; align-self: flex-start; border-radius: 4px; }
.wfm-ts-detail-text { white-space: pre-wrap; word-break: break-word; }
.wfm-ts-pick-list { display: flex; flex-wrap: wrap; gap: 3px; }
.wfm-ts-full summary { cursor: pointer; color: var(--wfm-text-secondary, #999); font-size: 11px; }
.wfm-ts-pick { padding: 1px 7px; border-radius: 10px; font-size: 11px; cursor: pointer; color: inherit; background: var(--wfm-bg-secondary, #333); border: 1px solid var(--wfm-border, #444); }
.wfm-ts-pick:hover { border-color: #f472b6; }
.wfm-ts-pick.on { background: #f472b6; border-color: #f472b6; color: #1a1a1a; }
/* タグが多くても検索ボタンが見えるよう、詳細パネルの下端に固定する */
.wfm-ts-pick-actions { position: sticky; bottom: 0; order: 10; display: flex; gap: 6px; padding-top: 4px; background: var(--wfm-surface, #222); }
.wfm-ts-path { word-break: break-all; }
.wfm-ts-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.wfm-ts-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.wfm-ts-row:hover { background: var(--wfm-surface-hover, rgba(255, 255, 255, 0.06)); }
.wfm-ts-row img { width: 28px; height: 28px; object-fit: cover; border-radius: 3px; flex: none; }
.wfm-ts-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 9px; }
.wfm-ts-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfm-ts-row-add { flex: none; width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--wfm-border, #444); background: transparent; color: var(--wfm-text, #ddd); cursor: pointer; }
.wfm-ts-row-add.on { background: var(--wfm-primary, #6366f1); color: #fff; border-color: transparent; }
.wfm-ts-row-add-none { flex: none; width: 22px; }
.wfm-ts-row img.wfm-ts-row-image { border-radius: 50%; }
.wfm-ts-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 110px; overflow: auto; }
.wfm-ts-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 7px; border-radius: 10px; font-size: 11px; background: var(--wfm-bg-secondary, #333); border: 1px solid var(--wfm-border, #444); }
.wfm-ts-chip-card { border-color: var(--wfm-primary, #6366f1); }
.wfm-ts-chip-image { border-color: #f472b6; }
.wfm-ts-chip button { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; font-size: 12px; }
.wfm-ts-output { width: 100%; resize: vertical; font-size: 12px; box-sizing: border-box; }
.wfm-ts-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wfm-ts-zoom { position: fixed; z-index: 1000; width: 360px; height: 360px; display: flex; align-items: center; justify-content: center; padding: 4px; box-sizing: border-box; pointer-events: none; border-radius: 8px; background: var(--wfm-surface, #222); border: 1px solid var(--wfm-border, #444); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55); }
.wfm-ts-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
+5 -2
View File
@@ -112,7 +112,7 @@ function initTabs() {
function applyI18nToHtml() {
// Tab labels
const tabMap = { workflow: "tabWorkflow", nodes: "tabNodes", models: "tabModels", generate: "tabGenerate", prompt: "tabPrompt", gallery: "tabGallery", "image-edit": "tabImageEdit", video: "tabVideo", settings: "tabSettings", help: "tabHelp", ai: "tabAi", tagger: "tabTagger" };
const tabMap = { workflow: "tabWorkflow", nodes: "tabNodes", models: "tabModels", generate: "tabGenerate", prompt: "tabPrompt", gallery: "tabGallery", "image-edit": "tabImageEdit", video: "tabVideo", settings: "tabSettings", help: "tabHelp", ai: "tabAi", tagger: "tabTagger", tagspace: "tabTagSpace" };
document.querySelectorAll(".wfm-tab").forEach((tab) => {
const key = tabMap[tab.dataset.tab];
if (key) tab.textContent = t(key);
@@ -588,10 +588,11 @@ function applyI18nToHtml() {
"wfm-help-gallery-26": "helpGallery26",
"wfm-help-gallery-28": "helpGallery28", "wfm-help-gallery-29": "helpGallery29",
"wfm-help-gallery-30": "helpGallery30", "wfm-help-gallery-31": "helpGallery31",
"wfm-help-gallery-32": "helpGallery32", "wfm-help-gallery-33": "helpGallery33", "wfm-help-gallery-34": "helpGallery34", "wfm-help-gallery-35": "helpGallery35", "wfm-help-gallery-36": "helpGallery36",
"wfm-help-gallery-32": "helpGallery32", "wfm-help-gallery-33": "helpGallery33", "wfm-help-gallery-34": "helpGallery34", "wfm-help-gallery-35": "helpGallery35", "wfm-help-gallery-36": "helpGallery36", "wfm-help-gallery-37": "helpGallery37",
"wfm-help-gallery-card-styleprompt-title": "helpGalleryCardStyleprompt",
"wfm-help-gallery-card-stylecatalog-title": "helpGalleryCardStylecatalog",
"wfm-help-tagger-title": "helpTaggerTitle",
"wfm-help-tagspace-title": "helpTagSpaceTitle", "wfm-help-tagspace-card-overview-title": "helpTagSpaceCardOverview", "wfm-help-tagspace-card-use-title": "helpTagSpaceCardUse", "wfm-help-tagspace-1": "helpTagSpace1", "wfm-help-tagspace-2": "helpTagSpace2", "wfm-help-tagspace-3": "helpTagSpace3", "wfm-help-tagspace-4": "helpTagSpace4", "wfm-help-tagspace-5": "helpTagSpace5", "wfm-help-tagspace-6": "helpTagSpace6", "wfm-help-tagspace-7": "helpTagSpace7", "wfm-help-tagspace-8": "helpTagSpace8", "wfm-help-tagspace-9": "helpTagSpace9", "wfm-help-tagspace-10": "helpTagSpace10",
"wfm-help-tagger-1": "helpTagger1", "wfm-help-tagger-2": "helpTagger2",
"wfm-help-tagger-3": "helpTagger3", "wfm-help-tagger-4": "helpTagger4",
"wfm-help-tagger-5": "helpTagger5", "wfm-help-tagger-6": "helpTagger6",
@@ -845,6 +846,7 @@ import { initGalleryTab } from "./gallery-tab.js";
import { initMetadataTab } from "./metadata-tab.js";
import { initAiTab } from "./ai-tab.js";
import { initTaggerTab } from "./tagger-tab.js";
import { initTagSpaceTab } from "./tagspace-tab.js";
import { imageEditTab } from "./image-edit-tab.js";
import { initVideoTab } from "./video-tab.js";
@@ -897,6 +899,7 @@ document.addEventListener("DOMContentLoaded", () => {
initGalleryTab();
initAiTab();
initTaggerTab();
initTagSpaceTab();
imageEditTab.init();
initVideoTab();
+24 -7
View File
@@ -2,6 +2,11 @@
* ComfyUI Workflow - Format detection, conversion, and analysis
*/
// Video all-in-one nodes (MiniMaxH3ImageToVideo, MiniMaxH3ReferenceToVideo, ...): hold their own
// "prompt" and build the conditioning + latent themselves. Matched by class-name pattern so other
// models sharing this shape work without a code change.
const VIDEO_ALL_IN_ONE_RE = /ImageToVideo|TextToVideo|ReferenceToVideo/;
// Cache for /object_info (loaded once, shared)
let _objectInfoCache = null;
@@ -1141,6 +1146,12 @@ export const comfyWorkflow = {
if (Array.isArray(inputs.positive)) samplerPositiveRef[inputs.positive[0]] = true;
if (Array.isArray(inputs.negative)) samplerNegativeRef[inputs.negative[0]] = true;
}
// Video all-in-one nodes whose "prompt" is wired from a separate text node (FastH3
// OmniRef's MiniMaxH3ReferenceToVideo <- PrimitiveStringMultiline) — always positive
// (no negative counterpart), so seed the role on the source directly.
if (VIDEO_ALL_IN_ONE_RE.test(ct) && Array.isArray(inputs.prompt)) {
samplerPositiveRef[inputs.prompt[0]] = true;
}
}
// === Pass 1b: Expand refs through CONDITIONING graph (BFS, 5 iterations) ===
@@ -1259,7 +1270,9 @@ export const comfyWorkflow = {
// TextEncodeQwenImage21 — fixed roles (the node feeds both guider inputs): a linked
// "prompt" (prompt-enhancer switch chain, Qwen Image 2.1 Turbo) is the positive text,
// a linked "negative_prompt" the negative.
if (ct === "TextEncodeQwenImage21") {
// TextEncodeFibo2 (Fibo 2.0 Edit) has the same shape, its prompt arriving via a
// PreviewAny -> prompt-enhancer switch chain.
if (ct === "TextEncodeQwenImage21" || ct === "TextEncodeFibo2") {
if (Array.isArray(inputs.prompt)) samplerPositiveRef[inputs.prompt[0]] = true;
if (Array.isArray(inputs.negative_prompt)) samplerNegativeRef[inputs.negative_prompt[0]] = true;
}
@@ -1504,7 +1517,9 @@ export const comfyWorkflow = {
// with no images connected the node behaves as pure T2I). The reference images
// themselves need no special handling here — they arrive as ordinary LoadImage
// nodes already picked up generically by the load_image_nodes pass below.
if (ct === "TextEncodeQwenImage21") {
// TextEncodeFibo2 (Fibo 2.0) — same prompt/negative_prompt/images.image_N shape; its
// negative_prompt is a structured VGL JSON caption (edited as plain text here).
if (ct === "TextEncodeQwenImage21" || ct === "TextEncodeFibo2") {
if (typeof inputs.prompt === "string") {
result.prompt_nodes.push({
id, type: ct, title: `${title} [positive]`, role: "positive",
@@ -1612,11 +1627,11 @@ export const comfyWorkflow = {
// Video all-in-one nodes (e.g. MiniMaxH3ImageToVideo) — hold their own "prompt"
// widget directly instead of going through a separate CLIPTextEncode, and have
// no negative counterpart. Matched generically by class name (ImageToVideo /
// TextToVideo) rather than a fixed list so future models sharing this pattern
// no negative counterpart. Matched generically by class name (VIDEO_ALL_IN_ONE_RE)
// rather than a fixed list so future models sharing this pattern
// (WAN, HunyuanVideo, etc.) work without a code change — same detection metadata-tab.js
// and node_sets_menu.js already use for prompt extraction (see extractPromptsAPI).
if ((ct.includes("ImageToVideo") || ct.includes("TextToVideo")) && typeof inputs.prompt === "string") {
if (VIDEO_ALL_IN_ONE_RE.test(ct) && typeof inputs.prompt === "string") {
result.prompt_nodes.push({
id, type: ct, title, role: "positive",
text: inputs.prompt, textKey: "prompt",
@@ -1686,7 +1701,8 @@ export const comfyWorkflow = {
// width/height are commonly wired to a ResolutionSelector-style helper node
// (array link ref) rather than a direct number — leave those as undefined so
// the settings-tab UI falls back to its default instead of rendering a link ref.
if (ct === "TextEncodeMageFlowEdit") {
// TextEncodeFibo2 likewise (0 = Fibo 2.0's trained size for the first image's aspect).
if (ct === "TextEncodeMageFlowEdit" || ct === "TextEncodeFibo2") {
result.latent_nodes.push({
id, type: ct, title,
width: typeof inputs.width === "number" ? inputs.width : undefined,
@@ -1864,7 +1880,7 @@ export const comfyWorkflow = {
// generation timeout (video generation runs far longer than a still image) — see
// generate-tab.js _coreGenerate and lab-tab.js _runLabBatch.
isVideoWorkflow(analysis) {
if ((analysis?.prompt_nodes || []).some((n) => /ImageToVideo|TextToVideo/.test(n.type))) return true;
if ((analysis?.prompt_nodes || []).some((n) => VIDEO_ALL_IN_ONE_RE.test(n.type))) return true;
// LTX-2.5/Wan2.2: no all-in-one *ToVideo node — detected instead via their
// EmptyHunyuanLatentVideo/EmptyLTXVLatentVideo latent node (see analyzeWorkflow)
// or a SaveVideo/CreateVideo node anywhere in the flattened graph.
@@ -1959,6 +1975,7 @@ function _getWidgetMapping(nodeType) {
ImpactWildcardEncode: ["wildcard_text"],
WFS_PromptText: ["positive", "negative"],
TextEncodeQwenImage21: ["prompt", "negative_prompt", "resolution"],
TextEncodeFibo2: ["prompt", "negative_prompt", "width", "height", "batch_size"],
TextEncodeMingImageEdit: ["prompt"],
EmptyQwenImageLayeredLatentImage: ["width", "height", "layers", "batch_size"],
};
+50 -59
View File
@@ -1,5 +1,5 @@
/**
* Gallery Tab - セマンティック検索 (Gemini Embedding 2)
* Gallery Tab - セマンティック検索 (Gemini Embedding 2 / Ollama の EmbeddingGemma 2)
* - 検索ボックスのSemantic Searchトグル(ONでEnter実行の意味検索)
* - 詳細パネルの「類似画像」トグル/更新ボタン
* - インデックス作成モーダル(Semantic⚙)
@@ -19,18 +19,20 @@ const API = {
clear: "/wfm/gallery/semantic/clear",
folders: (root) => `/wfm/gallery/semantic/folders?root=${encodeURIComponent(root)}`,
test: "/wfm/gallery/semantic/test",
options: "/wfm/gallery/semantic/options",
};
const LS_ON = "wfm_gallery_semantic_on";
const LS_DIM = "wfm_gallery_semantic_dim";
const LS_MODEL = "wfm_gallery_semantic_model";
const LS_SOFT = "wfm_gallery_semantic_soft";
const GEMINI = "gemini-embedding-2";
const LOCAL = "embeddinggemma-2";
const LS_SUB = "wfm_gallery_semantic_recursive";
const LS_TAB = "wfm_gallery_semantic_tab";
const LS_TH = "wfm_gallery_semantic_th";
const LIMITS = [50, 100, 200, 500, 1000];
// Ollama のモデルサイズ(どちらも同じベクトルを返すので、切り替えても再作成は不要)
const OLLAMA_TAGS = [["embeddinggemma-2:740m", "semOllamaTag740"], ["embeddinggemma-2:440m", "semOllamaTag440"]];
const sem = {
on: false, // Semantic Searchトグル
@@ -65,7 +67,8 @@ async function postJson(url, body) {
/** APIエラーコードをi18nメッセージにする */
export function semanticErrorMessage(e) {
const known = ["no_api_key", "api_key_invalid", "index_empty", "dim_mismatch", "already_running",
"folder_not_allowed", "unsupported_type", "network_error", "api_error", "local_error"];
"folder_not_allowed", "unsupported_type", "network_error", "api_error", "local_error",
"ollama_unreachable", "ollama_model_missing", "bad_url"];
if (e?.code && known.includes(e.code)) {
return t(`sem_err_${e.code}`, e.message);
}
@@ -244,23 +247,14 @@ function modalHtml() {
<select id="wfm-sem-dim" class="wfm-select"></select>
<span class="wfm-sem-hint">${escapeHtml(t("semDimHint"))}</span></div>
<div id="wfm-sem-local-opts" class="wfm-sem-local-opts" style="display:none;">
<div class="wfm-sem-row"><b>${escapeHtml(t("semDevice"))}</b>
<select id="wfm-sem-device" class="wfm-select">
<option value="auto">${escapeHtml(t("semDeviceAuto"))}</option>
<option value="cpu">CPU</option>
<option value="cuda">GPU (CUDA)</option>
<div class="wfm-sem-row"><b>${escapeHtml(t("semOllamaUrl"))}</b>
<input type="text" id="wfm-sem-ollama-url" class="wfm-input wfm-sem-url" spellcheck="false" placeholder="http://localhost:11434"></div>
<div class="wfm-sem-row"><b>${escapeHtml(t("semOllamaTag"))}</b>
<select id="wfm-sem-ollama-tag" class="wfm-select">
${OLLAMA_TAGS.map(([tag, key]) => `<option value="${tag}">${escapeHtml(t(key))}</option>`).join("")}
</select>
<span id="wfm-sem-device-info" class="wfm-sem-hint"></span></div>
<div class="wfm-sem-row" id="wfm-sem-threads-row"><b>${escapeHtml(t("semThreads"))}</b>
<select id="wfm-sem-threads" class="wfm-select"></select>
<span class="wfm-sem-hint">${escapeHtml(t("semThreadsHint"))}</span></div>
<div class="wfm-sem-row"><b>${escapeHtml(t("semSoft"))}</b>
<select id="wfm-sem-soft" class="wfm-select">
<option value="280">${escapeHtml(t("semSoftHigh"))}</option>
<option value="140">${escapeHtml(t("semSoftStd"))}</option>
<option value="70">${escapeHtml(t("semSoftLight"))}</option>
</select>
<span class="wfm-sem-hint">${escapeHtml(t("semSoftHint"))}</span></div>
<span id="wfm-sem-ollama-info" class="wfm-sem-hint"></span></div>
<p class="wfm-sem-hint">${escapeHtml(t("semOllamaTagHint"))}</p>
</div>
<div class="wfm-sem-actions">
<button class="wfm-btn" id="wfm-sem-test">${escapeHtml(t("semTest"))}</button>
@@ -302,19 +296,12 @@ function selectedModel() {
return document.querySelector('input[name="wfm-sem-model"]:checked')?.value || GEMINI;
}
/** ローカルモデルの実行設定(デバイス/スレッド/画像精度)の初期値をサーバー保存値から設定する */
/** Ollama の接続先/モデルサイズの初期値をサーバー保存値から設定する */
function initLocalOpts(st) {
const lo = st.local || {};
const devSel = document.getElementById("wfm-sem-device");
devSel.value = (lo.options && lo.options.device) || "auto";
const cores = lo.devices?.cpu_count || 4;
const cur = (lo.options && lo.options.threads) || lo.default_threads || Math.max(1, Math.floor(cores / 2));
const set = new Set([1, 2, 4, 6, 8, 12, 16, 24, 32].filter(n => n <= cores).concat([cores, cur, lo.default_threads || 1]));
document.getElementById("wfm-sem-threads").innerHTML = [...set].sort((a, b) => a - b)
.map(n => `<option value="${n}">${n}${n === cores ? ` (${t("semThreadsAll")})` : ""}</option>`).join("");
document.getElementById("wfm-sem-threads").value = String(cur);
const soft = st.indexed_total && st.index_model === LOCAL ? st.index_soft : parseInt(lsGet(LS_SOFT, String(lo.default_soft || 280)), 10);
document.getElementById("wfm-sem-soft").value = String([70, 140, 280].includes(soft) ? soft : 280);
const ol = st.ollama || {};
document.getElementById("wfm-sem-ollama-url").value = ol.url || "";
const sel = document.getElementById("wfm-sem-ollama-tag");
if (ol.tag) sel.value = ol.tag;
}
/** 検索タブ: しきい値の入力欄にインデックスのモデル用の保存値を入れる(入力中の値は上書きしない) */
@@ -359,20 +346,15 @@ function closeSemanticModal() {
}
}
/** 検出した実行デバイスの表示(GPU版onnxruntimeが無いときの案内を含む) */
function updateDeviceInfo(lo) {
const dev = lo?.devices;
if (!dev) return;
const info = document.getElementById("wfm-sem-device-info");
const cudaOpt = document.querySelector('#wfm-sem-device option[value="cuda"]');
if (cudaOpt) cudaOpt.disabled = !dev.cuda;
if (!dev.cuda && document.getElementById("wfm-sem-device").value === "cuda") {
document.getElementById("wfm-sem-device").value = "auto";
}
if (info) info.textContent = dev.cuda ? t("semDeviceCudaOk", dev.ort_version) : t("semDeviceNoGpu", dev.ort_version);
const dv = document.getElementById("wfm-sem-device").value;
const useCpu = dv === "cpu" || (dv === "auto" && !dev.cuda);
document.getElementById("wfm-sem-threads-row").style.display = useCpu ? "" : "none";
/** モデルサイズの選択肢に取得済みかどうかを表示する */
function updateOllamaInfo(ol) {
if (!ol) return;
document.querySelectorAll("#wfm-sem-ollama-tag option").forEach(opt => {
const key = OLLAMA_TAGS.find(([tag]) => tag === opt.value)?.[1];
if (key) opt.textContent = t(key) + (ol.installed?.[opt.value] ? "" : ` ${t("semOllamaNotPulled")}`);
});
const info = document.getElementById("wfm-sem-ollama-info");
if (info) info.textContent = ol.reachable && !ol.ready ? t("semOllamaPullHint", ol.tag) : "";
}
/** 選択中モデルの次元選択肢を作り直す(preferredが選択肢にあればそれを選ぶ) */
@@ -414,11 +396,12 @@ async function refreshModal() {
fillThresholds(st);
const model = selectedModel();
document.getElementById("wfm-sem-local-opts").style.display = model === LOCAL ? "" : "none";
updateDeviceInfo(st.local);
const ready = model === LOCAL ? true : !!st.has_key;
const keyLine = model === LOCAL
? (_backends[LOCAL]?.downloaded ? t("semLocalReady") : t("semLocalNeedDownload"))
: (st.has_key ? t("semKeyOk") : t("semKeyMissing"));
updateOllamaInfo(st.ollama);
const ol = st.ollama || {};
const ready = model === LOCAL ? !!ol.ready : !!st.has_key;
const keyLine = model !== LOCAL ? (st.has_key ? t("semKeyOk") : t("semKeyMissing"))
: !ol.reachable ? t("semOllamaUnreachable", ol.url)
: ol.ready ? t("semOllamaReady", ol.tag) : t("semOllamaMissing", ol.tag);
const idxLine = t("semIndexInfo", st.indexed_total, st.index_dim || "-");
const scopeLine = st.scope_total != null ? t("semScopeInfo", st.scope_indexed, st.scope_total) : "";
document.getElementById("wfm-sem-status").innerHTML =
@@ -437,7 +420,7 @@ async function refreshModal() {
let text = t("semProgress", job.done || 0, total, job.failed || 0);
if (job.running && job.current) text += ` ${job.current}`;
if (!job.running) {
if (["no_api_key", "api_key_invalid", "local_error"].includes(job.error_code)) text += ` ${t(`sem_err_${job.error_code}`, job.error)}`;
if (["no_api_key", "api_key_invalid", "local_error", "ollama_unreachable", "ollama_model_missing"].includes(job.error_code)) text += ` ${t(`sem_err_${job.error_code}`, job.error)}`;
else text += ` ${job.cancelled ? t("semCancelled") : t("semFinished")}`;
if (job.failed && job.error) text += ` (${job.error})`;
}
@@ -477,13 +460,22 @@ function openSemanticModal() {
}
openModal(t("semModalTitle"), modalHtml());
const dimOf = () => parseInt(document.getElementById("wfm-sem-dim").value, 10) || 0;
// ローカルモデル選択時のみ実行設定を送る(サーバー側で保存され、検索時のクエリ埋め込みにも使われる)
const localOpts = () => selectedModel() === LOCAL ? {
device: document.getElementById("wfm-sem-device").value,
threads: parseInt(document.getElementById("wfm-sem-threads").value, 10) || 0,
soft: parseInt(document.getElementById("wfm-sem-soft").value, 10) || 280,
} : {};
document.getElementById("wfm-sem-device").addEventListener("change", () => refreshModal());
// ローカルモデル選択時のみ Ollama の設定を送る(サーバー側で保存され、検索時のクエリ埋め込みにも使われる)
const ollamaOpts = () => ({
ollama_url: document.getElementById("wfm-sem-ollama-url").value.trim(),
ollama_tag: document.getElementById("wfm-sem-ollama-tag").value,
});
const localOpts = () => selectedModel() === LOCAL ? ollamaOpts() : {};
const saveOllamaOpts = async () => {
try {
await postJson(API.options, ollamaOpts());
} catch (e) {
showToast(semanticErrorMessage(e), "error");
}
refreshModal();
};
document.getElementById("wfm-sem-ollama-url").addEventListener("change", saveOllamaOpts);
document.getElementById("wfm-sem-ollama-tag").addEventListener("change", saveOllamaOpts);
document.querySelectorAll('input[name="wfm-sem-model"]').forEach(r => r.addEventListener("change", () => {
fillDims(selectedModel(), 0);
refreshModal();
@@ -507,7 +499,6 @@ function openSemanticModal() {
if (mode === "all" && !confirm(t("semConfirmAll"))) return;
lsSet(LS_DIM, String(dimOf()));
lsSet(LS_MODEL, selectedModel());
lsSet(LS_SOFT, document.getElementById("wfm-sem-soft").value);
try {
await postJson(API.index, {
folder: ctx.getFolder(),
+167 -79
View File
@@ -176,6 +176,26 @@ window._wfmReceiveI2IRunRequest = async (imageBlob, params, workflowData, workfl
}
};
// 複数画像版のI2I実行(Comic Creater の Nanobanana+ タブ「Local」用)。
// iframe.contentWindow._wfmReceiveMultiImageI2IRunRequest(imageBlobs, params, workflowData?, workflowFilename?)
// imageBlobs[i] がワークフロー内 i 番目の LoadImage ノードへ割り当てられる。結果: { ok, url, slotCount, usedImages }
window._wfmReceiveMultiImageI2IRunRequest = async (imageBlobs, params, workflowData, workflowFilename) => {
try {
if (workflowData) {
if (!comfyUI.connected) {
await comfyUI.checkConnection();
}
if (comfyUI.connected && (!comfyEditor.models.checkpoints || comfyEditor.models.checkpoints.length === 0)) {
await comfyEditor.loadModelLists();
}
await loadWorkflowIntoEditor(workflowData, workflowFilename || "workflow.json");
}
return await window._wfmImageEditTab.runI2IExternalMulti(imageBlobs, params);
} catch (e) {
return { ok: false, message: e.message };
}
};
// ComfyUI Comic Creater からiframe越しにコマの設定(シーン・要素・セリフ等)を受け取り、
// AIタブの設定タブと同じLLM接続設定(Ollama/LM Studio)で画像生成プロンプトの下書きを
// 生成して返す(半自動マンガ作成の「L」ボタン連携用)。
@@ -2126,6 +2146,85 @@ function openCompare(paths) {
overlay.querySelectorAll("video, audio").forEach(applyStoredVideoVolume);
}
// ── 他のタブから画像を表示する ────────────────────────────────
const _normPath = (p) => (p || "").replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase();
/**
* Output サブタブで path の画像を表示する(TagSpace の Gallery 点から呼ぶ)。
* 絞り込み(検索・お気に入り・タグ・グループ・類似表示)を解除し、フォルダツリーを
* 親から順に展開してフォルダを選び、一覧でその画像を選択して詳細を開く。
* 戻り値: 表示できたら true(出力フォルダ外・一覧に無いときは false)
*/
export async function revealInGallery(path) {
const wait = (ms) => new Promise((r) => setTimeout(r, ms));
document.querySelector('.wfm-tab[data-tab="gallery"]')?.click(); // 初回はここで出力フォルダとツリーを読み込む
document.querySelector('.wfm-gallery-subtab-btn[data-gallery-subtab="output"]')?.click();
for (let i = 0; i < 100 && !state.folderTree; i++) await wait(100);
if (!state.folderTree) return false;
const target = _normPath(path);
const folder = target.slice(0, target.lastIndexOf("/"));
// ツリーの根から目的のフォルダまでのノードを集める
const chain = [];
let node = state.folderTree;
if (folder !== _normPath(node.abs_path) && !folder.startsWith(_normPath(node.abs_path) + "/")) return false;
while (node) {
chain.push(node);
if (_normPath(node.abs_path) === folder) break;
node = (node.children || []).find((c) => folder === _normPath(c.abs_path) || folder.startsWith(_normPath(c.abs_path) + "/"));
}
const leaf = chain[chain.length - 1];
if (_normPath(leaf.abs_path) !== folder) return false;
// 絞り込みの解除(「Clear filters」ボタンと同じ。再読み込みは下で1回だけ行う)
clearTimeout(_searchDebounceTimer);
state.search = "";
state.favoriteOnly = false;
state.tagFilter = "";
state.groupFilter = "";
const searchInput = document.getElementById("wfm-gallery-search");
if (searchInput) searchInput.value = "";
const tagSel = document.getElementById("wfm-gallery-tag-filter");
if (tagSel) tagSel.value = "";
const groupSel = document.getElementById("wfm-gallery-group-filter");
if (groupSel) groupSel.value = "";
document.getElementById("wfm-gallery-fav-btn")?.classList.remove("active");
exitSimilarMode();
// ツリーを親から順に展開(子ノードは展開時に描画される)
const itemOf = (abs) => [...document.querySelectorAll(".wfm-gallery-tree-item")].find((el) => _normPath(el.dataset.path) === _normPath(abs));
for (const n of chain.slice(0, -1)) {
const arrow = itemOf(n.abs_path)?.querySelector(".wfm-gallery-tree-arrow");
if (arrow && arrow.dataset.expanded !== "true" && arrow.style.visibility !== "hidden") arrow.click();
}
const item = itemOf(leaf.abs_path);
document.querySelectorAll(".wfm-gallery-tree-item.selected").forEach((el) => el.classList.remove("selected"));
item?.classList.add("selected");
item?.scrollIntoView({ block: "nearest" });
state.currentFolder = leaf.abs_path;
state.selectedImages.clear();
state.lastSelectionIndex = -1;
updateBulkBar();
await loadImages();
const idx = state.images.findIndex((img) => _normPath(img.path) === target);
if (idx === -1) return false;
// サムネイル表示は50件ずつ描くので、目的の画像まで描き足す
const grid = document.getElementById("wfm-gallery-grid");
if (state.viewMode === "thumb" && _renderedCount <= idx) {
while (_renderedCount <= idx) _appendNextPage(grid);
// 無限スクロールの目印を末尾へ戻す(全件描いたら外す)。_attachScrollSentinel と同じ扱い
if (_renderedCount >= state.images.length) _disconnectScrollObserver();
else { const s = document.getElementById("wfm-gallery-scroll-sentinel"); if (s) grid.appendChild(s); }
}
const el = [...grid.querySelectorAll("[data-path]")].find((e) => _normPath(e.dataset.path) === target);
if (!el) return false;
el.click(); // 通常のクリックと同じ選択・詳細表示
el.scrollIntoView({ block: "center" });
return true;
}
// ── outputパス取得 ────────────────────────────────────────────
async function detectOutputPath() {
@@ -2323,93 +2422,82 @@ function bindEvents() {
}
});
// 選択画像を ComfyUI Comic Creator の選択コマ/オーバーレイへ送信
// (ComfyUI Comic CreaterからこのGalleryタブがiframe埋め込みされている場合のみ表示・動作する)
// 選択画像を ComfyUI Comic Creator へ送信(ComfyUI Comic CreaterからこのGalleryタブがiframe埋め込みされている場合のみ表示・動作する)
// Send CC Layout: レイアウトタブの選択コマ/オーバーレイへ(動画はComic Creatorの動画ツールへ)
// Send CC Image : Imageタブへ(作業中のレイヤーがあれば新規レイヤー、無ければ新規キャンバス)。動画は未対応
const sendCcBtn = document.getElementById("wfm-gallery-send-cc-btn");
if (sendCcBtn) {
let embedded = false;
const sendCcImageBtn = document.getElementById("wfm-gallery-send-cc-image-btn");
let ccEmbedded = false;
try {
ccEmbedded = !!(window.parent && window.parent !== window);
} catch (e) {
ccEmbedded = false;
}
if (ccEmbedded) {
if (sendCcBtn) sendCcBtn.style.display = "";
if (sendCcImageBtn) sendCcImageBtn.style.display = "";
}
// window.parent のメンバーを安全に取り出す(クロスオリジン等で参照できなければnull)
const getCcParentFn = (name) => {
try {
embedded = !!(window.parent && window.parent !== window);
} catch (e) {
embedded = false;
if (window.parent && window.parent !== window && typeof window.parent[name] === "function") return window.parent[name];
} catch (e) { /* ignore */ }
return null;
};
sendCcBtn?.addEventListener("click", () => {
if (!state.selectedImage) {
showToast(t("gallerySelectImageFirst"), "info");
return;
}
if (embedded) sendCcBtn.style.display = "";
const url = API.serveImage(state.selectedImage.path);
sendCcBtn.addEventListener("click", () => {
if (!state.selectedImage) {
showToast(t("gallerySelectImageFirst"), "info");
return;
}
const url = API.serveImage(state.selectedImage.path);
const isVideo = isVideoFile(state.selectedImage);
// I2I送信元がImageタブだった場合はそちらへ画像を読み込ませる(_ccI2ITargetModeはComic Creater側が
// 「I2Iへ送る」ボタン押下時にセットするフラグ。undefined/'layout'なら従来通りコマ/オーバーレイへ挿入)
let targetMode = null;
try {
targetMode = window.parent?._ccI2ITargetMode || null;
} catch (e) {
targetMode = null;
}
if (targetMode === "image") {
// Imageタブは動画未対応(Comic Creator側の動画ツールはレイアウトタブのみ対応)
if (isVideo) {
showToast(t("galleryVideoNotSupportedInImageTab"), "info");
return;
}
let imageTab = null;
try {
if (window.parent && window.parent !== window && typeof window.parent._ccImageTab?.loadFromUrl === "function") {
imageTab = window.parent._ccImageTab;
}
} catch (e) {
imageTab = null;
}
if (!imageTab) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
imageTab.loadFromUrl(url, (state.selectedImage.filename || "cc-image").replace(/\.[^.]+$/, ""));
showToast(t("gallerySentCC"), "success");
return;
}
// レイアウトタブのコマ/オーバーレイへ(デフォルト経路)。動画(.mp4)はComic Creator側の
// 動画ツール専用の受け口(insertVideoFromUrl)へ、それ以外は従来通り画像として送る
if (isVideo) {
let insertVideoFn = null;
try {
if (window.parent && window.parent !== window && typeof window.parent.insertVideoFromUrl === "function") {
insertVideoFn = window.parent.insertVideoFromUrl;
}
} catch (e) {
insertVideoFn = null;
}
if (!insertVideoFn) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
insertVideoFn(url, state.selectedImage.filename || "video.mp4");
showToast(t("gallerySentCC"), "success");
return;
}
let insertFn = null;
try {
if (window.parent && window.parent !== window && typeof window.parent.insertImageFromUrl === "function") {
insertFn = window.parent.insertImageFromUrl;
}
} catch (e) {
insertFn = null;
}
if (!insertFn) {
// 動画(.mp4)はComic Creator側の動画ツール専用の受け口(insertVideoFromUrl)へ、それ以外は画像として送る
if (isVideoFile(state.selectedImage)) {
const insertVideoFn = getCcParentFn("insertVideoFromUrl");
if (!insertVideoFn) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
insertFn(url);
insertVideoFn(url, state.selectedImage.filename || "video.mp4");
showToast(t("gallerySentCC"), "success");
});
}
return;
}
const insertFn = getCcParentFn("insertImageFromUrl");
if (!insertFn) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
insertFn(url);
showToast(t("gallerySentCC"), "success");
});
sendCcImageBtn?.addEventListener("click", async () => {
if (!state.selectedImage) {
showToast(t("gallerySelectImageFirst"), "info");
return;
}
// Imageタブは動画未対応
if (isVideoFile(state.selectedImage)) {
showToast(t("galleryVideoNotSupportedInImageTab"), "info");
return;
}
const sendFn = getCcParentFn("sendImageToImageTab");
if (!sendFn) {
showToast(t("galleryCCNotAvailable"), "info");
return;
}
const url = API.serveImage(state.selectedImage.path);
try {
const ok = await sendFn(url, (state.selectedImage.filename || "cc-image").replace(/\.[^.]+$/, ""));
showToast(t(ok === false ? "galleryCCNotAvailable" : "gallerySentCC"), ok === false ? "info" : "success");
} catch (e) {
console.error("[gallery] Send CC Image failed", e);
showToast(t("galleryCCNotAvailable"), "info");
}
});
// 検索(連続キー入力のたびにリクエストを飛ばすと、50枚程度のフォルダでも
// ファイルI/Oの重いサーバー処理が積み重なって読み込みが遅延するためdebounceする)
+18 -9
View File
@@ -2217,16 +2217,25 @@ export async function initGenerateTab() {
comfyEditor.renderLoraPane(comfyUI.currentAnalysis, "wfm-gen-lora-fields");
});
// Input inner tab (Prompt / Image)
document.querySelectorAll(".wfm-input-inner-tab").forEach((btn) => {
btn.addEventListener("click", () => {
const target = btn.dataset.inputTab;
document.querySelectorAll(".wfm-input-inner-tab").forEach((b) => b.classList.remove("active"));
btn.classList.add("active");
document.querySelectorAll(".wfm-input-inner-panel").forEach((p) => p.style.display = "none");
document.getElementById(`wfm-input-panel-${target}`)?.style.setProperty("display", "");
// Input tab: Raw JSON column collapse / expand (state remembered in localStorage)
{
const col = document.getElementById("wfm-gen-rawjson-col-input");
const btn = document.getElementById("wfm-gen-rawjson-collapse-btn");
const KEY = "wfm_gen_rawjson_collapsed";
const apply = (collapsed) => {
col?.classList.toggle("wfm-gen-rawjson-col--collapsed", collapsed);
const icon = btn?.querySelector(".wfm-rawjson-collapse-icon");
if (icon) icon.textContent = collapsed ? "«" : "»";
};
let stored = false;
try { stored = localStorage.getItem(KEY) === "1"; } catch { /* ignore */ }
apply(stored);
btn?.addEventListener("click", () => {
const next = !col.classList.contains("wfm-gen-rawjson-col--collapsed");
apply(next);
try { localStorage.setItem(KEY, next ? "1" : "0"); } catch { /* ignore */ }
});
});
}
// Initial placement: move to first active tab (input)
moveRawJsonToTab("input");
+369 -84
View File
@@ -620,32 +620,31 @@ const LANGUAGES = {
semThTextHint: "0 = no filter",
semThLimit: "Max results:",
semThNote: "Score levels differ by model (in a small test, similar images scored about 0.6-0.8 with EmbeddingGemma 2 and about 0.6 with Gemini, while text queries scored about 0.6-0.7 and about 0.3), so the value is saved per model. The current semantic/similar list is refreshed with the new value when you close this window.",
semDevice: "Device:",
semDeviceAuto: "Auto (GPU if available)",
semDeviceCudaOk: (v) => `GPU (CUDA) detected - onnxruntime ${v}`,
semDeviceNoGpu: (v) => `No GPU detected (onnxruntime ${v}, CPU only). To use the GPU, see the help ("?")`,
semThreads: "CPU threads:",
semThreadsAll: "all",
semThreadsHint: "Fewer threads = lighter on the PC while generating images (slower indexing)",
semSoft: "Image precision:",
semSoftHigh: "High (slowest)",
semSoftStd: "Standard (about 2.5x faster)",
semSoftLight: "Light (about 5x faster)",
semSoftHint: "Changing it requires \"Rebuild all\"",
semTestOkProvider: (dim, prov) => `Connection OK (vector size ${dim}, running on ${prov})`,
semDotTitle: "Semantic index: all images in this folder are indexed",
semHelpTitle: "Open the help for Semantic Search",
semModel: "Embedding model:",
semModelGemini: "Gemini Embedding 2 (API)",
semModelLocal: "EmbeddingGemma 2 (local, free)",
semLocalReady: "EmbeddingGemma 2: model downloaded (runs locally, no API key needed)",
semLocalNeedDownload: "EmbeddingGemma 2: the model (about 300 MB) will be downloaded on first use",
sem_err_local_error: (m) => `EmbeddingGemma 2 error: ${m}`,
semModelLocal: "EmbeddingGemma 2 (Ollama, local, free)",
semOllamaUrl: "Ollama URL:",
semOllamaTag: "Model size:",
semOllamaTag740: "740m (text + image + audio, 1.3 GB)",
semOllamaTag440: "440m (text + image, 671 MB, lighter)",
semOllamaTagHint: "Both sizes return identical vectors, so switching does not need \"Rebuild all\". 440m leaves out the audio encoder (not used here) and uses less memory.",
semOllamaNotPulled: "(not downloaded)",
semOllamaPullHint: (tag) => `Download it with: ollama pull ${tag}`,
semOllamaReady: (tag) => `Ollama: ${tag} ready (runs locally, no API key needed)`,
semOllamaMissing: (tag) => `Ollama is running but ${tag} is not downloaded — run "ollama pull ${tag}"`,
semOllamaUnreachable: (url) => `Cannot reach Ollama at ${url} — start Ollama or check the URL`,
sem_err_ollama_unreachable: (m) => `Cannot reach Ollama: ${m}`,
sem_err_ollama_model_missing: (m) => `The Ollama model is not downloaded — run "ollama pull ${m}"`,
sem_err_bad_url: (m) => `URL not allowed: ${m}`,
sem_err_local_error: (m) => `EmbeddingGemma 2 (Ollama) error: ${m}`,
semScope: "Target folder:",
semNoFolder: "Select a folder in the Gallery first",
semIncludeSub: "Include subfolders",
semDimension: "Vector size:",
semDimHint: "Larger = more precise but heavier. Changing the model or size requires \"Rebuild all\".",
semDimHint: "Larger = more precise but heavier. Changing the model (Gemini / EmbeddingGemma 2) or size requires \"Rebuild all\".",
semMode: "Mode:",
semModeMissing: "New / changed images only",
semModeAll: "Rebuild all (target folder)",
@@ -653,7 +652,7 @@ const LANGUAGES = {
semCancelJob: "Stop",
semTest: "Test connection",
semClear: "Delete all index data",
semCostNote: "Gemini Embedding 2 has a free tier, but content sent on the free tier may be used by Google to improve its products; beyond the free tier it is paid (about $0.00012 per image as of Oct 2026). Indexing sends each image (resized) to the API; EmbeddingGemma 2 runs locally on the CPU (about 2-3 s per image). Searches reuse the saved vectors (only the text query is sent). Videos/PSD use a thumbnail; audio is skipped.",
semCostNote: "Gemini Embedding 2 has a free tier, but content sent on the free tier may be used by Google to improve its products; beyond the free tier it is paid (about $0.00012 per image as of Oct 2026). Indexing sends each image (resized) to the API; EmbeddingGemma 2 runs locally in Ollama (about 0.1-0.2 s per image with an NVIDIA GPU). Searches reuse the saved vectors (only the text query is sent). Videos/PSD use a thumbnail; audio is skipped.",
semKeyOk: "GEMINI_API_KEY: set",
semKeyMissing: "GEMINI_API_KEY is not set — add GEMINI_API_KEY=... to the plugin's .env file and restart ComfyUI",
semIndexInfo: (n, dim) => `indexed images: ${n} (vector size: ${dim})`,
@@ -751,6 +750,84 @@ const LANGUAGES = {
tabAi: "AI TOOL",
tabTagger: "Tagger",
tabTagSpace: "TagSpace",
tsBuild: "Build / Update",
tsCancel: "Stop",
tsMaxTags: "Tags:",
tsBackground: "Gallery points:",
tsAllTags: "All tags",
tsAllTagsHint: "Use every candidate tag instead of the Tags number (up to 20,000)",
tsMinCount: "Min uses:",
tsMinCountHint: "Leave out tags used in fewer prompts than this (all sources combined)",
tsWildcard: "Wildcards",
tsWildcardHint: "Use wildcard files as a tag source (words only found in wildcards are most of the distinct tags)",
tsTagsAvailable: (n) => ` (of ${n} candidates)`,
tsLayerCards: "Cards",
tsThumbs: "Thumbnails",
tsGlow: "Glow",
tsTwinkle: "Twinkle",
tsLayerTags: "Tags",
tsLayerGallery: "Gallery",
tsSearchPlaceholder: "Search the space (Enter)…",
tsLoading: "Loading the 3D view…",
tsHint: "Drag: rotate · Right-drag: pan · Wheel: zoom · Click: select · Double-click: add or remove",
tsNotBuilt: "The space is not built yet. Press \"Build / Update\".",
tsNeedOllama: "EmbeddingGemma 2 in Ollama is required (Gallery > Semantic settings > Model).",
tsBuilt: (c, g, b, at, ev) => `${c} cards · ${g} tags · ${b} Gallery points · built ${at} · PCA ${(ev * 100).toFixed(1)}%`,
tsPhase_cards: () => `Collecting ImagePrompt cards…`,
tsPhase_index: (d, n) => `Indexing card images in the Gallery semantic index… ${d} / ${n}`,
tsPhase_prompts: (d, n) => `Reading prompts from Gallery images… ${d} / ${n}`,
tsSrc_gallery: "Gallery prompts",
tsImageNoTags: "No prompt tags (no prompt found in this image)",
tsPhase_tags: (d, n) => `Embedding tags… ${d} / ${n}`,
tsPhase_project: () => `Projecting to 3D…`,
tsDetailTitle: "Selection",
tsDetailEmpty: "Hover or click an item in the space.",
tsNeighborsTitle: "Nearby",
tsNeighborsOf: (name) => `Near "${name}"`,
tsSearchTitle: (q) => `Search: ${q}`,
tsPickHint: "Click tags to choose them, then search the space with them",
tsPickSearch: (n) => `Search with selected (${n})`,
tsPickClear: "Deselect",
tsFullPrompt: "Full prompt",
tsAddPicked: (n) => `Add selected (${n})`,
tsOpenInGallery: "Open in Gallery",
tsRevealFailed: "Could not show this image in the Gallery (it is outside the Gallery output folder or no longer exists)",
tsChipPicked: (name, n) => `${name} (${n} tags)`,
tsListEmpty: "Select an item or search to list nearby cards and tags.",
tsBuilderTitle: "Prompt",
tsChipsEmpty: "Double-click cards or tags in the space, or use Add / + in the panels, to add them.",
tsSend: "Add to GenerateUI (Positive)",
tsCopy: "Copy",
tsClear: "Clear",
tsAdd: "Add",
tsRemove: "Remove",
tsSent: "Added to the Positive prompt in GenerateUI",
tsCopied: "Copied to the clipboard",
tsNoWorkflow: "Load a workflow in GenerateUI first",
tsSources: "Sources:",
tsKind_card: "Card",
tsKind_tag: "Tag",
tsKind_image: "Gallery image",
tsSrc_image_prompt: "ImagePrompt",
tsSrc_tagger: "Tagger DB",
tsSrc_prompt_library: "Prompt library",
tsSrc_wildcard: "Wildcards",
tsSourceFilterHint: "Show or hide tags by source (a tag stays visible while any of its sources is on)",
tsTagger: "Tagger fill:",
tsTaggerOff: "OFF",
tsTaggerHint: "Tag Gallery images that have no readable prompt with a Tagger model (results are cached; very slow without a GPU)",
tsScope_background: "Gallery points only",
tsScope_all: "All images without a prompt",
tsPhase_tagger: (d, n, note) => `Tagging images without a prompt… ${d} / ${n}${note ? ` (${note})` : ""}`,
tsSrc_tagger_auto: "Tagger fill",
tsTagsFromTagger: "(Tagger fill)",
ts_err_tagspace_tagger_model: (m) => `Tagger model could not be used: ${m}`,
ts_err_tagspace_not_built: () => `The space is not built yet. Press "Build / Update".`,
ts_err_tagspace_index_model: (m) => `The Gallery semantic index was made with ${m}. TagSpace needs EmbeddingGemma 2 — rebuild the index with it in Gallery > Semantic settings.`,
ts_err_tagspace_too_few: () => `Not enough cards or tags to build the space.`,
ts_err_tagspace_unknown_item: () => `That item is no longer in the space. Rebuild the space.`,
ts_err_tagspace_error: (m) => `TagSpace error: ${m}`,
tabImageEdit: "Image Edit",
// -- Tagger Tab --
@@ -908,7 +985,7 @@ const LANGUAGES = {
helpGen26: "Create Catalog modal — \"Don't keep a copy in the Output folder\" checkbox: each generation still writes a normal file to ComfyUI's Output folder first (that's simply how the workflow's own Save Image node works), but once its copy has been saved into the catalog folder, checking this deletes that Output-folder original right away — useful for large catalog runs (e.g. all 200+ styles) so the Output folder isn't flooded with near-duplicate files; if a particular style's catalog copy fails to save, its Output file is left alone rather than being deleted",
helpGen27: "Input tab → Image sub-panel — each LoadImage card now has three buttons: Apply (unchanged), Clear (resets that card's pending selection/preview back to empty; doesn't touch the workflow node itself, since LoadImage always needs some valid filename), and Placeholder. A Placeholder Image section — collapsed by default since it's a low-frequency feature, click to expand — sits at the top of the panel with a shared default: Color mode (set Width/Height/Color; generates a solid-color PNG on the fly) or Image mode (drop one default image, reused as-is). Clicking a card's own Placeholder button immediately replaces just that card's image with the configured default — no separate Apply click needed, and with several LoadImage cards each can be replaced individually. The Placeholder config (mode, size, color, default image) is remembered across sessions",
helpGen3: "5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing",
helpGen4: "Input tab: inner tabs — Prompt and Image (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an Embeddings selector at the bottom — select a model, set Weight (default 1.0), then click Paste to insert (embedding:Name:weight) at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a ↺ button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust its emphasis weight in (text:weight) syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0",
helpGen4: "Input tab: Prompt (left) and Image (right, about 3:2) are shown side by side on one screen (drag-and-drop upload); when the Prompt/Image area gets narrow (about 720px or less) Image wraps under Prompt, and the Raw JSON column can be collapsed to a slim strip at the right edge with its » button (Input tab only; remembered); the Prompt area has Positive Prompt, Negative Prompt, and an Embeddings selector at the bottom — select a model, set Weight (default 1.0), then click Paste to insert (embedding:Name:weight) at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a ↺ button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press Ctrl+↑/↓ to adjust its emphasis weight in (text:weight) syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0",
helpGen5: "Model tab: Checkpoint, VAE, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors) are always shown; ControlNet and Hypernetwork (with Strength field) are collapsed by default since they're used less often — click their header to expand; LoRA (Single/Stack tabs) has its own column to the right; all selectors have a filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones",
helpGen28: "Model tab — Highlight color: the label of each model type (Checkpoint, VAE, Diffusion Model, Text Encoder, ControlNet, Hypernetwork) and the LoRA column header turn a distinct color (default bright green) when the loaded workflow actually contains that type of node; this stays visible even while ControlNet/Hypernetwork are collapsed, so you can tell at a glance whether they're in use without expanding them; the color is customizable in the Settings tab",
helpGen6: "Settings tab: KSampler and Latent Image side by side, each at 50% width",
@@ -1080,11 +1157,12 @@ const LANGUAGES = {
helpGallery10: "Workflow auto-save: images generated in the Generate UI tab automatically have their workflow saved to gallery metadata and shown in the JSON tab",
helpGallery11: "Supports PNG (tEXt/iTXt), JPEG, WebP, GIF, MP4, WebM, PSD, and audio (WAV, MP3, OGG, M4A, FLAC, Opus — waveform thumbnail, built-in player, prompt/workflow tags written by ComfyUI's SaveAudio nodes); workflow extraction reads ComfyUI prompt/workflow keys embedded in in PNG metadata (including chunks appended after IEND by ComfyUI-Custom-Scripts), WebP EXIF, or MP4/WebM container tags (as written by SaveVideo, e.g. MiniMax H3 output); the Prompt tab also reads A1111 / Forge / Fooocus parameters text when no workflow is embedded. Audio waveform thumbnails are colored by format (MP3 blue, WAV green, FLAC amber, OGG/Opus purple, M4A rose) so formats can be told apart at a glance; the detail panel shows the waveform with the player below it.",
helpGallery31: "Send to LV node button (toolbar, next to Send to LI node): the video equivalent — uploads the selected video and writes its filename into the file widget of the currently selected node, which must be ComfyUI's native Load Video node; only enabled when the selected item is a video (mp4/webm); requires Workflow Studio to have been opened from ComfyUI's top menu button",
helpGallery37: "Send CC Layout / Send CC Image buttons (toolbar, shown only when this Gallery is opened inside ComfyUI Comic Creator; v0.8.11): Send CC Layout sends the selected image to the Layout tab's selected panel / overlay (an MP4 goes to the Video tool); Send CC Image switches to Comic Creator's Image tab and loads the selected image there (as a new layer if a document is open, otherwise as a new canvas; videos are not supported)",
helpGallery32: "Detail panel — Prompt tab (selected by default): lists positive/negative prompts found in the embedded workflow; hidden for images in a cc_nanobanana folder, since those carry no embedded ComfyUI workflow — a Nanobanana tab (v0.7.14) appears there instead, shown only when that folder's history.jsonl generation log (written by ComfyUI Comic Creator's Nanobanana tab) has a matching entry for the selected image: engine, model, image size, seed, timestamp, and the prompt/negative prompt actually used",
helpGallery33: "Semantic Search (v0.8.2): the S button next to the search box turns semantic search on. When ON, the search box finds images by meaning using Gemini Embedding 2 or the local EmbeddingGemma 2 (e.g. 'sunset city street') - press Enter to search; results are ordered by similarity with a score badge. When OFF it is the normal filename/tag/prompt search. Turning S on also shows a second toolbar row with Similar, the update button, the settings button and the result count. The settings button (gear) opens a window to build/update/delete the index for the selected folder (optionally with subfolders); choose the model with the radio buttons (Gemini needs GEMINI_API_KEY in the plugin's .env + a ComfyUI restart; EmbeddingGemma 2 runs locally and downloads its model on first use). Switching model or vector size needs 'Rebuild all'. Searches cover the selected folder tree; sort and tag/group filters do not apply to semantic results",
helpGallery33: "Semantic Search (v0.8.2): the S button next to the search box turns semantic search on. When ON, the search box finds images by meaning using Gemini Embedding 2 or EmbeddingGemma 2 running in Ollama (e.g. 'sunset city street') - press Enter to search; results are ordered by similarity with a score badge. When OFF it is the normal filename/tag/prompt search. Turning S on also shows a second toolbar row with Similar, the update button, the settings button and the result count. The settings button (gear) opens a window to build/update/delete the index for the selected folder (optionally with subfolders); choose the model with the radio buttons (Gemini needs GEMINI_API_KEY in the plugin's .env + a ComfyUI restart; EmbeddingGemma 2 needs Ollama running locally with the model downloaded: ollama pull embeddinggemma-2:740m or embeddinggemma-2:440m). Switching model or vector size needs 'Rebuild all'. Searches cover the selected folder tree; sort and tag/group filters do not apply to semantic results",
helpGallery34: "Similar toggle and update button (second toolbar row, shown while S is ON): Similar shows images similar to the selected one (an image not yet indexed is embedded on the fly). Selecting another image keeps the list as is; press the update button to show images similar to the newly selected one, or press Similar again to return to the normal list. Changing folder, Clear filters or turning S off also leaves similar mode",
helpGallery35: "EmbeddingGemma 2 performance: by default it runs on the CPU with half of the cores (about 6 s per image at full precision). Image precision trades accuracy for speed (Standard is about 2.5x and Light about 5x faster; vectors differ, so changing it needs 'Rebuild all'); fewer CPU threads keep the PC lighter while generating images. To use an NVIDIA GPU, install onnxruntime-gpu into ComfyUI's Python (pip uninstall onnxruntime, then pip install onnxruntime-gpu; the CUDA runtime/cuDNN that ComfyUI's PyTorch uses is picked up) and restart ComfyUI: indexing then takes about 0.1 s per image (measured on an RTX 4070, about 45x faster than the CPU) and the results are identical to the CPU's. DirectML is not supported (its vision model fails to run). The model is released from memory when indexing finishes and reloaded on the next search",
helpGallery36: "Modal tabs and the similarity threshold: the Semantic settings window has three tabs - Index (target folder, rebuild mode, progress, delete all), Model (Gemini / EmbeddingGemma 2, vector size, device, CPU threads, image precision, connection test) and Search. On the Search tab you can set a minimum score for similar-image results (e.g. 0.6 shows only images scoring 0.6 or higher), a minimum score for text search, and the maximum number of results. Scores differ by model, so each model keeps its own values; the list header shows the active threshold",
helpGallery35: "EmbeddingGemma 2 runs in Ollama (the built-in ONNX runtime was removed, so onnxruntime-gpu is no longer needed for it). On the Model tab set the Ollama URL (default http://localhost:11434; other hosts must be listed in WFS_ALLOWED_BACKEND_HOSTS) and the model size: 740m (text + image + audio) or 440m (text + image, smaller). Both return identical vectors, so you can switch sizes without rebuilding; the ':latest' tag is the same as 740m and is used when 740m is not downloaded. 270m and 570m cannot embed images and are not offered. Indexes made with the earlier ONNX version keep working (the vectors match closely; use 'Rebuild all' to regenerate them exactly). Images are sent 4 at a time (about 0.1-0.2 s per image with an NVIDIA GPU). The model is unloaded from VRAM when indexing finishes and Ollama reloads it on the next search",
helpGallery36: "Modal tabs and the similarity threshold: the Semantic settings window has three tabs - Index (target folder, rebuild mode, progress, delete all), Model (Gemini / EmbeddingGemma 2, vector size, Ollama URL, model size, connection test) and Search. On the Search tab you can set a minimum score for similar-image results (e.g. 0.6 shows only images scoring 0.6 or higher), a minimum score for text search, and the maximum number of results. Scores differ by model, so each model keeps its own values; the list header shows the active threshold",
helpGallery28: "Create PSD bulk button: combines all selected images into a single layered PSD file and downloads it — each image becomes its own layer (named after the file), positioned top-left on a canvas sized to the largest selected image; the last selected image ends up on top Convert... bulk button (shown when audio/video files are selected): converts audio files — or extracts the audio track of videos — to FLAC / MP3 / Opus / M4A / WAV (bitrate, sample rate, channels selectable) into the same folder as new files; prompt/workflow tags are carried over for formats that can hold them (WAV cannot), favorite/tags/memo/groups can be carried over, and the originals can optionally be deleted afterwards.",
helpGallery29: "Edit as Layers bulk button: switches to the Image Edit tab and opens all selected images at once, each as an independent layer (video files in the selection are skipped); the last selected image ends up on top",
helpGallery30: "PSD files: thumbnails and full-size previews show all layers merged together (hidden layers excluded); the underlying PSD file itself is left untouched — only the preview shown in Gallery is a flattened rendering",
@@ -1106,6 +1184,19 @@ const LANGUAGES = {
helpGallery26: "Four sub-tabs at the top of the Gallery tab: Output (this browser), ImagePrompt, Style_Catalog, and Metadata — the last one embeds the full Metadata Tab (see its own help page) so you can drop an image there to inspect its embedded model/prompt data without leaving Gallery",
// -- Tagger Tab --
helpTagSpaceTitle: "TagSpace Tab",
helpTagSpaceCardOverview: "Overview & Building the Space",
helpTagSpaceCardUse: "Choosing Tags & Making a Prompt",
helpTagSpace1: "TagSpace places WFS's own data in the EmbeddingGemma 2 vector space and shows it in 3D: Cards (ImagePrompt images with their prompt, shown as thumbnails), Tags (words split out of ImagePrompt prompts, the positive prompts embedded in Gallery images, wildcards, the Tagger DB and the Prompt library, colored by source) and Gallery points (a sample of indexed Gallery images as a faint background, each carrying the tags from its own prompt). Nearby items have similar meanings",
helpTagSpace2: "Requirements: Ollama running with EmbeddingGemma 2 (Gallery > Semantic settings > Model). If the Gallery semantic index was made with Gemini, rebuild it with EmbeddingGemma 2 first",
helpTagSpace10: "Search with a card's or Gallery image's tags: when a card or Gallery point is selected, its prompt tags are shown as buttons (a card's full prompt is under \"Full prompt\"; card tags appear after Build / Update). Click tags to choose them (click again to deselect) and press \"Search with selected\" to search the space with those tags joined in prompt order — the same as typing them into the search box. The choice is kept until another item is selected. While tags are selected, the Add button becomes \"Add selected (N)\" and adds only those tags (in prompt order) as one chip; with none selected it adds the whole item as before. For a Gallery point, \"Open in Gallery\" opens the Gallery tab with the image's folder selected and the image selected in the list (search and other filters are cleared)",
helpTagSpace9: "Choosing how many tags: \"All tags\" uses every candidate tag instead of the Tags number (up to 20,000). \"Min uses\" drops tags used in fewer prompts than this, counted over all sources — 2 removes one-off typos and fragments. \"Wildcards\" turns wildcard files on or off as a tag source: words found only in wildcards make up most of the distinct tags (about 37,000 of 47,600 in testing), so turning it off with All tags gives about 10,400 tags (about 6,800 with Min uses 2). The status line shows the number of candidates when only part of them is used. New tags are embedded once (the first build with many new tags takes a few extra minutes)",
helpTagSpace3: "Build / Update: collects the cards, adds card images that are not yet indexed to the Gallery semantic index, reads the positive prompt embedded in each indexed Gallery image (followed upstream from the sampler's positive input, never the negative; cached in tagspace_prompts.json so only new or changed images are read again), embeds new tags with Ollama (cached in tagspace_tags.npz) and projects everything to 3D with PCA. Tags: how many tags to keep — each source is ranked by how many prompts use a tag and the sources take turns, so the many Gallery prompts do not crowd out the other sources; Gallery points: how many Gallery images to show (0 = none). Prompts are split only at commas (and | { } BREAK), not at spaces; long sentences (over 5 words) are skipped. Images and text are centered separately before PCA so cards and their matching tags overlap. The first build took about 2.5 minutes for the cards plus about 3 minutes to read the prompts of 29,000 Gallery images; rebuilds with caches take seconds",
helpTagSpace4: "Navigation: drag to rotate, right-drag to pan, wheel to zoom. Hover shows the name, thumbnail and prompt/sources; the checkboxes show or hide Cards, Thumbnails, Tags and Gallery. The source checkboxes (ImagePrompt / Gallery prompts / Tagger DB / Prompt library / Wildcards) show or hide tags by where they came from — a tag stays visible while any of its sources is on and takes the color of its first visible source; hidden tags are also left out of the nearby and search lists. The choices are remembered",
helpTagSpace5: "Click a card or tag to select it and list nearby items (clicking only selects — it does not change the prompt). To add it to the Prompt panel, double-click it, press Add next to its name under Selection, or press + in the list (double-click / press again to remove) — cards and tags are ranked separately and listed alternately, so a card also shows its closest tags. Adding a Gallery point adds all tags from that image's prompt as one chip (images without readable tags cannot be added); clicking one lists similar Gallery images (round thumbnails) together with nearby tags and cards; selecting a card or tag, or searching, never lists Gallery images. Use + in the list to add, click a row to move to it. The search box (Enter, any language) places a white marker for the text and lists the nearest items",
helpTagSpace6: "Prompt panel: a card adds its whole prompt, a tag adds the tag, a Gallery image adds its prompt tags. The text joins them with duplicates removed (case and spacing ignored). \"Add to GenerateUI (Positive)\" appends it to the positive prompt of the workflow loaded in GenerateUI; Copy puts it on the clipboard",
helpTagSpace7: "Tagger fill: about a third of Gallery images have no readable positive prompt (imported or edited images, prompts made only of LoRA tags or long sentences). Choose a Tagger model (ONNX models from the Tagger tab) next to \"Tagger fill\" to tag those images on Build / Update: \"Gallery points only\" tags just the sampled Gallery points, \"All images without a prompt\" tags every indexed image that lacks prompt tags. Default thresholds are used (WD 0.35 / character 0.85, PixAI its recommended values) and rating labels are dropped. Results are cached in tagspace_tagger.json per image and model, so later builds only tag new images; stopping keeps what was done. The tags become the \"Tagger fill\" source (shown/hidden like the others) and the tags of those Gallery points, marked \"(Tagger fill)\". The status shows whether the model runs on CUDA or CPU — on the CPU it takes about 0.5 s per image, so check that onnxruntime-gpu is active (see Troubleshooting) before tagging all images",
helpTagSpace8: "Display: \"Glow\" draws points as glowing stars on a night-sky background (dense areas brighten; Gallery points are drawn dimmer so they don't wash out to white) — turn it off for the plain dots and the normal background. \"Twinkle\" (works with Glow) makes tags, cards and Gallery points slowly twinkle, each with its own rhythm; the selection and nearby highlights stay steady. Hover over the image under Selection or the thumbnails in the Nearby list to see an enlarged preview (clicking a list row changes the selection, so hovering lets you check images first). The Add / Remove button sits on the title row of Selection and stays visible while the text scrolls",
helpTaggerTitle: "Tagger Tab",
helpTagger1: "Automatic image tagging using WD Tagger (ONNX), PixAI Tagger v1.0 (ONNX), SwinV2, DeepDanbooru (.h5), and VLM (Ollama / LM Studio / Lemonade / Unsloth) — 3 sub-tabs: Single / Batch / DB",
helpTagger2: "Model placement: put each model in its own subfolder under ComfyUI/models/tagger/<model-name>/; the folder must contain a .onnx file + selected_tags.csv (or .h5 + label file for DeepDanbooru). PixAI Tagger v1.0: use the community ONNX conversion Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8 — one .onnx (model_fp16.onnx recommended on GPU) + selected_tags.csv + preprocess.json in the folder; it is detected automatically",
@@ -1272,7 +1363,7 @@ const LANGUAGES = {
helpImageEditMask11: "Text sub-tool: click on the canvas to open a text stamp overlay; enter text, configure Font / Size / Bold / Italic / Align, choose Mode (Add = white stamp / Erase = cut mask), then click Stamp or press Ctrl+Enter; multi-line text supported (newline in textarea)",
helpImageEditMask12: "Vector sub-tool: click to place control points connected by a Catmull-Rom spline; click the first point again (or press Enter) to close and fill the polygon; Backspace removes the last point; Esc resets all points; Properties pane shows current point count and Mode (Add / Erase)",
helpImageEditMask13: "Shape sub-tool: drag to draw a rectangle or ellipse mask; hold Shift for a perfect square or circle; a blue dashed outline previews the shape while dragging; Properties pane: Mode (Add / Erase), Shape (Rect / Ellipse)",
helpImageEditMask14: "Edit in Mask Editor One (Paint mode only): click \"Edit in Mask Editor One →\" in the MASK EDITOR ONE section to send the current canvas composite — plus the active mask layer's content, if one is selected — to a MaskEditorOne node on the ComfyUI canvas (the currently selected node if it is one, otherwise the first MaskEditorOne node found in the graph) and open its full editor (SAM3, BiRefNet, shapes, etc.) in the ComfyUI browser tab; after clicking Apply there, the result is imported back here as a new mask layer; requires Workflow Studio to have been opened from ComfyUI's top menu button so the ComfyUI tab is reachable, and at least one MaskEditorOne node to exist in the ComfyUI graph",
helpImageEditMask14: "Edit in Mask Editor One (Paint mode only): click \"Edit in Mask Editor One →\" in the MASK EDITOR ONE section to send the current canvas composite — plus the active mask layer's content, if one is selected — to a MaskEditorOne node on the ComfyUI canvas (the currently selected node if it is one, otherwise the first MaskEditorOne node found in the graph) and open its full editor (SAM3, BiRefNet, shapes, etc.) in the ComfyUI browser tab; after clicking Apply there, the result is imported back here as a new mask layer; requires Workflow Studio to have been opened from ComfyUI's top menu button so the ComfyUI tab is reachable, and at least one MaskEditorOne node to exist in the ComfyUI graph; the sent image is also saved to the node (Mask Editor One v0.1.12 or later), so it is still there after reloading the ComfyUI page or switching workflow tabs",
helpImageEditBlurTitle: "Blur Tool (≈)",
helpImageEditBlur1: "Whole Blur: applies a Gaussian blur to the entire active layer — adjust the intensity slider (1–50 px) and click Apply",
helpImageEditBlur2: "Whole Mosaic: applies a pixelation mosaic to the entire active layer — adjust the block size slider (5–100 px) and click Apply",
@@ -1311,8 +1402,8 @@ const LANGUAGES = {
helpTrouble7: "Tagger tab shows no models: verify the model folder exists at ComfyUI/models/tagger/<model-name>/ and contains a .onnx or .h5 file; if onnxruntime is not installed, run: python_embeded\\python.exe -m pip install onnxruntime",
helpTrouble8: "Model tab shows a checkpoint you didn't expect (e.g. always the same model regardless of the loaded workflow): the checkpoint saved in the workflow file is not installed, so it was silently replaced with another available model during loading — an error toast reports the original (missing) model name when this happens. Select the correct checkpoint manually in the Model tab, or enable \"Default Checkpoint\" in Settings to force a known-good model on every load.",
helpTrouble9: "Generate runs a different workflow than the one just loaded: a Batch type checkbox (Checkpoint/LoRA/Prompt/Workflow/Sampler/Scheduler) is left ON in the Batch subtab. While any Batch type is active, the Generate button runs the batch selection instead of the currently loaded workflow. Open the Batch subtab and turn off the active batch type checkbox.",
helpTrouble10: "GPU not detected for EmbeddingGemma 2 (Semantic settings > Model says 'No GPU detected', or the connection test reports CPU): the onnxruntime in ComfyUI's Python is the CPU build, so 'CUDAExecutionProvider' is missing. Fix: stop ComfyUI (files in use cannot be replaced), then in ComfyUI's Python run 'pip uninstall -y onnxruntime onnxruntime-gpu' followed by 'pip install --no-deps onnxruntime-gpu', and start ComfyUI again. It can silently return to the CPU build later: other packages that require 'onnxruntime' (e.g. insightface, rtmlib, qwen-tts) make pip install the CPU build over the GPU files whenever they are installed or updated, so if the GPU disappears after adding a custom node, repeat the fix. Requires an NVIDIA GPU with the CUDA runtime/cuDNN that ComfyUI's PyTorch uses; DirectML is not supported. Without a GPU the CPU is used automatically (slower)",
helpTrouble11: "Semantic Search with Gemini says 'GEMINI_API_KEY is not set' or the key is rejected: add GEMINI_API_KEY=your-key (no leading #) to the plugin's .env file (copy .env.example), then restart ComfyUI - the .env file is only read at startup. Get a key at Google AI Studio. If you do not want to use the API, choose EmbeddingGemma 2 (local, no key) in Semantic settings > Model",
helpTrouble10: "EmbeddingGemma 2 says 'Cannot reach Ollama' or 'not downloaded': start Ollama (it must be running while indexing and searching) and check the Ollama URL in Semantic settings > Model; download the model with 'ollama pull embeddinggemma-2:740m' (or embeddinggemma-2:440m). If indexing fails now and then with 'connection was forcibly closed' errors, security software that filters per-app traffic (e.g. AdGuard) may be interrupting ollama.exe - exclude Ollama from filtering. Failed requests are retried automatically; images that still fail are counted as failed and are picked up again by the next 'New / changed images only' run",
helpTrouble11: "Semantic Search with Gemini says 'GEMINI_API_KEY is not set' or the key is rejected: add GEMINI_API_KEY=your-key (no leading #) to the plugin's .env file (copy .env.example), then restart ComfyUI - the .env file is only read at startup. Get a key at Google AI Studio. If you do not want to use the API, choose EmbeddingGemma 2 (Ollama, local, no key) in Semantic settings > Model",
helpTrouble12: "Semantic Search or Similar shows no results: results only include images that are already indexed inside the selected folder (a green dot in the folder tree means the folder is fully indexed) - build the index from the gear button first, and select a folder that contains indexed images. After changing the model, vector size or image precision, choose 'Rebuild all'. A minimum score set in Semantic settings > Search can also hide everything; set it to 0 to check. The first search after indexing takes a few seconds because the local model is reloaded",
helpSupportTitle: "Support",
helpSupportDesc: "If you find this plugin useful, please consider supporting its development!",
@@ -1586,10 +1677,14 @@ const LANGUAGES = {
videoAssetSetAsLast: "Set as Last Image",
videoAssetSetAsFirstDone: (name) => `Set "${name}" as First Image`,
videoAssetSetAsLastDone: (name) => `Set "${name}" as Last Image`,
videoAssetSetAsRef1: "Set as Reference Image",
videoAssetSetAsRef2: "Set as Reference Image 2",
videoAssetSetAsRef1Done: (name) => `Set "${name}" as Reference Image`,
videoAssetSetAsRef2Done: (name) => `Set "${name}" as Reference Image 2`,
videoNoBlockSelected: "No block selected in Plan",
videoBlockImageUploadFailed: "Failed to upload image to Plan block",
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)",
videoUnsupportedWorkflow: "This workflow does not contain a supported video model node (MiniMax H3, LTX-2.5 Text/Image/First&Last-Frame to Video, Wan2.2 Text to Video, or FastH3 OmniRef Reference to Video)",
videoWorkflowLoadFailed: "Failed to load workflow",
videoConfirmLoadWorkflow: (name) => `Load "${name}" as this plan's workflow?`,
videoPlanMinOneBlock: "A plan needs at least one block",
@@ -1705,10 +1800,10 @@ const LANGUAGES = {
videoEditSoundLength: "Length (s)",
videoEditSoundVolume: "Vol (dB)",
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. The center panel's Plan / Edit / Asset subtabs handle batch generation, clip editing, and browsing generated videos; the sidebar's Project subtab handles saved plans (while Plan is active) or saved Edit projects (while Edit is active).",
helpVideoDesc: "A dedicated video generation tab for MiniMax H3 (Image to Video), LTX-2.5 (Text / Image / First & Last Frame to Video), Wan2.2 (Text to Video), and FastH3 OmniRef (MiniMax H3 Reference to Video) workflows, independent of the GenerateUI tab. The center panel's Plan / Edit / Asset subtabs handle batch generation, clip editing, and browsing generated videos; the sidebar's Project subtab handles saved plans (while Plan is active) or saved Edit projects (while Edit is active).",
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.",
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, a Wan2.2 Text-to-Video node, or a FastH3 OmniRef (MiniMax H3 Reference-to-Video) node — for FastH3 / Pika-H3-Flex the First Image and Last Image fields become Reference Image (ref_image_0) and Reference Image 2 (ref_image_1); leaving either one empty (None / Clear) disconnects that reference input even if the workflow had an image wired to it; Reference Image 2 is never used as the previous block's last frame for \"Use previous block's last frame\" (the actually generated last frame is used instead) — 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; Register as Asset copies the loaded video into the output folder and tags it into Video Assets so it shows up in the Asset subtab), 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 — check \"Add to Video Assets group\" first to also tag the saved frame into Gallery's Video Assets group.",
@@ -2334,32 +2429,31 @@ const LANGUAGES = {
semThTextHint: "0=絞り込みなし",
semThLimit: "最大表示件数:",
semThNote: "スコアの水準はモデルによって違うため(少数画像での実測: 類似画像はEmbeddingGemma 2で約0.6〜0.8、Geminiで約0.6、文章検索はそれぞれ約0.6〜0.7、約0.3)、値はモデルごとに保存されます。閉じたときに、意味検索/類似表示中の一覧へ反映されます。",
semDevice: "実行デバイス:",
semDeviceAuto: "自動(GPUが使えればGPU)",
semDeviceCudaOk: (v) => `GPU (CUDA) を検出 - onnxruntime ${v}`,
semDeviceNoGpu: (v) => `GPU未検出(onnxruntime ${v}・CPUのみ)。GPUを使うには「?」のヘルプを参照`,
semThreads: "CPUスレッド数:",
semThreadsAll: "全コア",
semThreadsHint: "少ないほど画像生成中のPC負荷が軽くなります(作成は遅くなります)",
semSoft: "画像の精度:",
semSoftHigh: "高精度(最も遅い)",
semSoftStd: "標準(約2.5倍速)",
semSoftLight: "軽量(約5倍速)",
semSoftHint: "変更時は「全件再作成」が必要です",
semTestOkProvider: (dim, prov) => `接続OK(ベクトル次元 ${dim}、実行: ${prov})`,
semDotTitle: "セマンティック索引: このフォルダの画像は全件作成済み",
semHelpTitle: "セマンティック検索のヘルプを開く",
semModel: "埋め込みモデル:",
semModelGemini: "Gemini Embedding 2(API)",
semModelLocal: "EmbeddingGemma 2(ローカル・無料)",
semLocalReady: "EmbeddingGemma 2: モデル取得済み(ローカル実行・APIキー不要)",
semLocalNeedDownload: "EmbeddingGemma 2: 初回利用時にモデル(約300MB)をダウンロードします",
sem_err_local_error: (m) => `EmbeddingGemma 2 エラー: ${m}`,
semModelLocal: "EmbeddingGemma 2(Ollama・ローカル・無料)",
semOllamaUrl: "Ollama URL:",
semOllamaTag: "モデルサイズ:",
semOllamaTag740: "740m(テキスト+画像+音声・1.3GB)",
semOllamaTag440: "440m(テキスト+画像・671MB・軽量)",
semOllamaTagHint: "どちらのサイズも同じベクトルを返すため、切り替えても「全件再作成」は不要です。440mは音声エンコーダー(ここでは未使用)を省いた版で、メモリ使用量が少なくなります。",
semOllamaNotPulled: "(未取得)",
semOllamaPullHint: (tag) => `取得コマンド: ollama pull ${tag}`,
semOllamaReady: (tag) => `Ollama: ${tag} 利用可能(ローカル実行・APIキー不要)`,
semOllamaMissing: (tag) => `Ollamaは起動していますが ${tag} が未取得です —「ollama pull ${tag}」を実行してください`,
semOllamaUnreachable: (url) => `Ollama(${url})に接続できません — Ollamaを起動するか、URLを確認してください`,
sem_err_ollama_unreachable: (m) => `Ollamaに接続できません: ${m}`,
sem_err_ollama_model_missing: (m) => `Ollamaのモデルが未取得です —「ollama pull ${m}」を実行してください`,
sem_err_bad_url: (m) => `許可されていないURLです: ${m}`,
sem_err_local_error: (m) => `EmbeddingGemma 2(Ollama)エラー: ${m}`,
semScope: "対象フォルダ:",
semNoFolder: "先にGalleryでフォルダを選択してください",
semIncludeSub: "サブフォルダを含める",
semDimension: "ベクトル次元:",
semDimHint: "大きいほど高精度ですが重くなります。モデルや次元の変更時は「全件再作成」が必要です。",
semDimHint: "大きいほど高精度ですが重くなります。モデル(Gemini / EmbeddingGemma 2)や次元の変更時は「全件再作成」が必要です。",
semMode: "モード:",
semModeMissing: "新規・変更された画像のみ",
semModeAll: "全件再作成(対象フォルダ)",
@@ -2367,7 +2461,7 @@ const LANGUAGES = {
semCancelJob: "停止",
semTest: "接続テスト",
semClear: "インデックスを全削除",
semCostNote: "Gemini Embedding 2には無料枠がありますが、無料枠で送信した内容はGoogleの製品改善に利用される場合があります。無料枠を超えると有料です(2026年10月現在、画像1枚あたり約$0.00012)。インデックス作成時に各画像(縮小)をAPIへ送信します。EmbeddingGemma 2はローカル(CPU)で実行します(1枚あたり約2〜3秒)。検索は保存済みベクトルを使います(送信されるのは検索文のみ)。動画/PSDはサムネイルを使用、音声は対象外です。",
semCostNote: "Gemini Embedding 2には無料枠がありますが、無料枠で送信した内容はGoogleの製品改善に利用される場合があります。無料枠を超えると有料です(2026年10月現在、画像1枚あたり約$0.00012)。インデックス作成時に各画像(縮小)をAPIへ送信します。EmbeddingGemma 2はローカルのOllamaで実行します(NVIDIA GPUで1枚あたり約0.1〜0.2秒)。検索は保存済みベクトルを使います(送信されるのは検索文のみ)。動画/PSDはサムネイルを使用、音声は対象外です。",
semKeyOk: "GEMINI_API_KEY: 設定済み",
semKeyMissing: "GEMINI_API_KEY が未設定です — プラグインの .env に GEMINI_API_KEY=... を追記し、ComfyUIを再起動してください",
semIndexInfo: (n, dim) => `インデックス済み: ${n}枚(ベクトル次元: ${dim})`,
@@ -2465,6 +2559,84 @@ const LANGUAGES = {
tabAi: "AI TOOL",
tabTagger: "Tagger",
tabTagSpace: "TagSpace",
tsBuild: "作成 / 更新",
tsCancel: "中止",
tsMaxTags: "タグ数:",
tsBackground: "Gallery点数:",
tsAllTags: "全タグ",
tsAllTagsHint: "「タグ数」の代わりに候補のタグをすべて使う(上限2万件)",
tsMinCount: "最低出現回数:",
tsMinCountHint: "全出典を合わせて、この回数未満しか使われていないタグを除く",
tsWildcard: "ワイルドカード",
tsWildcardHint: "ワイルドカードをタグの材料に含める(ワイルドカードにしか無い語がタグの種類の大半を占めます)",
tsTagsAvailable: (n) => `(候補 ${n})`,
tsLayerCards: "カード",
tsThumbs: "サムネイル",
tsGlow: "発光",
tsTwinkle: "またたき",
tsLayerTags: "タグ",
tsLayerGallery: "Gallery",
tsSearchPlaceholder: "空間を検索(Enter)…",
tsLoading: "3D表示を読み込み中…",
tsHint: "ドラッグ: 回転 · 右ドラッグ: 移動 · ホイール: ズーム · クリック: 選択 · ダブルクリック: 追加・削除",
tsNotBuilt: "空間がまだ作成されていません。「作成 / 更新」を押してください。",
tsNeedOllama: "OllamaのEmbeddingGemma 2が必要です(Gallery > セマンティック設定 > モデル設定)。",
tsBuilt: (c, g, b, at, ev) => `カード ${c} · タグ ${g} · Gallery点 ${b} · 作成 ${at} · PCA寄与率 ${(ev * 100).toFixed(1)}%`,
tsPhase_cards: () => `ImagePromptカードを収集中…`,
tsPhase_index: (d, n) => `カード画像をGalleryのセマンティック索引に追加中… ${d} / ${n}`,
tsPhase_prompts: (d, n) => `Gallery画像のプロンプトを読み取り中… ${d} / ${n}`,
tsSrc_gallery: "Galleryのプロンプト",
tsImageNoTags: "プロンプト由来のタグなし(この画像からプロンプトを取り出せませんでした)",
tsPhase_tags: (d, n) => `タグを埋め込み中… ${d} / ${n}`,
tsPhase_project: () => `3Dに投影中…`,
tsDetailTitle: "選択中",
tsDetailEmpty: "空間の要素にカーソルを合わせるか、クリックしてください。",
tsNeighborsTitle: "近くの要素",
tsNeighborsOf: (name) => `「${name}」の近く`,
tsSearchTitle: (q) => `検索: ${q}`,
tsPickHint: "タグをクリックで選び、選んだタグで空間を検索できます",
tsPickSearch: (n) => `選択したタグで空間検索(${n})`,
tsPickClear: "選択解除",
tsFullPrompt: "プロンプト全文",
tsAddPicked: (n) => `選択したタグを追加(${n})`,
tsOpenInGallery: "Galleryで開く",
tsRevealFailed: "この画像をGalleryで表示できませんでした(GalleryのOutputフォルダの外にあるか、画像が見つかりません)",
tsChipPicked: (name, n) => `${name}(${n}タグ)`,
tsListEmpty: "要素を選ぶか検索すると、近いカードやタグを一覧表示します。",
tsBuilderTitle: "プロンプト",
tsChipsEmpty: "空間のカードやタグをダブルクリックするか、「追加」・一覧の+で追加できます。",
tsSend: "GenerateUIへ追記(Positive)",
tsCopy: "コピー",
tsClear: "クリア",
tsAdd: "追加",
tsRemove: "削除",
tsSent: "GenerateUIのPositiveプロンプトに追記しました",
tsCopied: "クリップボードにコピーしました",
tsNoWorkflow: "先にGenerateUIでワークフローを読み込んでください",
tsSources: "出典:",
tsKind_card: "カード",
tsKind_tag: "タグ",
tsKind_image: "Gallery画像",
tsSrc_image_prompt: "ImagePrompt",
tsSrc_tagger: "Tagger DB",
tsSrc_prompt_library: "Promptライブラリ",
tsSrc_wildcard: "ワイルドカード",
tsSourceFilterHint: "出典ごとにタグの表示を切り替えます(出典のどれか1つがONならそのタグは表示されます)",
tsTagger: "Tagger補完:",
tsTaggerOff: "OFF",
tsTaggerHint: "プロンプトを取り出せないGallery画像にTaggerモデルでタグを付けます(結果はキャッシュ。GPUが無いとかなり遅くなります)",
tsScope_background: "Gallery点のみ",
tsScope_all: "プロンプトの無い全画像",
tsPhase_tagger: (d, n, note) => `プロンプトの無い画像にタグ付け中… ${d} / ${n}${note ? `(${note})` : ""}`,
tsSrc_tagger_auto: "Tagger補完",
tsTagsFromTagger: "(Tagger補完)",
ts_err_tagspace_tagger_model: (m) => `Taggerモデルを使えません: ${m}`,
ts_err_tagspace_not_built: () => `空間がまだ作成されていません。「作成 / 更新」を押してください。`,
ts_err_tagspace_index_model: (m) => `Galleryのセマンティック索引は ${m} で作られています。TagSpaceにはEmbeddingGemma 2が必要です。Gallery > セマンティック設定で索引を作り直してください。`,
ts_err_tagspace_too_few: () => `カードやタグが少なすぎて空間を作れません。`,
ts_err_tagspace_unknown_item: () => `その要素は空間にありません。空間を作り直してください。`,
ts_err_tagspace_error: (m) => `TagSpaceエラー: ${m}`,
tabImageEdit: "Image Edit",
// -- Tagger Tab --
@@ -2622,7 +2794,7 @@ const LANGUAGES = {
helpGen26: "カタログ作成モーダルの「Outputフォルダにコピーを残さない」チェックボックス:各生成は最初は必ずComfyUIのOutputフォルダへ通常通りファイルを書き出す(ワークフロー自体のSave Imageノードの仕様のため)。このチェックを入れておくと、カタログフォルダへのコピー保存が成功した直後に、そのOutput側の元ファイルを即座に削除する — 200件超の全スタイルなど大規模なカタログ作成でOutputフォルダがほぼ重複したファイルで溢れるのを防げる。特定のスタイルでカタログへのコピー保存自体に失敗した場合、そのOutputファイルは削除されずそのまま残る",
helpGen27: "Inputタブ → Imageサブパネル — 各LoadImageカードにApply(変更なし)・Clear・Placeholderの3ボタンを追加。Clearはそのカードの保留中の選択・プレビューを空に戻す(LoadImageは常に有効なファイル名が必須なため、ワークフローノード自体には触れない)。パネル上部の「Placeholder Image」セクション(使用頻度が低い機能のためデフォルトで折りたたみ、クリックで展開)で共通のデフォルトを設定できる:Colorモード(幅・高さ・色を指定し、その場で単色PNGを生成)またはImageモード(デフォルト画像を1枚ドロップし、そのまま再利用)。各カード自身のPlaceholderボタンを押すと、そのカードの画像だけを設定済みデフォルトへ即座に差し替える(別途Applyクリック不要)— LoadImageが複数ある場合も個別に差し替え可能。Placeholder設定(モード・サイズ・色・デフォルト画像)はセッションをまたいで記憶される",
helpGen3: "5タブ構成 — Input(プロンプト+画像)、Model、Settings、Feeder、Batch — Input/Model/SettingsタブにはRaw JSON列を常時表示",
helpGen4: "Inputタブ:Prompt・Imageの内部タブ切り替え;PromptタブにはPositive Prompt・Negative Promptに加え最下部にEmbeddingsセレクタを表示(Filter+セレクト+Weight入力+Pasteボタン)— Pasteは最後にフォーカスしたテキストエリアのカーソル位置に(embedding:Name:weight)を挿入(未フォーカス時はPositiveに追加);各Applyボタンの左隣の↺ボタンはテキストエリアをノードの現在の適用値に戻す;テキストを選択(または単語・括弧内にカーソルを置くだけでも可)してCtrl+↑/↓を押すと(text:weight)形式で強調weightを±0.05単位で調整(weightが1.0に戻ると括弧を自動解除)",
helpGen4: "Inputタブ:Prompt(左)とImage(右、幅は約3:2)を同一画面に並べて表示(ドラッグ&ドロップ対応)。Prompt/Image領域の幅が約720px以下になるとImageがPromptの下へ折り返し、右端のRaw JSONは»ボタンで細い帯に折りたためる(Inputタブのみ・状態は記憶);PromptエリアにはPositive Prompt・Negative Promptに加え最下部にEmbeddingsセレクタを表示(Filter+セレクト+Weight入力+Pasteボタン)— Pasteは最後にフォーカスしたテキストエリアのカーソル位置に(embedding:Name:weight)を挿入(未フォーカス時はPositiveに追加);各Applyボタンの左隣の↺ボタンはテキストエリアをノードの現在の適用値に戻す;テキストを選択(または単語・括弧内にカーソルを置くだけでも可)してCtrl+↑/↓を押すと(text:weight)形式で強調weightを±0.05単位で調整(weightが1.0に戻ると括弧を自動解除)",
helpGen5: "Modelタブ:Checkpoint/VAE/Diffusion Model(UNETLoader / UnetLoaderGGUF / LoaderGGUF対応)/Text Encoder(CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF対応 — typeおよびdevice選択付き、DualCLIPは2段モデル選択)は常時表示;ControlNetとHypernetwork(Strength入力付き)は使用頻度が低いためデフォルトで折りたたみ — 見出しをクリックで展開;LoRA(Single/Stackタブ)は右側に独立した列を表示;すべてのセレクタにフィルタ検索付き;LoRA Stack — Applyで有効な全LoRAを対象ノードに書き込み、同時にLoRA構文とCivitAIトリガーワードをPositiveプロンプトへ挿入;再Applyでは非アクティブなLoRAを削除し、アクティブなLoRAを再追加してプロンプトを更新",
helpGen28: "Modelタブ — ハイライト色:読み込んだワークフローに実際に該当ノードが含まれる場合、各モデル種別(Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork)のラベルとLoRA列見出しが指定色(デフォルトは明るい緑)で表示される;ControlNet/Hypernetworkが折りたたまれた状態でも色は見えるため、展開しなくても使用有無が一目で分かる;色はSettingsタブでカスタマイズ可能",
helpGen6: "Settingsタブ:KSamplerとLatent Imageを横並び(各50%幅)",
@@ -2794,11 +2966,12 @@ const LANGUAGES = {
helpGallery10: "ワークフロー自動保存:GenerateUIタブで生成した画像はワークフローが自動でギャラリーメタデータに保存され、JSONタブで確認可能",
helpGallery11: "PNG (tEXt/iTXt)、JPEG、WebP、GIF、MP4、WebM、PSD、音声(WAV・MP3・OGG・M4A・FLAC・Opus:波形サムネイル・内蔵プレイヤー・SaveAudio系ノードが書き込むprompt/workflowタグ)対応;PNG形式はComfyUIの埋め込みJSON(prompt / workflow キー、IEND後ろに追記されたチャンクも対象)、WebP形式はEXIF内のworkflow/prompt、MP4/WebM形式はSaveVideoが書き込むコンテナタグ(同キー、MiniMax H3出力等)からワークフロー抽出が可能;ワークフローが無い画像はA1111 / Forge / Fooocusのparametersからプロンプトを表示。音声の波形サムネイルは形式ごとに色分けされます(MP3=青、WAV=緑、FLAC=琥珀、OGG/Opus=紫、M4A=ローズ)。詳細パネルは波形の下にプレイヤーを表示します",
helpGallery31: "Send to LV nodeボタン(ツールバー、Send to LI nodeボタン横):動画版のSend to LI node — 選択動画をアップロードし、そのファイル名をComfyUIキャンバス上で選択中のノード(ネイティブのLoad Videoノードである必要がある)のfileウィジェットへ書き込む;選択中の項目が動画(mp4/webm)の時のみ有効;ComfyUIのトップメニューボタンからWorkflow Studioを起動している必要がある",
helpGallery37: "Send CC Layout / Send CC Imageボタン(ツールバー、ComfyUI Comic Creator内でこのGalleryを開いた場合のみ表示;v0.8.11):Send CC Layoutは選択画像をレイアウトタブの選択中のコマ/オーバーレイへ送る(MP4は動画ツールへ);Send CC ImageはComic CreatorをImageタブへ切り替え、選択画像をそこへ読み込む(作業中のドキュメントがあれば新規レイヤー、なければ新規キャンバス;動画は未対応)",
helpGallery32: "詳細パネル — Promptタブ(既定で選択):埋め込みワークフローから見つかったpositive/negativeプロンプトを一覧表示;cc_nanobananaフォルダの画像はComfyUIワークフローを埋め込んでいないため非表示になり、代わりにNanobananaタブ(v0.7.14)が表示される — 同フォルダのhistory.jsonl生成履歴(ComfyUI Comic CreatorのNanobananaタブが書き込む)に選択画像の対応エントリがある場合のみ表示:engine・model・画像サイズ・seed・日時・実際に使用されたプロンプト/ネガティブプロンプト",
helpGallery33: "Semantic Search(v0.8.2):検索ボックス横の「S」ボタンで意味検索をON/OFFします。ONにすると検索ボックスがGemini Embedding 2またはローカルのEmbeddingGemma 2による意味検索になります(例:「夕暮れの街並み」)。Enterで実行し、結果は類似度順でスコアバッジ付き。OFFの時は従来のファイル名/タグ/プロンプト検索です。ONにするとツールバーに2行目が現れ、Similar・更新ボタン・設定ボタン・結果件数が左詰めで表示されます。設定ボタン(歯車)のウィンドウで、選択中フォルダ(サブフォルダ含む指定可)のインデックスを作成/更新/削除します。モデルはラジオボタンで選択します(Geminiはプラグインの.envにGEMINI_API_KEYの設定+ComfyUI再起動が必要、EmbeddingGemma 2はローカル実行で初回にモデルを自動ダウンロード)。モデルやベクトル次元を変えるときは「全件再作成」が必要です。検索範囲は選択中フォルダ配下で、意味検索の結果にはソートやタグ/グループフィルタは適用されません",
helpGallery33: "Semantic Search(v0.8.2):検索ボックス横の「S」ボタンで意味検索をON/OFFします。ONにすると検索ボックスがGemini Embedding 2、またはOllamaで動かすEmbeddingGemma 2による意味検索になります(例:「夕暮れの街並み」)。Enterで実行し、結果は類似度順でスコアバッジ付き。OFFの時は従来のファイル名/タグ/プロンプト検索です。ONにするとツールバーに2行目が現れ、Similar・更新ボタン・設定ボタン・結果件数が左詰めで表示されます。設定ボタン(歯車)のウィンドウで、選択中フォルダ(サブフォルダ含む指定可)のインデックスを作成/更新/削除します。モデルはラジオボタンで選択します(Geminiはプラグインの.envにGEMINI_API_KEYの設定+ComfyUI再起動が必要、EmbeddingGemma 2はローカルでOllamaを起動し、モデルを取得しておく必要があります:ollama pull embeddinggemma-2:740m または embeddinggemma-2:440m)。モデルやベクトル次元を変えるときは「全件再作成」が必要です。検索範囲は選択中フォルダ配下で、意味検索の結果にはソートやタグ/グループフィルタは適用されません",
helpGallery34: "Similarトグルと更新ボタン(ツールバー2行目、SがONの間に表示):Similarで選択中の画像に類似した画像を一覧表示します(未インデックスの画像はその場で埋め込み)。類似一覧の中の別の画像を選択しても一覧はそのままで、更新ボタンを押すとその画像の類似画像を表示、Similarをもう一度押すと通常の一覧に戻ります。フォルダ切替・フィルタクリア・SをOFFにした場合も類似表示は解除されます",
helpGallery35: "EmbeddingGemma 2の速度:既定ではCPU(コアの半分)で動作し、高精度設定で1枚あたり約6秒です。「画像の精度」は精度と速度の引き換えで(標準で約2.5倍、軽量で約5倍速。ベクトルが変わるため変更時は「全件再作成」が必要)、CPUスレッド数を減らすと画像生成中のPC負荷が軽くなります。NVIDIA GPUを使うにはComfyUIのPythonにonnxruntime-gpuを入れ(pip uninstall onnxruntime のあと pip install onnxruntime-gpu。ComfyUIのPyTorchが使うCUDAランタイム/cuDNNが利用されます)、ComfyUIを再起動してください:1枚あたり約0.1秒(RTX 4070で実測、CPUの約45倍速)で、結果はCPUと同一です。DirectMLは非対応です(画像モデルが動作しません)。モデルはインデックス作成の完了後にメモリから解放され、次回の検索時に再ロードされます",
helpGallery36: "モーダルのタブとしきい値:セマンティック設定ウィンドウは3つのタブ構成です。インデックス(対象フォルダ・再作成モード・進捗・全削除)、モデル設定(Gemini / EmbeddingGemma 2・ベクトル次元・デバイス・CPUスレッド数・画像精度・接続テスト)、検索設定。検索設定タブでは、類似画像結果の最小スコア(例:0.6なら類似度0.6以上のみ表示)、文章検索の最小スコア、最大表示件数を指定できます。スコアの水準はモデルで違うため値はモデルごとに保存され、一覧の見出しに適用中のしきい値が表示されます",
helpGallery35: "EmbeddingGemma 2はOllamaで実行します(内蔵のONNX実行は廃止したため、そのためのonnxruntime-gpuは不要になりました)。モデル設定タブでOllama URL(既定はhttp://localhost:11434。他のホストはWFS_ALLOWED_BACKEND_HOSTSへの登録が必要)とモデルサイズを指定します:740m(テキスト+画像+音声)または440m(テキスト+画像・軽量)。どちらも同じベクトルを返すため、サイズを切り替えても再作成は不要です。「:latest」タグは740mと同じもので、740mが未取得なら代わりに使われます。270mと570mは画像を扱えないため選択肢にありません。以前のONNX版で作ったインデックスもそのまま使えます(ベクトルはほぼ一致します。完全に作り直したい場合は「全件再作成」)。画像は4枚ずつまとめて送信します(NVIDIA GPUで1枚あたり約0.1〜0.2秒)。モデルはインデックス作成の完了後にVRAMから外され、次回の検索時にOllamaが再ロードします",
helpGallery36: "モーダルのタブとしきい値:セマンティック設定ウィンドウは3つのタブ構成です。インデックス(対象フォルダ・再作成モード・進捗・全削除)、モデル設定(Gemini / EmbeddingGemma 2・ベクトル次元・Ollama URL・モデルサイズ・接続テスト)、検索設定。検索設定タブでは、類似画像結果の最小スコア(例:0.6なら類似度0.6以上のみ表示)、文章検索の最小スコア、最大表示件数を指定できます。スコアの水準はモデルで違うため値はモデルごとに保存され、一覧の見出しに適用中のしきい値が表示されます",
helpGallery28: "「PSD作成」一括操作ボタン:選択中の全画像を1つのレイヤー付きPSDファイルにまとめてダウンロードする — 各画像はファイル名を冠した独立レイヤーとなり、選択画像中の最大サイズに合わせたキャンバスに左上基準で配置される;最後に選択した画像が最前面になる 変換...一括ボタン(音声/動画を選択すると表示):音声ファイル(動画は音声トラックを抽出)をFLAC / MP3 / Opus / M4A / WAVへ変換して同じフォルダに別ファイルで保存します(ビットレート・サンプルレート・チャンネル指定可)。prompt/workflowタグはタグを持てる形式で引き継がれ(WAVは対象外)、お気に入り・タグ・メモ・グループの引き継ぎや、変換後の元ファイル削除も選べます。",
helpGallery29: "「レイヤーとして編集」一括操作ボタン:Image Editタブに切り替え、選択中の全画像を一度に開き、それぞれ独立したレイヤーとして展開する(選択中に動画ファイルが含まれる場合はスキップされる);最後に選択した画像が最前面になる",
helpGallery30: "PSDファイル:サムネイル・フルサイズプレビューは全レイヤーを合成した結果を表示する(非表示レイヤーは除外される);元のPSDファイル自体は変更されず、Gallery上のプレビューのみが合成済みの表示になる",
@@ -2820,6 +2993,19 @@ const LANGUAGES = {
helpGallery26: "Galleryタブ上部の4つのサブタブ:Output(このブラウザ)・ImagePrompt・Style_Catalog・Metadata — 最後のMetadataは独立したMetadataタブ(該当ヘルプページ参照)をそのまま内包しているため、Galleryを離れずに画像をドロップして埋め込みモデル/プロンプト情報を確認できます",
// -- Tagger Tab --
helpTagSpaceTitle: "TagSpaceタブ",
helpTagSpaceCardOverview: "概要・空間の作成",
helpTagSpaceCardUse: "タグを選んでプロンプトを作る",
helpTagSpace1: "TagSpaceは、WFS内のデータをEmbeddingGemma 2のベクトル空間に置いて3Dで表示します。カード(ImagePromptの画像とそのプロンプト。サムネイルで表示)、タグ(ImagePromptのプロンプト・Gallery画像に埋め込まれたPositiveプロンプト・ワイルドカード・Tagger DB・Promptライブラリの文を分解した語。出典ごとに色分け)、Gallery点(索引済みのGallery画像の一部を薄い背景として表示。それぞれ自分のプロンプト由来のタグを持つ)の3種類です。近くにあるものほど意味が近くなります",
helpTagSpace2: "必要なもの:OllamaとEmbeddingGemma 2(Gallery > セマンティック設定 > モデル設定)。Galleryのセマンティック索引をGeminiで作っている場合は、先にEmbeddingGemma 2で作り直してください",
helpTagSpace10: "カード・Gallery画像のタグで空間検索:カードやGallery点を選ぶと、プロンプトのタグがボタンで表示されます(カードのプロンプト全文は「プロンプト全文」で表示。カードのタグは「作成 / 更新」後に表示されます)。タグをクリックして選び(もう一度で解除)、「選択したタグで空間検索」を押すと、選んだタグをプロンプトの順につないだ文で空間を検索します(検索欄に入力した場合と同じ)。選択は別の要素を選ぶまで保持されます。タグを選んでいる間は「追加」ボタンが「選択したタグを追加(N)」に変わり、選んだタグだけを(プロンプトの順で)1つのチップとして追加します。選んでいなければ、これまでどおり全体を追加します。Gallery点では「Galleryで開く」で、ギャラリータブのその画像のフォルダを開き、一覧でその画像を選んだ状態にします(検索などの絞り込みは解除されます)",
helpTagSpace9: "タグの選び方:「全タグ」をオンにすると「タグ数」の代わりに候補のタグをすべて使います(上限2万件)。「最低出現回数」は、全出典を合わせてその回数未満しか使われていないタグを除きます(2にすると1回だけの表記ゆれや断片が消えます)。「ワイルドカード」はワイルドカードをタグの材料に含めるかどうかです。ワイルドカードにしか出てこない語がタグの種類の大半を占めるため(検証環境では4.76万種中約3.7万種)、オフにして全タグにすると約1.04万種(最低出現回数2なら約6,800種)になります。候補の一部だけを使ったときは、状態表示に候補数も出ます。新しいタグは一度だけ埋め込みます(新しいタグが多い初回の作成は数分長くかかります)",
helpTagSpace3: "「作成 / 更新」:カードを集め、まだ索引にないカード画像をGalleryのセマンティック索引に追加し、索引済みのGallery画像に埋め込まれたPositiveプロンプトを読み取り(サンプラーのpositive入力から上流をたどり、negative側はたどらない。tagspace_prompts.jsonにキャッシュし、2回目以降は新しい画像・変更された画像だけを読む)、新しいタグをOllamaで埋め込み(tagspace_tags.npzにキャッシュ)、PCAで3Dに投影します。「タグ数」は残すタグの数で、出典ごとに「そのタグを使った文の数」で順位を付け、出典を順番に取るので、数の多いGalleryのプロンプトだけで埋まることはありません。「Gallery点数」は表示するGallery画像の数(0で表示なし)。プロンプトはカンマ(と | { } BREAK)でだけ区切り、スペースでは区切りません。5語を超える文章は除きます。画像とテキストはそれぞれ中心をそろえてから投影し、カードと対応するタグが重なるようにしています。初回はカードの準備に約2.5分、Gallery画像2.9万枚のプロンプト読み取りに約3分かかりました。キャッシュがあれば数秒です",
helpTagSpace4: "操作:ドラッグで回転、右ドラッグで移動、ホイールでズーム。カーソルを合わせると名前・サムネイル・プロンプト/出典を表示します。チェックボックスでカード・サムネイル・タグ・Galleryの表示を切り替えます。出典のチェックボックス(ImagePrompt/Galleryのプロンプト/Tagger DB/Promptライブラリ/ワイルドカード)では、タグを出典ごとに表示・非表示にできます。出典のどれか1つがONならそのタグは表示され、色は表示中の出典のうち最初のものになります。非表示のタグは近くの要素・検索結果の一覧からも除かれます。選択は保存されます",
helpTagSpace5: "カードやタグをクリックすると選択され、近くの要素が一覧表示されます(クリックだけではプロンプトは変わりません)。プロンプト欄に追加するには、ダブルクリックするか、「選択中」の名前の横の「追加」、または一覧の+を押します(もう一度ダブルクリック・押すと削除)。カードとタグは別々に順位付けして交互に並べるので、カードを選ぶと近いタグも出ます。Gallery点を追加すると、その画像のタグをまとめて1つのチップになります(タグの無い画像は追加できません)。Gallery点をクリックすると、似ているGallery画像(丸いサムネイル)を近いタグ・カードと一緒に一覧表示します。カードやタグを選んだときと検索のときは、Gallery画像は一覧に入りません。一覧の+で追加、行のクリックでその位置へ移動します。検索欄(Enter・日本語可)では文章の位置に白い印を置き、近い要素を一覧にします",
helpTagSpace6: "プロンプト欄:カードはプロンプト全体、タグはタグそのもの、Gallery画像はそのプロンプト由来のタグを追加します。重複(大文字小文字・空白の違いは無視)を除いて連結します。「GenerateUIへ追記(Positive)」でGenerateUIに読み込んだワークフローのPositiveプロンプトに追記、「コピー」でクリップボードにコピーします",
helpTagSpace7: "Tagger補完:Gallery画像の約3分の1は、Positiveプロンプトを取り出せません(読み込んだ画像・編集した画像、LoRA指定や長い文章だけのプロンプトなど)。「Tagger補完」でTaggerモデル(TaggerタブのONNXモデル)を選ぶと、「作成 / 更新」のときにそれらの画像へタグを付けます。「Gallery点のみ」は表示するGallery点だけ、「プロンプトの無い全画像」は索引済みでプロンプト由来のタグが無いすべての画像が対象です。しきい値は既定値(WDは0.35/キャラクター0.85、PixAIは推奨値)で、評価(rating)ラベルは除きます。結果は画像とモデルごとにtagspace_tagger.jsonへキャッシュするので、2回目以降は新しい画像だけを処理します。中止してもそこまでの結果は残ります。付いたタグは出典「Tagger補完」として他の出典と同じように表示・非表示でき、該当するGallery点のタグにもなります(「(Tagger補完)」と表示)。進み具合の表示にモデルの実行先(CUDA/CPU)が出ます。CPUでは1枚あたり約0.5秒かかるので、全画像を対象にする前にonnxruntime-gpuが有効か確認してください(トラブルシューティング参照)",
helpTagSpace8: "表示:「発光」は点を夜空の背景に光る星のように描きます(密集した場所ほど明るくなります。数の多いGallery点は白く飛ばないよう控えめにしています)。オフにすると元の丸い点と通常の背景に戻ります。「またたき」(発光がオンのときに有効)は、タグ・カード・Gallery点を点ごとに違うリズムでゆっくり瞬かせます。選択中・近傍の強調表示は瞬きません。「選択中」の画像や「近く」の一覧のサムネイルにマウスを乗せると拡大表示されます(一覧の行をクリックすると選択が変わるので、乗せるだけで画像を確認できます)。追加/削除ボタンは「選択中」の名前の行にあり、本文をスクロールしても隠れません",
helpTaggerTitle: "Taggerタブ",
helpTagger1: "WD Tagger(ONNX)・PixAI Tagger v1.0(ONNX)・SwinV2・DeepDanbooru(.h5)・VLM(Ollama / LM Studio / Lemonade / Unsloth)による自動タグ付け — サブタブ: Single / Batch / DB",
helpTagger2: "モデル配置:ComfyUI/models/tagger/<モデル名>/ 以下に各モデルのフォルダを作成し、.onnx + selected_tags.csv(DeepDanbooruは .h5 + ラベルファイル)を格納。PixAI Tagger v1.0 はコミュニティ変換版 Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8 を使用し、フォルダに .onnx を1つ(GPUなら model_fp16.onnx 推奨)+ selected_tags.csv + preprocess.json を置くと自動判別",
@@ -2986,7 +3172,7 @@ const LANGUAGES = {
helpImageEditMask11: "Text サブツール:キャンバスをクリックするとテキストスタンプオーバーレイを表示;テキストを入力し Font / Size / Bold / Italic / Align と Mode(Add = 白スタンプ / Erase = マスク削除)を設定して「Stamp」またはCtrl+Enterで確定;テキストエリア内の改行で複数行対応",
helpImageEditMask12: "Vector サブツール:クリックでCatmull-Romスプラインの制御点を追加;最初の点を再クリック(またはEnter)で閉じてポリゴンを塗りつぶし;Backspaceで直前の点を削除;Escで全点をリセット;プロパティペインに現在の点数とMode(Add / Erase)を表示",
helpImageEditMask13: "Shape サブツール:ドラッグで矩形または楕円のマスクを描画;Shift押下で正方形/正円;ドラッグ中は青の点線でプレビュー表示;プロパティペイン:Mode(Add / Erase)・Shape(Rect / Ellipse)",
helpImageEditMask14: "Edit in Mask Editor One(Paint モードのみ):MASK EDITOR ONE セクションの「Edit in Mask Editor One →」をクリックすると、現在のキャンバス合成画像(アクティブレイヤーがマスクレイヤーの場合はその内容も)が、ComfyUI キャンバス上の MaskEditorOne ノード(選択中のノードがそれなら優先、無ければグラフ内で最初に見つかったノード)へ送信され、ComfyUI 側のブラウザタブで実際のエディタ(SAM3・BiRefNet・シェイプなど)が開く;そこで Apply をクリックすると結果がこちら側に新規マスクレイヤーとして取り込まれる;ComfyUI のトップメニューボタンから Workflow Studio を起動していること、ComfyUI のグラフに MaskEditorOne ノードが1つ以上存在することが必要",
helpImageEditMask14: "Edit in Mask Editor One(Paint モードのみ):MASK EDITOR ONE セクションの「Edit in Mask Editor One →」をクリックすると、現在のキャンバス合成画像(アクティブレイヤーがマスクレイヤーの場合はその内容も)が、ComfyUI キャンバス上の MaskEditorOne ノード(選択中のノードがそれなら優先、無ければグラフ内で最初に見つかったノード)へ送信され、ComfyUI 側のブラウザタブで実際のエディタ(SAM3・BiRefNet・シェイプなど)が開く;そこで Apply をクリックすると結果がこちら側に新規マスクレイヤーとして取り込まれる;ComfyUI のトップメニューボタンから Workflow Studio を起動していること、ComfyUI のグラフに MaskEditorOne ノードが1つ以上存在することが必要;送信した画像はノードにも保存される(Mask Editor One v0.1.12 以降)ため、ComfyUI ページの再読み込みやワークフロータブの切り替え後も残る",
helpImageEditBlurTitle: "Blur ツール (≈)",
helpImageEditBlur1: "Whole Blur:アクティブレイヤー全体にガウスぼかしを適用 — 強度スライダー(1〜50 px)で調整してApplyをクリック",
helpImageEditBlur2: "Whole Mosaic:アクティブレイヤー全体にピクセル化モザイクを適用 — ブロックサイズスライダー(5〜100 px)で調整してApplyをクリック",
@@ -3025,8 +3211,8 @@ const LANGUAGES = {
helpTrouble7: "Taggerタブにモデルが表示されない:ComfyUI/models/tagger/<モデル名>/ フォルダの存在と .onnx または .h5 ファイルの有無を確認;onnxruntimeが未インストールの場合は python_embeded\\python.exe -m pip install onnxruntime を実行",
helpTrouble8: "ModelタブのCheckpointが想定と違うモデルになっている(どのワークフローを読み込んでも同じモデルになる等):ワークフローファイルに保存されたCheckpointが実際にはインストールされておらず、読み込み時に無警告で別のインストール済みモデルに差し替えられています。この場合、元の(見つからなかった)モデル名を含むエラートーストが表示されます。Modelタブで正しいCheckpointを手動選択するか、設定タブの「デフォルトCheckpoint」を有効にして、読み込み時に常に動作確認済みのモデルを強制適用してください。",
helpTrouble9: "Generateを押すと、読み込んだワークフローとは別のワークフローで実行される:Batchサブタブでバッチタイプ(Checkpoint/LoRA/Prompt/Workflow/Sampler/Scheduler)のチェックボックスがONのまま残っています。いずれかのバッチタイプが有効な間は、Generateボタンは現在読み込まれているワークフローではなくバッチ選択された内容を実行します。Batchサブタブを開き、有効になっているバッチタイプのチェックボックスをOFFにしてください。",
helpTrouble10: "EmbeddingGemma 2でGPUが検出されない(セマンティック設定のモデル設定タブに「GPU未検出」と出る、または接続テストの実行がCPUになる):ComfyUIのPythonに入っているonnxruntimeがCPU版で、CUDAExecutionProviderが無い状態です。対処:ComfyUIを停止し(使用中のファイルは置き換えられません)、ComfyUIのPythonで「pip uninstall -y onnxruntime onnxruntime-gpu」のあと「pip install --no-deps onnxruntime-gpu」を実行して、ComfyUIを起動し直します。後からCPU版に戻ることがあります:「onnxruntime」を名前で要求する他のパッケージ(insightface・rtmlib・qwen-ttsなど)をインストール・更新するたびに、pipがGPU版のファイルの上にCPU版を入れ直すためです。カスタムノードを追加した後にGPUが使えなくなったら、同じ手順をやり直してください。NVIDIA GPUと、ComfyUIのPyTorchが使うCUDAランタイム/cuDNNが必要です(DirectMLは非対応)。GPUが無い場合は自動でCPUが使われます(低速)",
helpTrouble11: "GeminiでSemantic Searchを使うと「GEMINI_API_KEYが未設定」と出る、またはキーが拒否される:プラグインの.env(.env.exampleをコピー)にGEMINI_API_KEY=キー(行頭に#を付けない)を追記し、ComfyUIを再起動してください。.envは起動時にしか読み込まれません。キーはGoogle AI Studioで取得できます。APIを使いたくない場合は、セマンティック設定のモデル設定でEmbeddingGemma 2(ローカル・キー不要)を選びます",
helpTrouble10: "EmbeddingGemma 2で「Ollamaに接続できません」「未取得です」と出る:Ollamaを起動し(インデックス作成中と検索時に起動している必要があります)、セマンティック設定のモデル設定タブでOllama URLを確認してください。モデルは「ollama pull embeddinggemma-2:740m」(または embeddinggemma-2:440m)で取得します。インデックス作成が「connection was forcibly closed」などで時々失敗する場合は、アプリ単位で通信をフィルタするセキュリティソフト(AdGuardなど)がollama.exeの通信に割り込んでいる可能性があります。Ollamaをフィルタ対象から外してください。失敗したリクエストは自動で再試行され、それでも失敗した画像は失敗件数に数えられ、次回の「新規・変更された画像のみ」で再処理されます",
helpTrouble11: "GeminiでSemantic Searchを使うと「GEMINI_API_KEYが未設定」と出る、またはキーが拒否される:プラグインの.env(.env.exampleをコピー)にGEMINI_API_KEY=キー(行頭に#を付けない)を追記し、ComfyUIを再起動してください。.envは起動時にしか読み込まれません。キーはGoogle AI Studioで取得できます。APIを使いたくない場合は、セマンティック設定のモデル設定でEmbeddingGemma 2(Ollama・ローカル・キー不要)を選びます",
helpTrouble12: "意味検索やSimilarの結果が出ない:結果には選択中フォルダ内でインデックス済みの画像だけが入ります(フォルダツリーの緑のドットは全件済み)。先に歯車ボタンからインデックスを作成し、インデックス済みの画像があるフォルダを選んでください。モデル・ベクトル次元・画像精度を変えたときは「全件再作成」が必要です。セマンティック設定の検索設定タブの最小スコアで全件が隠れている場合もあるので、0にして確認してください。インデックス作成直後の最初の検索は、ローカルモデルの再ロードで数秒かかります",
helpSupportTitle: "サポート",
helpSupportDesc: "このプラグインが役に立ったら、開発を支援していただけると嬉しいです!",
@@ -3300,10 +3486,14 @@ const LANGUAGES = {
videoAssetSetAsLast: "Last Imageに設定",
videoAssetSetAsFirstDone: (name) => `"${name}" をFirst Imageに設定しました`,
videoAssetSetAsLastDone: (name) => `"${name}" をLast Imageに設定しました`,
videoAssetSetAsRef1: "Reference Imageに設定",
videoAssetSetAsRef2: "Reference Image 2に設定",
videoAssetSetAsRef1Done: (name) => `"${name}" をReference Imageに設定しました`,
videoAssetSetAsRef2Done: (name) => `"${name}" をReference Image 2に設定しました`,
videoNoBlockSelected: "Planでブロックが選択されていません",
videoBlockImageUploadFailed: "Planブロックへの画像アップロードに失敗しました",
videoNoWorkflowLoaded: "ワークフローが読み込まれていません",
videoUnsupportedWorkflow: "このワークフローには対応する動画モデルノード(MiniMax H3、LTX-2.5のText/Image/First&Last-Frame to Video、またはWan2.2のText to Video)が含まれていません",
videoUnsupportedWorkflow: "このワークフローには対応する動画モデルノード(MiniMax H3、LTX-2.5のText/Image/First&Last-Frame to Video、Wan2.2のText to Video、またはFastH3 OmniRefのReference to Video)が含まれていません",
videoWorkflowLoadFailed: "ワークフローの読み込みに失敗しました",
videoConfirmLoadWorkflow: (name) => `「${name}」をこのPlanのワークフローとして読み込みますか?`,
videoPlanMinOneBlock: "Planには最低1つのブロックが必要です",
@@ -3419,10 +3609,10 @@ const LANGUAGES = {
videoEditSoundLength: "長さ(秒)",
videoEditSoundVolume: "音量(dB)",
helpVideoTitle: "Video タブ",
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選択中なら保存済みPlan一覧、Edit選択中なら保存済みEditプロジェクト一覧を扱います。",
helpVideoDesc: "MiniMax H3 (Image to Video)、LTX-2.5 (Text / Image / First & Last Frame to Video)、Wan2.2 (Text to Video)、FastH3 OmniRef (MiniMax H3 Reference to Video) ワークフロー対応の動画生成タブ。GenerateUIタブとは独立して動作します。中央パネルのPlan/Edit/Assetサブタブがバッチ生成・クリップ編集・生成済み動画の閲覧を扱い、左サイドバーのProjectサブタブは中央がPlan選択中なら保存済みPlan一覧、Edit選択中なら保存済みEditプロジェクト一覧を扱います。",
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が作成されます。対応していないワークフローはエラー表示になります。",
helpVideo3: "Workflowタブの詳細モーダルにある「Videoに読み込み」ボタンから、MiniMax H3のImage to Videoノード、LTX-2.5のText/Image/First&Last-Frame to Videoノード、Wan2.2のText to Videoノード、またはFastH3 OmniRef(MiniMax H3のReference to Video)ノードを含むワークフロー(FastH3 / Pika-H3-FlexではFirst Image欄・Last Image欄がReference Image(ref_image_0)・Reference Image 2(ref_image_1)になります。未指定(None / Clear)の参照画像は、ワークフロー側で画像が接続されていても接続を外して生成します。Reference Image 2は「前ブロックの最終フレームを使う」の最終フレームとしては扱われず、実際に生成された最終フレームが使われます)を読み込めます。この操作でワークフローの現在値を反映したブロック1個の新規Planが作成されます。対応していないワークフローはエラー表示になります。",
helpVideo4: "生成した動画(mp4)はAssetサブタブのVideo Tempグループに自動的に反映されるほか、Galleryタブでも閲覧・再生できます。残したい動画をVideo Assetsへ整理するタイミングはユーザー任意です。",
helpVideo5: "中央パネルには2つのプレビューがあります。左側はAssetサブタブで選択した動画、または左隣の「Video Source」パネルにドロップ/選択した任意のローカル動画を表示し(Clearでリセット。「アセット登録」で読み込んだ動画をoutputフォルダにコピーしてVideo Assetsに登録し、Assetサブタブに表示できます)、読み込んだワークフローを実行せずにFrame/GIF機能を使えます。右側は常に直近で生成されたクリップを表示します。",
helpVideo6: "Frameタブ(右パネル): プレビュー動画を再生・シークして止めたい位置で「Capture Frame」を押すとその場でフレームをキャプチャし、「Save to Output」でPNGとしてComfyUIのOutputフォルダに保存します。保存前に「Add to Video Assets group」にチェックを入れると、保存したフレームをGalleryのVideo Assetsグループにも自動登録できます。",
@@ -4048,32 +4238,31 @@ const LANGUAGES = {
semThTextHint: "0=不过滤",
semThLimit: "最大显示数量:",
semThNote: "不同模型的分数水平不同(少量图像的实测:相似图像在EmbeddingGemma 2约0.6-0.8,Gemini约0.6;文字搜索分别约0.6-0.7和约0.3),因此按模型分别保存。关闭窗口时会应用到正在显示的语义搜索/相似列表。",
semDevice: "运行设备:",
semDeviceAuto: "自动(可用则用GPU)",
semDeviceCudaOk: (v) => `检测到GPU (CUDA) - onnxruntime ${v}`,
semDeviceNoGpu: (v) => `未检测到GPU(onnxruntime ${v},仅CPU)。使用GPU请参见“?”帮助`,
semThreads: "CPU线程数:",
semThreadsAll: "全部核心",
semThreadsHint: "线程越少,生成图像时对电脑的负载越轻(创建会变慢)",
semSoft: "图像精度:",
semSoftHigh: "高精度(最慢)",
semSoftStd: "标准(约快2.5倍)",
semSoftLight: "轻量(约快5倍)",
semSoftHint: "更改后需要“全部重建”",
semTestOkProvider: (dim, prov) => `连接正常(向量维度 ${dim},运行于 ${prov})`,
semDotTitle: "语义索引:此文件夹中的图像已全部创建",
semHelpTitle: "打开语义搜索的帮助",
semModel: "嵌入模型:",
semModelGemini: "Gemini Embedding 2(API)",
semModelLocal: "EmbeddingGemma 2(本地・免费)",
semLocalReady: "EmbeddingGemma 2:模型已下载(本地运行,无需API密钥)",
semLocalNeedDownload: "EmbeddingGemma 2:首次使用时将下载模型(约300MB)",
sem_err_local_error: (m) => `EmbeddingGemma 2错误:${m}`,
semModelLocal: "EmbeddingGemma 2(Ollama・本地・免费)",
semOllamaUrl: "Ollama URL:",
semOllamaTag: "模型大小:",
semOllamaTag740: "740m(文本+图像+音频・1.3GB)",
semOllamaTag440: "440m(文本+图像・671MB・轻量)",
semOllamaTagHint: "两种大小返回相同的向量,因此切换后无需“全部重建”。440m去掉了音频编码器(此处未使用),占用内存更少。",
semOllamaNotPulled: "(未下载)",
semOllamaPullHint: (tag) => `下载命令:ollama pull ${tag}`,
semOllamaReady: (tag) => `Ollama:${tag} 可用(本地运行,无需API密钥)`,
semOllamaMissing: (tag) => `Ollama已启动,但尚未下载 ${tag} — 请执行“ollama pull ${tag}”`,
semOllamaUnreachable: (url) => `无法连接Ollama(${url})— 请启动Ollama或检查URL`,
sem_err_ollama_unreachable: (m) => `无法连接Ollama:${m}`,
sem_err_ollama_model_missing: (m) => `尚未下载Ollama模型 — 请执行“ollama pull ${m}”`,
sem_err_bad_url: (m) => `不允许的URL:${m}`,
sem_err_local_error: (m) => `EmbeddingGemma 2(Ollama)错误:${m}`,
semScope: "目标文件夹:",
semNoFolder: "请先在Gallery中选择文件夹",
semIncludeSub: "包含子文件夹",
semDimension: "向量维度:",
semDimHint: "越大越精确但越重。更改模型或维度后需要“全部重建”。",
semDimHint: "越大越精确但越重。更改模型(Gemini / EmbeddingGemma 2)或维度后需要“全部重建”。",
semMode: "模式:",
semModeMissing: "仅新增/已更改的图像",
semModeAll: "全部重建(目标文件夹)",
@@ -4081,7 +4270,7 @@ const LANGUAGES = {
semCancelJob: "停止",
semTest: "连接测试",
semClear: "删除全部索引",
semCostNote: "Gemini Embedding 2有免费额度,但免费额度内发送的内容可能被Google用于改进其产品;超出免费额度后需付费(截至2026年10月,每张图像约$0.00012)。创建索引时会将每张图像(缩小后)发送到API;EmbeddingGemma 2在本地CPU运行(每张约2-3秒)。搜索使用已保存的向量(仅发送搜索文字)。视频/PSD使用缩略图,音频不在范围内。",
semCostNote: "Gemini Embedding 2有免费额度,但免费额度内发送的内容可能被Google用于改进其产品;超出免费额度后需付费(截至2026年10月,每张图像约$0.00012)。创建索引时会将每张图像(缩小后)发送到API;EmbeddingGemma 2在本地Ollama中运行(使用NVIDIA GPU时每张约0.1-0.2秒)。搜索使用已保存的向量(仅发送搜索文字)。视频/PSD使用缩略图,音频不在范围内。",
semKeyOk: "GEMINI_API_KEY:已设置",
semKeyMissing: "未设置GEMINI_API_KEY — 请在插件的 .env 中添加 GEMINI_API_KEY=... 并重启ComfyUI",
semIndexInfo: (n, dim) => `已索引:${n}张(向量维度:${dim})`,
@@ -4179,6 +4368,84 @@ const LANGUAGES = {
tabAi: "AI TOOL",
tabTagger: "Tagger",
tabTagSpace: "TagSpace",
tsBuild: "创建 / 更新",
tsCancel: "停止",
tsMaxTags: "标签数:",
tsBackground: "Gallery点数:",
tsAllTags: "全部标签",
tsAllTagsHint: "不使用“标签数”,而是使用所有候选标签(上限2万个)",
tsMinCount: "最少出现次数:",
tsMinCountHint: "排除所有来源合计中使用次数少于该值的标签",
tsWildcard: "通配符",
tsWildcardHint: "将通配符作为标签来源(只出现在通配符中的词占标签种类的大部分)",
tsTagsAvailable: (n) => `(候选 ${n})`,
tsLayerCards: "卡片",
tsThumbs: "缩略图",
tsGlow: "发光",
tsTwinkle: "闪烁",
tsLayerTags: "标签",
tsLayerGallery: "Gallery",
tsSearchPlaceholder: "在空间中搜索(Enter)…",
tsLoading: "正在加载3D视图…",
tsHint: "拖动:旋转 · 右键拖动:平移 · 滚轮:缩放 · 点击:选择 · 双击:添加或移除",
tsNotBuilt: "空间尚未创建。请按“创建 / 更新”。",
tsNeedOllama: "需要Ollama中的EmbeddingGemma 2(Gallery > 语义设置 > 模型设置)。",
tsBuilt: (c, g, b, at, ev) => `卡片 ${c} · 标签 ${g} · Gallery点 ${b} · 创建于 ${at} · PCA贡献率 ${(ev * 100).toFixed(1)}%`,
tsPhase_cards: () => `正在收集ImagePrompt卡片…`,
tsPhase_index: (d, n) => `正在将卡片图像加入Gallery语义索引… ${d} / ${n}`,
tsPhase_prompts: (d, n) => `正在读取Gallery图像的提示词… ${d} / ${n}`,
tsSrc_gallery: "Gallery提示词",
tsImageNoTags: "没有来自提示词的标签(未能从该图像取出提示词)",
tsPhase_tags: (d, n) => `正在嵌入标签… ${d} / ${n}`,
tsPhase_project: () => `正在投影到3D…`,
tsDetailTitle: "已选择",
tsDetailEmpty: "将鼠标悬停在空间中的元素上或点击它。",
tsNeighborsTitle: "附近的元素",
tsNeighborsOf: (name) => `“${name}”附近`,
tsSearchTitle: (q) => `搜索:${q}`,
tsPickHint: "点击标签进行选择,然后用所选标签搜索空间",
tsPickSearch: (n) => `用所选标签搜索空间(${n})`,
tsPickClear: "取消选择",
tsFullPrompt: "完整提示词",
tsAddPicked: (n) => `添加所选标签(${n})`,
tsOpenInGallery: "在Gallery中打开",
tsRevealFailed: "无法在Gallery中显示该图像(位于Gallery的Output文件夹之外,或图像不存在)",
tsChipPicked: (name, n) => `${name}(${n}个标签)`,
tsListEmpty: "选择元素或搜索后,会列出附近的卡片和标签。",
tsBuilderTitle: "提示词",
tsChipsEmpty: "双击空间中的卡片或标签,或使用“添加”·列表中的+即可添加。",
tsSend: "追加到GenerateUI(Positive)",
tsCopy: "复制",
tsClear: "清除",
tsAdd: "添加",
tsRemove: "移除",
tsSent: "已追加到GenerateUI的Positive提示词",
tsCopied: "已复制到剪贴板",
tsNoWorkflow: "请先在GenerateUI中加载工作流",
tsSources: "来源:",
tsKind_card: "卡片",
tsKind_tag: "标签",
tsKind_image: "Gallery图像",
tsSrc_image_prompt: "ImagePrompt",
tsSrc_tagger: "Tagger DB",
tsSrc_prompt_library: "Prompt库",
tsSrc_wildcard: "通配符",
tsSourceFilterHint: "按来源切换标签的显示(只要标签的任一来源为开启,就会显示)",
tsTagger: "Tagger补全:",
tsTaggerOff: "关闭",
tsTaggerHint: "用Tagger模型为无法取出提示词的Gallery图像打标签(结果会缓存;没有GPU时会非常慢)",
tsScope_background: "仅Gallery点",
tsScope_all: "所有无提示词的图像",
tsPhase_tagger: (d, n, note) => `正在为无提示词的图像打标签… ${d} / ${n}${note ? `(${note})` : ""}`,
tsSrc_tagger_auto: "Tagger补全",
tsTagsFromTagger: "(Tagger补全)",
ts_err_tagspace_tagger_model: (m) => `无法使用Tagger模型:${m}`,
ts_err_tagspace_not_built: () => `空间尚未创建。请按“创建 / 更新”。`,
ts_err_tagspace_index_model: (m) => `Gallery语义索引是用 ${m} 创建的。TagSpace需要EmbeddingGemma 2——请在Gallery > 语义设置中用它重建索引。`,
ts_err_tagspace_too_few: () => `卡片或标签太少,无法创建空间。`,
ts_err_tagspace_unknown_item: () => `该元素已不在空间中。请重新创建空间。`,
ts_err_tagspace_error: (m) => `TagSpace错误:${m}`,
tabImageEdit: "Image Edit",
// -- Tagger Tab --
@@ -4336,7 +4603,7 @@ const LANGUAGES = {
helpGen26: "创建目录对话框的「不在Output文件夹中保留副本」复选框:每次生成仍会先按工作流自身Save Image节点的机制,正常写入一份文件到ComfyUI的Output文件夹;勾选此项后,一旦该图像的副本已成功保存到目录文件夹,就会立即删除Output文件夹中的原始文件 — 适合大批量创建目录(例如全部200多个风格)时,避免Output文件夹被大量近似重复的文件淹没;若某个风格的目录副本保存失败,其Output文件不会被删除,会保留原样",
helpGen27: "Input标签页 → Image子面板 — 每张LoadImage卡片现在有三个按钮:Apply(不变)、Clear(将该卡片待处理的选择/预览重置为空;不会改动工作流节点本身,因为LoadImage始终需要一个有效的文件名)和Placeholder。面板顶部的「Placeholder Image」区域(属于低频功能,默认折叠,点击可展开)用于配置共享的默认值:Color模式(设置宽度/高度/颜色,即时生成纯色PNG)或Image模式(拖入一张默认图片,之后原样复用)。点击某张卡片自己的Placeholder按钮,会立即只替换该卡片的图片为已配置的默认值——无需再点Apply;当有多张LoadImage卡片时,每张都可以单独替换。Placeholder配置(模式、尺寸、颜色、默认图片)会跨会话记住",
helpGen3: "5标签布局 — Input(提示词+图像)、Model、Settings、Feeder、Batch — Input/Model/Settings各含实时预览和直接编辑的Raw JSON列",
helpGen4: "Input标签:含Prompt和Image子标签(拖放上传);Prompt标签显示Positive Prompt、Negative Prompt,以及底部的Embeddings选择器(过滤+下拉+权重+Paste按钮)— Paste将(embedding:Name:weight)插入最后聚焦文本框的光标位置(未聚焦时默认追加到Positive);每个Apply按钮左侧的↺按钮可将文本框恢复为节点当前已应用的值;选中文字(或将光标置于单词/括号内也可)后按Ctrl+↑/↓,即可以(text:weight)语法以±0.05为单位调整强调权重(权重恢复为1.0时自动去除括号)",
helpGen4: "Input标签:Prompt(左)与Image(右,宽度约3:2)并排显示在同一画面(支持拖放上传);当Prompt/Image区域宽度约720px以下时,Image会折行到Prompt下方,右侧的Raw JSON可通过»按钮折叠为细条(仅Input标签,状态会被记住);Prompt区域显示Positive Prompt、Negative Prompt,以及底部的Embeddings选择器(过滤+下拉+权重+Paste按钮)— Paste将(embedding:Name:weight)插入最后聚焦文本框的光标位置(未聚焦时默认追加到Positive);每个Apply按钮左侧的↺按钮可将文本框恢复为节点当前已应用的值;选中文字(或将光标置于单词/括号内也可)后按Ctrl+↑/↓,即可以(text:weight)语法以±0.05为单位调整强调权重(权重恢复为1.0时自动去除括号)",
helpGen5: "Model标签:Checkpoint/VAE/Diffusion Model(支持UNETLoader / UnetLoaderGGUF / LoaderGGUF)/Text Encoder(支持CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — 含type和device选择器,DualCLIP显示两段模型选择)始终显示;ControlNet和Hypernetwork(带Strength输入)因使用频率较低默认折叠 — 点击标题展开;LoRA(Single/Stack标签)拥有独立的列;所有选择器均含筛选;LoRA Stack — 点击Apply会将所有启用的LoRA写入目标节点,并同时将LoRA语法和CivitAI触发词插入Positive提示词;再次Apply会移除未启用的LoRA并重新添加启用的LoRA以更新提示词",
helpGen28: "Model标签 — 高亮颜色:当前工作流实际包含某类型节点时(Checkpoint/VAE/Diffusion Model/Text Encoder/ControlNet/Hypernetwork),对应标签及LoRA列标题会以指定颜色(默认亮绿色)显示;即使ControlNet/Hypernetwork处于折叠状态该颜色依然可见,无需展开即可判断是否在使用;颜色可在Settings标签中自定义",
helpGen6: "Settings标签:KSampler与Latent Image并排显示(各占50%宽度)",
@@ -4508,11 +4775,12 @@ const LANGUAGES = {
helpGallery10: "工作流自动保存:在Generate UI标签生成的图像,其工作流会自动保存到图库元数据,并在JSON标签中显示",
helpGallery11: "支持PNG(tEXt/iTXt)、JPEG、WebP、GIF、MP4、WebM、PSD以及音频(WAV、MP3、OGG、M4A、FLAC、Opus:波形缩略图、内置播放器、SaveAudio系节点写入的prompt/workflow标签);PNG格式读取ComfyUI嵌入的JSON(prompt / workflow键,包括IEND之后追加的块),WebP格式读取EXIF中的workflow/prompt,MP4/WebM格式读取SaveVideo写入的容器标签(同名键,如MiniMax H3输出);无工作流的图像会从A1111 / Forge / Fooocus的parameters显示提示词。音频波形缩略图按格式着色(MP3蓝、WAV绿、FLAC琥珀、OGG/Opus紫、M4A玫红),详情面板在波形下方显示播放器",
helpGallery31: "Send to LV node按钮(工具栏,Send to LI node按钮旁):视频版的Send to LI node — 上传选中的视频并将其文件名写入ComfyUI画布上当前选中节点(必须是原生的Load Video节点)的file部件;仅当选中项为视频(mp4/webm)时可用;需要通过ComfyUI顶部菜单按钮打开Workflow Studio",
helpGallery37: "Send CC Layout / Send CC Image按钮(工具栏,仅在ComfyUI Comic Creator内打开此图库时显示;v0.8.11):Send CC Layout将选中的图像发送到排版标签页中选中的分格/覆盖层(MP4发送到视频工具);Send CC Image切换到Comic Creator的Image标签页并在其中加载选中的图像(已有文档时作为新图层,否则作为新画布;不支持视频)",
helpGallery32: "详情面板 — Prompt标签(默认选中):列出从嵌入工作流中找到的正/负向提示词;cc_nanobanana文件夹中的图像未嵌入ComfyUI工作流,因此该标签会被隐藏,取而代之显示Nanobanana标签(v0.7.14)— 仅当该文件夹的history.jsonl生成记录(由ComfyUI Comic Creator的Nanobanana标签写入)中有选中图像的对应记录时才显示:engine、model、图像尺寸、seed、时间戳以及实际使用的提示词/负向提示词",
helpGallery33: "Semantic Search(v0.8.2):搜索框旁的“S”按钮用于开启/关闭语义搜索。开启后,搜索框使用Gemini Embedding 2或本地EmbeddingGemma 2按含义查找图像(例如“黄昏的城市街道”),按Enter执行,结果按相似度排序并显示分数标记。关闭时为原有的文件名/标签/提示词搜索。开启后工具栏会出现第二行,左对齐显示Similar、更新按钮、设置按钮和结果数量。设置按钮(齿轮)会打开窗口,用于创建/更新/删除所选文件夹(可含子文件夹)的索引;模型通过单选按钮选择(Gemini需在插件的.env中设置GEMINI_API_KEY并重启ComfyUI;EmbeddingGemma 2在本地运行,首次使用时自动下载模型)。更改模型或向量维度时需要“全部重建”。搜索范围为所选文件夹及其下级,语义搜索结果不应用排序和标签/分组筛选",
helpGallery33: "Semantic Search(v0.8.2):搜索框旁的“S”按钮用于开启/关闭语义搜索。开启后,搜索框使用Gemini Embedding 2或在Ollama中运行的EmbeddingGemma 2按含义查找图像(例如“黄昏的城市街道”),按Enter执行,结果按相似度排序并显示分数标记。关闭时为原有的文件名/标签/提示词搜索。开启后工具栏会出现第二行,左对齐显示Similar、更新按钮、设置按钮和结果数量。设置按钮(齿轮)会打开窗口,用于创建/更新/删除所选文件夹(可含子文件夹)的索引;模型通过单选按钮选择(Gemini需在插件的.env中设置GEMINI_API_KEY并重启ComfyUI;EmbeddingGemma 2需要在本地运行Ollama并下载模型:ollama pull embeddinggemma-2:740m 或 embeddinggemma-2:440m)。更改模型或向量维度时需要“全部重建”。搜索范围为所选文件夹及其下级,语义搜索结果不应用排序和标签/分组筛选",
helpGallery34: "Similar切换按钮和更新按钮(工具栏第二行,S开启时显示):Similar显示与所选图像相似的图像(未索引的图像会即时嵌入)。在相似列表中选择其他图像时列表保持不变,按更新按钮显示与新选图像相似的图像,再次按Similar则返回普通列表。切换文件夹、清除筛选或关闭S也会退出相似模式",
helpGallery35: "EmbeddingGemma 2的速度:默认在CPU(一半核心)上运行,高精度设置下每张约6秒。“图像精度”是在精度与速度之间取舍(标准约快2.5倍,轻量约快5倍;向量会改变,因此更改后需要“全部重建”),减少CPU线程数可降低生成图像时对电脑的负载。要使用NVIDIA GPU,请在ComfyUI的Python中安装onnxruntime-gpu(先pip uninstall onnxruntime,再pip install onnxruntime-gpu;会使用ComfyUI的PyTorch所用的CUDA运行库/cuDNN)并重启ComfyUI:每张约0.1秒(在RTX 4070上实测,约为CPU的45倍),结果与CPU相同。不支持DirectML(其图像模型无法运行)。索引创建完成后模型会从内存中释放,下次搜索时重新加载",
helpGallery36: "弹窗标签页与相似度阈值:语义设置窗口分为三个标签页——索引(目标文件夹、重建模式、进度、全部删除)、模型设置(Gemini / EmbeddingGemma 2、向量维度、设备、CPU线程数、图像精度、连接测试)和搜索设置。在搜索设置中可指定相似图像结果的最低分数(例如0.6仅显示相似度0.6以上的图像)、文字搜索的最低分数以及最大显示数量。不同模型的分数水平不同,因此每个模型分别保存,列表标题会显示当前应用的阈值",
helpGallery35: "EmbeddingGemma 2在Ollama中运行(已移除内置的ONNX运行方式,因此不再需要为其安装onnxruntime-gpu)。在模型设置标签中指定Ollama URL(默认http://localhost:11434;其他主机需登记到WFS_ALLOWED_BACKEND_HOSTS)和模型大小:740m(文本+图像+音频)或440m(文本+图像,更小)。两者返回相同的向量,因此切换大小无需重建;“:latest”标签与740m相同,未下载740m时会自动使用。270m和570m无法处理图像,因此不在选项中。用旧版ONNX创建的索引可以继续使用(向量几乎一致;如需完全重新生成请使用“全部重建”)。图像每4张一起发送(使用NVIDIA GPU时每张约0.1-0.2秒)。索引创建完成后模型会从显存中卸载,下次搜索时由Ollama重新加载",
helpGallery36: "弹窗标签页与相似度阈值:语义设置窗口分为三个标签页——索引(目标文件夹、重建模式、进度、全部删除)、模型设置(Gemini / EmbeddingGemma 2、向量维度、Ollama URL、模型大小、连接测试)和搜索设置。在搜索设置中可指定相似图像结果的最低分数(例如0.6仅显示相似度0.6以上的图像)、文字搜索的最低分数以及最大显示数量。不同模型的分数水平不同,因此每个模型分别保存,列表标题会显示当前应用的阈值",
helpGallery28: "「创建PSD」批量操作按钮:将所有选中的图像合并为一个带图层的PSD文件并下载 — 每张图像成为独立图层(以文件名命名),以左上对齐方式放置在按所选最大图像尺寸创建的画布上;最后选中的图像位于最上层 转换...批量按钮(选中音频/视频时显示):将音频文件(视频则提取音轨)转换为FLAC / MP3 / Opus / M4A / WAV并保存为同文件夹内的新文件(可选比特率、采样率、声道);prompt/workflow标签会在支持标签的格式中继承(WAV除外),也可继承收藏/标签/备注/分组,并可选择转换后删除原文件。",
helpGallery29: "「作为图层编辑」批量操作按钮:切换到Image Edit标签并一次性打开所有选中的图像,每张作为独立图层(所选内容中的视频文件会被跳过);最后选中的图像位于最上层",
helpGallery30: "PSD文件:缩略图与完整预览显示所有图层合并后的效果(隐藏图层不参与合并);原始PSD文件本身不会被修改,Gallery中显示的仅是合并渲染后的预览",
@@ -4534,6 +4802,19 @@ const LANGUAGES = {
helpGallery26: "Gallery标签页顶部有四个子标签:Output(此浏览器)、ImagePrompt、Style_Catalog、Metadata — 最后一个直接内嵌完整的Metadata标签页(参见其专属帮助页),因此无需离开Gallery即可拖入图像查看其内嵌的模型/提示词数据",
// -- Tagger Tab --
helpTagSpaceTitle: "TagSpace标签页",
helpTagSpaceCardOverview: "概述与创建空间",
helpTagSpaceCardUse: "选择标签并生成提示词",
helpTagSpace1: "TagSpace将WFS内的数据放入EmbeddingGemma 2的向量空间并以3D显示:卡片(ImagePrompt的图像及其提示词,以缩略图显示)、标签(从ImagePrompt提示词、Gallery图像中嵌入的Positive提示词、通配符、Tagger DB和Prompt库的文本中拆分出的词,按来源着色)以及Gallery点(已索引的部分Gallery图像,作为淡色背景,各自带有来自其提示词的标签)。距离越近,含义越相近",
helpTagSpace2: "需要:运行中的Ollama与EmbeddingGemma 2(Gallery > 语义设置 > 模型设置)。如果Gallery语义索引是用Gemini创建的,请先用EmbeddingGemma 2重建",
helpTagSpace10: "用卡片或Gallery图像的标签搜索空间:选择卡片或Gallery点后,其提示词标签以按钮显示(卡片的完整提示词在“完整提示词”中显示;卡片标签在“创建 / 更新”后显示)。点击标签进行选择(再次点击取消),按“用所选标签搜索空间”即可将所选标签按提示词顺序连接后搜索空间(与在搜索框中输入相同)。在选择其他元素之前会保留所选内容。选择了标签时,“添加”按钮会变为“添加所选标签(N)”,只将所选标签(按提示词顺序)作为一个标签块添加;未选择时与以前一样添加整体。对于Gallery点,“在Gallery中打开”会打开Gallery标签页中该图像所在的文件夹,并在列表中选中该图像(搜索等筛选会被清除)",
helpTagSpace9: "标签的选择:勾选“全部标签”后不再使用“标签数”,而是使用所有候选标签(上限2万个)。“最少出现次数”会排除在所有来源合计中使用次数少于该值的标签(设为2可去除只出现一次的拼写差异和片段)。“通配符”决定是否将通配符作为标签来源。只出现在通配符中的词占了标签种类的大部分(测试环境中4.76万种中约3.7万种),关闭后使用全部标签约为1.04万种(最少出现次数为2时约6,800种)。只使用部分候选时,状态栏会显示候选数量。新标签只嵌入一次(新标签较多的首次创建会多花几分钟)",
helpTagSpace3: "“创建 / 更新”:收集卡片,将尚未索引的卡片图像加入Gallery语义索引,读取已索引Gallery图像中嵌入的Positive提示词(从采样器的positive输入向上追溯,不追溯negative;缓存于tagspace_prompts.json,之后只读取新增或更改的图像),用Ollama嵌入新标签(缓存于tagspace_tags.npz),再用PCA投影到3D。“标签数”为保留的标签数量:每个来源按“使用该标签的文本数”排序,各来源轮流选取,因此不会被数量众多的Gallery提示词占满;“Gallery点数”为显示的Gallery图像数量(0为不显示)。提示词只按逗号(以及 | { } BREAK)拆分,不按空格拆分,超过5个词的句子会被排除。图像与文本分别对齐中心后再投影,使卡片与对应标签重叠。首次创建时,卡片准备约2.5分钟,读取2.9万张Gallery图像的提示词约3分钟;有缓存时只需几秒",
helpTagSpace4: "操作:拖动旋转,右键拖动平移,滚轮缩放。悬停时显示名称、缩略图以及提示词/来源;复选框可切换卡片、缩略图、标签和Gallery的显示。来源复选框(ImagePrompt/Gallery提示词/Tagger DB/Prompt库/通配符)可按来源显示或隐藏标签:只要标签的任一来源为开启就会显示,颜色取显示中来源的第一个;隐藏的标签也会从附近元素和搜索结果列表中排除。所选内容会被保存",
helpTagSpace5: "点击卡片或标签会选中它并列出附近的元素(仅点击不会改变提示词)。要加入提示词栏,请双击,或按“选中”中名称旁的“添加”或列表中的+(再次双击或按下即移除)。卡片和标签分别排序后交替排列,因此选择卡片时也会显示相近的标签。添加Gallery点时,该图像的标签会合并为一个标签块(没有标签的图像无法添加);点击Gallery点会将相似的Gallery图像(圆形缩略图)与附近的标签、卡片一起列出;选择卡片或标签以及搜索时,列表中不会出现Gallery图像。列表中的+用于添加,点击行会移动到该位置。搜索框(Enter,支持中文)会在文本的位置放置白色标记并列出附近的元素",
helpTagSpace6: "提示词栏:卡片添加其完整提示词,标签添加标签本身,Gallery图像添加其提示词中的标签;去除重复(忽略大小写和空格差异)后连接。“追加到GenerateUI(Positive)”会追加到GenerateUI中已加载工作流的Positive提示词,“复制”会复制到剪贴板",
helpTagSpace7: "Tagger补全:约三分之一的Gallery图像无法取出Positive提示词(导入或编辑过的图像、只有LoRA指定或长句的提示词等)。在“Tagger补全”中选择Tagger模型(Tagger标签页中的ONNX模型)后,“创建 / 更新”时会为这些图像打标签。“仅Gallery点”只处理显示的Gallery点,“所有无提示词的图像”处理所有已索引且没有提示词标签的图像。使用默认阈值(WD为0.35/角色0.85,PixAI为推荐值),并排除评级(rating)标签。结果按图像和模型缓存于tagspace_tagger.json,之后只处理新图像;中止时已完成的结果会保留。得到的标签作为来源“Tagger补全”,可与其他来源一样显示或隐藏,也会成为对应Gallery点的标签(标注“(Tagger补全)”)。进度中会显示模型的运行位置(CUDA/CPU)。在CPU上每张约0.5秒,处理全部图像前请确认onnxruntime-gpu已生效(参见故障排除)",
helpTagSpace8: "显示:“发光”会在夜空背景上把点绘制成发光的星星(越密集越亮;数量多的Gallery点会调暗,避免过曝发白)。关闭后恢复原来的圆点和普通背景。“闪烁”(在发光开启时有效)让标签、卡片和Gallery点以各自不同的节奏缓慢闪烁;选中和附近的高亮不会闪烁。将鼠标悬停在“选中”中的图像或“附近”列表的缩略图上会显示放大预览(点击列表行会改变选中项,因此只需悬停即可查看图像)。添加/移除按钮位于“选中”的名称行,滚动正文时也不会被隐藏",
helpTaggerTitle: "Tagger标签",
helpTagger1: "使用WD Tagger(ONNX)、PixAI Tagger v1.0(ONNX)、SwinV2、DeepDanbooru(.h5)和VLM(Ollama / LM Studio / Lemonade / Unsloth)进行自动图像标注 — 子标签:Single / Batch / DB",
helpTagger2: "模型放置:在ComfyUI/models/tagger/<模型名>/ 下为每个模型创建单独子文件夹,必须包含 .onnx + selected_tags.csv(DeepDanbooru为 .h5 + 标签文件)。PixAI Tagger v1.0 使用社区ONNX转换版 Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8:文件夹内放一个 .onnx(GPU推荐 model_fp16.onnx)+ selected_tags.csv + preprocess.json,将自动识别",
@@ -4700,7 +4981,7 @@ const LANGUAGES = {
helpImageEditMask11: "Text子工具:点击画布打开文字图章面板;输入文字,设置Font / Size / Bold / Italic / Align及Mode(Add = 白色图章 / Erase = 消除遮罩),点击Stamp或按Ctrl+Enter确认;支持多行文字(在文本框中换行)",
helpImageEditMask12: "Vector子工具:点击添加Catmull-Rom样条控制点;点击第一个控制点(或按Enter)关闭并填充多边形;Backspace删除最后一个点;Esc重置所有点;属性面板显示当前点数及Mode(Add / Erase)",
helpImageEditMask13: "Shape子工具:拖动绘制矩形或椭圆遮罩;按住Shift可绘制正方形/正圆;拖动时蓝色虚线预览形状;属性面板:Mode(Add / Erase)、Shape(Rect / Ellipse)",
helpImageEditMask14: "Edit in Mask Editor One(仅限 Paint 模式):点击 MASK EDITOR ONE 区域中的“Edit in Mask Editor One →”,会将当前画布合成图像(若当前激活图层是遮罩图层,则一并发送其内容)发送到 ComfyUI 画布上的 MaskEditorOne 节点(优先使用当前选中的节点,否则使用图中找到的第一个该类型节点),并在 ComfyUI 浏览器标签页中打开完整编辑器(SAM3、BiRefNet、形状等);在那里点击 Apply 后,结果会作为新遮罩图层导入到这里;需要已通过 ComfyUI 顶部菜单按钮打开 Workflow Studio,且 ComfyUI 图中至少存在一个 MaskEditorOne 节点",
helpImageEditMask14: "Edit in Mask Editor One(仅限 Paint 模式):点击 MASK EDITOR ONE 区域中的“Edit in Mask Editor One →”,会将当前画布合成图像(若当前激活图层是遮罩图层,则一并发送其内容)发送到 ComfyUI 画布上的 MaskEditorOne 节点(优先使用当前选中的节点,否则使用图中找到的第一个该类型节点),并在 ComfyUI 浏览器标签页中打开完整编辑器(SAM3、BiRefNet、形状等);在那里点击 Apply 后,结果会作为新遮罩图层导入到这里;需要已通过 ComfyUI 顶部菜单按钮打开 Workflow Studio,且 ComfyUI 图中至少存在一个 MaskEditorOne 节点;发送的图像也会保存到该节点(Mask Editor One v0.1.12 及以上),因此重新加载 ComfyUI 页面或切换工作流标签页后依然保留",
helpImageEditBlurTitle: "Blur 工具 (≈)",
helpImageEditBlur1: "Whole Blur:对整个活动图层应用高斯模糊 — 调整强度滑块(1–50 px),点击Apply",
helpImageEditBlur2: "Whole Mosaic:对整个活动图层应用像素化马赛克 — 调整块大小滑块(5–100 px),点击Apply",
@@ -4739,8 +5020,8 @@ const LANGUAGES = {
helpTrouble7: "Tagger标签不显示模型:确认ComfyUI/models/tagger/<模型名>/文件夹存在且包含.onnx或.h5文件;如未安装onnxruntime,请运行:python_embeded\\python.exe -m pip install onnxruntime",
helpTrouble8: "Model 标签页显示的 Checkpoint 与预期不符(例如无论加载哪个工作流都显示相同模型):工作流文件中保存的 Checkpoint 实际未安装,加载时已被静默替换为其他已安装模型,此时会弹出包含原始(未找到)模型名称的错误提示。请在 Model 标签页手动选择正确的 Checkpoint,或在设置标签页启用\"默认 Checkpoint\",在每次加载时强制应用一个已验证可用的模型。",
helpTrouble9: "点击 Generate 后,执行的是与刚加载的工作流不同的工作流:Batch 子标签页中的某个批量类型(Checkpoint/LoRA/Prompt/Workflow/Sampler/Scheduler)复选框仍处于开启状态。只要有任意批量类型处于启用状态,Generate 按钮执行的就是批量选择的内容,而不是当前加载的工作流。请打开 Batch 子标签页,关闭已启用的批量类型复选框。",
helpTrouble10: "EmbeddingGemma 2未检测到GPU(语义设置的模型设置标签显示“未检测到GPU”,或连接测试显示在CPU上运行):ComfyUI的Python中的onnxruntime是CPU版,缺少CUDAExecutionProvider。解决:先停止ComfyUI(正在使用的文件无法替换),然后在ComfyUI的Python中执行“pip uninstall -y onnxruntime onnxruntime-gpu”,再执行“pip install --no-deps onnxruntime-gpu”,之后重新启动ComfyUI。之后它可能悄悄变回CPU版:按名称要求“onnxruntime”的其他软件包(如insightface、rtmlib、qwen-tts)在安装或更新时,pip会在GPU版文件上覆盖安装CPU版;如果添加自定义节点后GPU失效,请重复上述步骤。需要NVIDIA GPU以及ComfyUI的PyTorch所使用的CUDA运行库/cuDNN(不支持DirectML)。没有GPU时会自动使用CPU(较慢)",
helpTrouble11: "使用Gemini的语义搜索提示“未设置GEMINI_API_KEY”或密钥被拒绝:在插件的.env文件(复制.env.example)中添加GEMINI_API_KEY=密钥(行首不要加#),然后重启ComfyUI——.env只在启动时读取。密钥可在Google AI Studio获取。如果不想使用API,请在语义设置的模型设置中选择EmbeddingGemma 2(本地,无需密钥)",
helpTrouble10: "EmbeddingGemma 2提示“无法连接Ollama”或“尚未下载”:请启动Ollama(创建索引和搜索时都需要运行),并在语义设置的模型设置标签中确认Ollama URL;用“ollama pull embeddinggemma-2:740m”(或 embeddinggemma-2:440m)下载模型。如果创建索引时偶尔出现“connection was forcibly closed”等错误而失败,可能是按应用过滤流量的安全软件(如AdGuard)干扰了ollama.exe的通信,请将Ollama排除在过滤之外。失败的请求会自动重试;仍然失败的图像计入失败数,下次执行“仅新增/已更改的图像”时会重新处理",
helpTrouble11: "使用Gemini的语义搜索提示“未设置GEMINI_API_KEY”或密钥被拒绝:在插件的.env文件(复制.env.example)中添加GEMINI_API_KEY=密钥(行首不要加#),然后重启ComfyUI——.env只在启动时读取。密钥可在Google AI Studio获取。如果不想使用API,请在语义设置的模型设置中选择EmbeddingGemma 2(Ollama・本地,无需密钥)",
helpTrouble12: "语义搜索或Similar没有结果:结果只包含所选文件夹内已建立索引的图像(文件夹树中的绿点表示该文件夹已全部建立索引)。请先通过齿轮按钮创建索引,并选择包含已索引图像的文件夹。更改模型、向量维度或图像精度后需要“全部重建”。语义设置搜索标签中的最低分数也可能隐藏全部结果,请设为0以确认。创建索引后的首次搜索需要几秒钟,因为要重新加载本地模型",
helpSupportTitle: "支持",
helpSupportDesc: "如果您觉得这个插件有用,请考虑支持它的开发!",
@@ -5014,10 +5295,14 @@ const LANGUAGES = {
videoAssetSetAsLast: "设为Last Image",
videoAssetSetAsFirstDone: (name) => `已将 "${name}" 设为First Image`,
videoAssetSetAsLastDone: (name) => `已将 "${name}" 设为Last Image`,
videoAssetSetAsRef1: "设为Reference Image",
videoAssetSetAsRef2: "设为Reference Image 2",
videoAssetSetAsRef1Done: (name) => `已将 "${name}" 设为Reference Image`,
videoAssetSetAsRef2Done: (name) => `已将 "${name}" 设为Reference Image 2`,
videoNoBlockSelected: "Plan中未选择区块",
videoBlockImageUploadFailed: "上传图片到Plan区块失败",
videoNoWorkflowLoaded: "尚未加载工作流",
videoUnsupportedWorkflow: "该工作流不包含受支持的视频模型节点(MiniMax H3、LTX-2.5 的 Text/Image/First&Last-Frame to Video,或 Wan2.2 的 Text to Video)",
videoUnsupportedWorkflow: "该工作流不包含受支持的视频模型节点(MiniMax H3、LTX-2.5 的 Text/Image/First&Last-Frame to Video,Wan2.2 的 Text to Video,或 FastH3 OmniRef 的 Reference to Video)",
videoWorkflowLoadFailed: "工作流加载失败",
videoConfirmLoadWorkflow: (name) => `要将“${name}”加载为该 Plan 的工作流吗?`,
videoPlanMinOneBlock: "Plan 至少需要一个区块",
@@ -5133,10 +5418,10 @@ const LANGUAGES = {
videoEditSoundLength: "长度(秒)",
videoEditSoundVolume: "音量(dB)",
helpVideoTitle: "Video 标签页",
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 时显示已保存的 Plan 列表,选中 Edit 时显示已保存的 Edit 项目列表。",
helpVideoDesc: "支持 MiniMax H3(Image to Video)、LTX-2.5(Text / Image / First & Last Frame to Video)、Wan2.2(Text to Video)、FastH3 OmniRef(MiniMax H3 Reference to Video)工作流的视频生成标签页,独立于 GenerateUI 标签页运行。中央面板的 Plan/Edit/Asset 子标签负责批量生成、片段剪辑和浏览已生成的视频;侧边栏的 Project 子标签在中央选中 Plan 时显示已保存的 Plan 列表,选中 Edit 时显示已保存的 Edit 项目列表。",
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。不受支持的工作流会显示错误提示。",
helpVideo3: "在 Workflow 标签页的详情弹窗中使用「加载到Video」按钮,可以加载包含 MiniMax H3 的 Image to Video 节点、LTX-2.5 的 Text/Image/First&Last-Frame to Video 节点、Wan2.2 的 Text to Video 节点、或 FastH3 OmniRef(MiniMax H3 的 Reference to Video)节点的工作流(FastH3 / Pika-H3-Flex 中 First Image 栏和 Last Image 栏分别作为 Reference Image(ref_image_0)和 Reference Image 2(ref_image_1);未指定(None / Clear)的参考图像即使工作流中已连接图像也会断开连接后再生成;Reference Image 2 不会被当作「使用上一区块的最后一帧」的最后一帧,而是使用实际生成的最后一帧)——此操作会创建一个仅含一个区块、并以该工作流当前值为初始值的新 Plan。不受支持的工作流会显示错误提示。",
helpVideo4: "生成的视频(mp4)会自动出现在 Asset 子标签的 Video Temp 组中,也可以在 Gallery 标签页中浏览和播放。是否整理到 Video Assets,由您自行决定时机。",
helpVideo5: "中间面板有两个预览区:左侧显示您在 Asset 子标签中选择的视频,或拖放/选择到左边「Video Source」面板中的任意本地视频(点击 Clear 可重置;「登记为素材」会将加载的视频复制到 output 文件夹并登记到 Video Assets,之后即可在 Asset 子标签中看到),无需先运行已加载的视频工作流即可使用 Frame/GIF 工具;右侧始终显示最近一次生成的片段。",
helpVideo6: "Frame标签页(右侧面板):播放/拖动预览视频到想要的位置,点击「Capture Frame」在客户端截取该帧,再点击「Save to Output」将其保存为PNG到ComfyUI的输出文件夹——保存前勾选「Add to Video Assets group」还可以把保存的帧同时标记进 Gallery 的 Video Assets 分组。",
+4
View File
@@ -1345,6 +1345,10 @@ class ImageEditTab {
}
// Comic Creator等、同一オリジンiframe越しの外部呼び出し専用エントリポイント(I2I版)。
async runI2IExternalMulti(imageBlobs, opts) {
return this._inpaint.runI2IExternalMulti(imageBlobs, opts);
}
async runI2IExternal(imageBlob, opts) {
return this._inpaint.runI2IExternal(imageBlob, opts);
}
+50
View File
@@ -287,6 +287,56 @@ export class InpaintI2IActions {
return resultImg?.src || null;
}
// 複数画像版: imageBlobs[i] をワークフロー内の i 番目の LoadImage ノードへ割り当てて実行する
// (Comic Creator の Nanobanana+ タブ「Local」用。LoadImage 数を超える分は無視する)。
// denoise は指定されたときだけ反映する(Image Edit系ワークフローはdenoiseを持たないことが多い)。
// width/height/steps/cfg/seed は指定時のみ反映(未指定=ワークフロー既定のまま)。
// seed が 0以上なら固定シード、未指定/負ならGenerateUIのシード設定に従う。
async _runI2IWithImages(imageBlobs, { positive, negative, denoise, width, height, steps, cfg, sampler_name, scheduler, seed, overrideOpts = {}, onStatus } = {}) {
const setStatus = onStatus || (() => {});
const analysisForLookup = overrideOpts.analysis || comfyUI.currentAnalysis;
if (!analysisForLookup) throw new Error("No workflow loaded in GenerateUI");
const slotCount = analysisForLookup.load_image_nodes?.length || 0;
if (imageBlobs.length > 0 && slotCount === 0) {
throw new Error("No LoadImage node found in the workflow");
}
setStatus("Uploading...");
const used = Math.min(imageBlobs.length, slotCount);
for (let i = 0; i < used; i++) {
const file = new File([imageBlobs[i]], `i2i_${Math.random().toString(36).slice(2, 10)}.png`, { type: "image/png" });
await comfyEditor.applyImageToSlot(file, i, overrideOpts);
}
comfyEditor.setPromptText("positive", positive, overrideOpts);
if (negative) comfyEditor.setPromptText("negative", negative, overrideOpts);
if (width != null || height != null || steps != null || cfg != null || denoise != null || sampler_name || scheduler) {
comfyEditor.setGenerationParams({ width, height, steps, cfg, denoise, sampler_name, scheduler, ...overrideOpts });
}
if (!window._wfmGenerateTab?.generate) throw new Error("GenerateUI is not ready yet");
setStatus("Generating...");
const genOptions = (seed != null && seed >= 0) ? { seedValue: seed } : {};
await window._wfmGenerateTab.generate(overrideOpts.workflow || undefined, genOptions);
const resultImg = document.getElementById("wfm-gen-result-img");
return { url: resultImg?.src || null, slotCount, usedImages: used };
}
async runI2IExternalMulti(imageBlobs, { positive = "", negative = "", denoise = null, width, height, steps, cfg, sampler_name, scheduler, seed } = {}) {
if (this.i2iExternalRunning) throw new Error("I2I is already running");
this.i2iExternalRunning = true;
try {
const r = await this._runI2IWithImages(imageBlobs || [], { positive, negative, denoise, width, height, steps, cfg, sampler_name, scheduler, seed });
if (!r.url) throw new Error("No result image produced");
return { ok: true, url: r.url, slotCount: r.slotCount, usedImages: r.usedImages };
} finally {
this.i2iExternalRunning = false;
}
}
// Comic Creator等、同一オリジンiframe越しの外部呼び出し専用エントリポイント(I2I版)。
// runExternal と対になる、マスク不要のシンプルなI2I実行。
async runI2IExternal(imageBlob, { positive = "", negative = "", denoise = 1.0 } = {}) {
+11 -5
View File
@@ -624,9 +624,12 @@ function extractPromptsAPI(wf) {
// 自ノードの"prompt"入力に直接テキストを持つ(positive/negativeの区別も無い)ため、
// isTextEncoderNode判定を通さずtextMapへ直接投入する(fallbackのtextsに載る)。
// Gemini系の画像生成ノード(Nano Banana等)も同様に自ノードの"prompt"入力を持つ。
if (typeof n.inputs?.prompt === "string" && /ImageToVideo|TextToVideo|^Gemini(Image|NanoBanana)/i.test(ct)) {
textMap.set(id, n.inputs.prompt);
continue;
// FastH3 OmniRef(MiniMaxH3ReferenceToVideo)のように"prompt"が別ノードから配線される場合はリンク先を解決する。
if (/ImageToVideo|TextToVideo|ReferenceToVideo|^Gemini(Image|NanoBanana)/i.test(ct)) {
const pv = n.inputs?.prompt;
const txt = typeof pv === "string" ? pv : Array.isArray(pv) ? resolveLinkedText(wf, pv[0], pv[1] ?? 0) : null;
if (txt) textMap.set(id, txt);
if (pv !== undefined) continue;
}
if (!isTextEncoderNode(ct)) continue;
// "prompt" — TextEncodeQwenImageEdit(Plus)/TextEncodeBooguEdit and similar Image Edit
@@ -667,8 +670,11 @@ function extractPromptsAPI(wf) {
// negative_prompt directly, so textMap (single text per node) can't represent both
// roles.
const srcNode = wf[String(val[0])];
if (srcNode?.class_type === "TextEncodeMageFlowEdit" || srcNode?.class_type === "TextEncodeBooguEdit") {
const text = isPos ? srcNode.inputs?.prompt : srcNode.inputs?.negative_prompt;
// TextEncodeFibo2(Fibo 2.0)も同形。promptはPreviewAny→プロンプト強化スイッチ経由でリンクされる。
if (srcNode?.class_type === "TextEncodeMageFlowEdit" || srcNode?.class_type === "TextEncodeBooguEdit"
|| srcNode?.class_type === "TextEncodeFibo2") {
const raw = isPos ? srcNode.inputs?.prompt : srcNode.inputs?.negative_prompt;
const text = Array.isArray(raw) ? resolveLinkedText(wf, raw[0], raw[1] ?? 0) : raw;
if (text && typeof text === "string") { if (isPos) pos.add(text); else neg.add(text); }
continue;
}
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -13,7 +13,7 @@ import { setSourcePreview } from "./video-preview.js";
import { showToast } from "./app.js";
import { t } from "./i18n.js";
import { addClipFromFile, setBgmFromFile, addPipFromFile, addSoundFromFile } from "./video-edit-tab.js";
import { setBlockImageFromFile } from "./video-plan-tab.js";
import { setBlockImageFromFile, isReferenceImagePlan } from "./video-plan-tab.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
@@ -249,8 +249,8 @@ function _renderDetail(img) {
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-set-bgm" style="width:100%;margin-top:${isAudioFile(img) ? "12" : "6"}px;display:${isVideoFile(img) || isAudioFile(img) ? "block" : "none"};">${t("videoAssetSetAsBgm")}</button>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-add-sound" style="width:100%;margin-top:6px;display:${isAudioFile(img) ? "block" : "none"};">${t("videoAssetAddAsSound")}</button>
<div id="wfm-video-asset-set-plan-image-row" style="display:${isVideoFile(img) || isAudioFile(img) ? "none" : "flex"};gap:6px;margin-top:6px;">
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-set-first" style="flex:1;">${t("videoAssetSetAsFirst")}</button>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-set-last" style="flex:1;">${t("videoAssetSetAsLast")}</button>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-set-first" style="flex:1;">${t(isReferenceImagePlan() ? "videoAssetSetAsRef1" : "videoAssetSetAsFirst")}</button>
<button type="button" class="wfm-btn wfm-btn-sm" id="wfm-video-asset-set-last" style="flex:1;">${t(isReferenceImagePlan() ? "videoAssetSetAsRef2" : "videoAssetSetAsLast")}</button>
</div>
<button type="button" class="wfm-btn wfm-btn-primary wfm-btn-sm" id="wfm-video-asset-open-gallery" style="width:100%;margin-top:6px;">Open in Gallery</button>
`;
@@ -353,7 +353,11 @@ function _renderDetail(img) {
const file = new File([blob], img.filename, { type: blob.type || "image/png" });
await setBlockImageFromFile(which, file);
document.querySelector('.wfm-video-center-panel .wfm-video-subtab-btn[data-video-subtab="plan"]')?.click();
showToast(t(which === "first" ? "videoAssetSetAsFirstDone" : "videoAssetSetAsLastDone", img.filename), "success");
const ref = isReferenceImagePlan();
const doneKey = which === "first"
? (ref ? "videoAssetSetAsRef1Done" : "videoAssetSetAsFirstDone")
: (ref ? "videoAssetSetAsRef2Done" : "videoAssetSetAsLastDone");
showToast(t(doneKey, img.filename), "success");
} catch (err) {
showToast(t("errorWithMsg", err.message), "error");
}
+23 -2
View File
@@ -202,6 +202,14 @@ function _updateFieldHighlights() {
const hasTurboSteps = nodes.turboStepsIdx !== -1;
const hasPromptEnhance = nodes.promptEnhanceIdx !== -1;
// FastH3 OmniRef / Pika-H3-Flex(Reference to Video)では先頭/最終フレームではなく
// 参照画像(ref_image_0/ref_image_1)として渡る。
const isRef = nodes.family === "fasth3";
const firstLabel = document.getElementById("wfm-video-block-first-label");
if (firstLabel) firstLabel.textContent = isRef ? "Reference Image" : "First Image";
const lastLabel = document.getElementById("wfm-video-block-last-label");
if (lastLabel) lastLabel.textContent = isRef ? "Reference Image 2 (optional)" : "Last Image (optional)";
_setFieldActive("wfm-video-block-prompt-label", true);
_setFieldActive("wfm-video-block-duration-label", true);
_setFieldActive("wfm-video-block-first-label", nodes.firstFrameSlot !== -1);
@@ -319,6 +327,17 @@ async function _handleBlockImageUpload(which, file) {
}
}
// True when the loaded template is a Reference-to-Video workflow (FastH3 OmniRef /
// Pika-H3-Flex), whose First/Last Image fields are reference images 1/2 — lets
// video-asset-tab.js label its "Set as First/Last Image" buttons accordingly.
export function isReferenceImagePlan() {
return _isReferenceTemplate();
}
function _isReferenceTemplate() {
return !!_templateWorkflow && locateVideoModelNodes(_templateWorkflow)?.family === "fasth3";
}
// Exported so other modules (video-asset-tab.js's "Set as First/Last Image"
// buttons) can seed the currently-selected Plan block's First/Last Image from
// an already-fetched File — reuses the exact upload + first_image_mode
@@ -661,11 +680,13 @@ function _setRunUiState(running) {
// last_image_filename on the previous block always wins (it's already a known
// input image — no extraction needed); otherwise the previous block's actual
// generated last frame is used (extracted client-side after that block ran).
// Reference-to-Video templates store Reference Image 2 in last_image_filename, which
// is not the previous clip's last frame, so it never short-circuits the extraction.
async function _resolveFirstImage(block, i, prevGeneratedLastFrameRef) {
if (block.first_image_mode === "explicit") return block.first_image_filename || null;
if (block.first_image_mode === "chain_previous" && i > 0) {
const prevBlock = _plan.blocks[i - 1];
if (prevBlock.last_image_filename) return prevBlock.last_image_filename;
if (prevBlock.last_image_filename && !_isReferenceTemplate()) return prevBlock.last_image_filename;
return prevGeneratedLastFrameRef;
}
return null;
@@ -753,7 +774,7 @@ async function _runVideoPlanBatch() {
// skip the extraction entirely when this block already has its own
// explicit last_image_filename (that value is used directly instead).
prevGeneratedLastFrameRef = null;
if (!block.last_image_filename) {
if (!block.last_image_filename || _isReferenceTemplate()) {
const vid = outputMedia.find((m) => isVideoFilename(m.filename));
if (vid) {
try {
+134 -10
View File
@@ -1,7 +1,7 @@
/**
* 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,
* to Video) / FastH3 OmniRef (MiniMax H3 Reference 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.
*/
@@ -23,10 +23,24 @@ function _widgetIndexOf(node, inputDef) {
return widgetInputs.indexOf(inputDef);
}
// inputs[]にwidget定義を持たない形式で保存されたノード(FastH3 OmniRefテンプレートの
// ResolutionSelector/LoadImageなど)向けの、widgets_valuesの既定の並び順。
const _DEFAULT_WIDGET_ORDER = {
ResolutionSelector: ["aspect_ratio", "megapixels", "multiple"],
LoadImage: ["image", "upload"],
PrimitiveStringMultiline: ["value"],
PrimitiveString: ["value"],
PrimitiveFloat: ["value"],
PrimitiveInt: ["value"],
};
// 上と同じ並び順ルールで、名前から直接インデックスを引く版(ResolutionSelectorや
// LoadImageなど、モデルファミリー間で入力名が揺れないノードに使う)。
export function widgetIndex(node, name) {
const widgetInputs = (node?.inputs || []).filter((inp) => inp.widget);
if (!widgetInputs.length && node && Array.isArray(node.widgets_values)) {
return (_DEFAULT_WIDGET_ORDER[node.type] || []).indexOf(name);
}
return widgetInputs.findIndex((inp) => inp.name === name);
}
@@ -65,7 +79,90 @@ function _detectVideoSubgraph(workflow) {
return null;
}
// MiniMax H3の長さ(フレーム数)は24fpsで17k+5のグリッドに乗る — FastH3テンプレートの
// ComfyMathExpressionと同じ式で秒数から変換する。
function _durationToFrames(seconds) {
const f = Math.max(5, Math.round((Number(seconds) || 0) * 24));
return f + (5 - (f % 17) + 17) % 17;
}
// FastH3 OmniRef(MiniMaxH3ReferenceToVideo)はサブグラフを使わないフラット構成で、
// prompt/width/height/lengthは別ノード(PrimitiveStringMultiline / ResolutionSelector /
// PrimitiveFloat→ComfyMathExpression)から配線される。そのためサブグラフの公開入力ではなく、
// 各入力の配線元ノードを書き込み先として特定する(未配線ならモデルノード自身のwidget)。
function _locateFastH3Nodes(workflow) {
const instanceNode = workflow.nodes.find((n) => n.type === "MiniMaxH3ReferenceToVideo" && n.mode !== 4 && n.mode !== 2);
if (!instanceNode || !Array.isArray(instanceNode.widgets_values)) return null;
const nodeById = (id) => workflow.nodes.find((n) => n.id === id) || null;
const sourceOf = (node, inputName) => {
const inp = (node?.inputs || []).find((i) => i.name === inputName);
if (!inp || inp.link == null) return null;
const link = workflow.links.find((l) => l[0] === inp.link);
return link ? nodeById(link[1]) : null;
};
// prompt — 配線元がPrimitiveString(Multiline)ならその値を、未配線なら自ノードのwidgetを書く。
let promptNode = instanceNode, promptIdx = widgetIndex(instanceNode, "prompt");
const promptSrc = sourceOf(instanceNode, "prompt");
if (promptSrc) {
if (promptSrc.type !== "PrimitiveStringMultiline" && promptSrc.type !== "PrimitiveString") return null;
promptNode = promptSrc;
promptIdx = widgetIndex(promptSrc, "value");
}
// length — 秒数のPrimitiveFloat(→ComfyMathExpressionでフレーム数へ変換)が配線元なら
// そこへ秒数を書く。未配線なら自ノードのlength widgetへフレーム数に変換して書く。
let durationNode = instanceNode, durationIdx = widgetIndex(instanceNode, "length"), durationAsFrames = true;
let lengthSrc = sourceOf(instanceNode, "length");
if (lengthSrc?.type === "ComfyMathExpression") lengthSrc = sourceOf(lengthSrc, "values.a");
if (lengthSrc) {
if (lengthSrc.type !== "PrimitiveFloat" && lengthSrc.type !== "PrimitiveInt") return null;
durationNode = lengthSrc;
durationIdx = widgetIndex(lengthSrc, "value");
durationAsFrames = false;
}
if (promptIdx === -1 || durationIdx === -1) return null;
const widthSrc = sourceOf(instanceNode, "width");
const resolutionNode = widthSrc?.type === "ResolutionSelector" ? widthSrc : null;
const widthIdx = widthSrc ? -1 : widgetIndex(instanceNode, "width");
const heightIdx = sourceOf(instanceNode, "height") ? -1 : widgetIndex(instanceNode, "height");
// 参照画像はPlanの"First Image"/"Last Image"欄を流用し、1枚目(ref_image_0)/2枚目
// (ref_image_1)として扱う(UI上は"Reference Image"/"Reference Image 2"表記)。最終フレームの
// 概念は無いため、前ブロックの最終フレーム連結(chain_previous)は生成された最終フレームを
// 次ブロックの1枚目の参照画像として渡す形になる(video-plan-tab.js _resolveFirstImage参照)。
const refSlot = (name) => instanceNode.inputs.findIndex((i) => i.name === name);
const refLoadImage = (name) => {
const src = sourceOf(instanceNode, name);
return src?.type === "LoadImage" ? src : null;
};
const firstFrameSlot = refSlot("ref_images.ref_image_0");
const loadImageNode = refLoadImage("ref_images.ref_image_0");
const lastFrameSlot = refSlot("ref_images.ref_image_1");
const lastLoadImageNode = refLoadImage("ref_images.ref_image_1");
// noise_seedはcomfyUI.generate()が全ノード一括で上書きする(applyBlockToWorkflow参照)ため、
// ここではUI上の有効表示のためにRandomNoiseの有無だけを見る。
const hasRandomNoise = workflow.nodes.some((n) => n.type === "RandomNoise" && n.mode !== 4 && n.mode !== 2);
return {
family: "fasth3", sgDef: null, instanceNode, promptNode, durationNode, durationAsFrames,
loadImageNode, lastLoadImageNode, resolutionNode,
firstFrameSlot, lastFrameSlot, promptIdx, durationIdx,
widthIdx, heightIdx, noiseSeedIdx: hasRandomNoise ? 0 : -1,
turboModeIdx: -1, turboStrengthIdx: -1, turboStepsIdx: -1, promptEnhanceIdx: -1,
// 参照画像は任意(0枚でも可)。PlanでNone/Clearにした欄は、テンプレートのLoadImageが
// 接続されていても外す — 外さないとUI上は未指定なのにテンプレートの画像が使われてしまう。
disconnectUnsetFrames: true,
};
}
export function locateVideoModelNodes(workflow) {
if (!Array.isArray(workflow?.nodes) || !Array.isArray(workflow?.links)) return null;
if (workflow.nodes.some((n) => n.type === "MiniMaxH3ReferenceToVideo")) return _locateFastH3Nodes(workflow);
const detected = _detectVideoSubgraph(workflow);
if (!detected) return null;
const { family, sgDef } = detected;
@@ -138,7 +235,8 @@ export function locateVideoModelNodes(workflow) {
const heightIdx = resolutionNode ? -1 : _widgetIndexOf(instanceNode, heightInput);
return {
family, sgDef, instanceNode, loadImageNode, lastLoadImageNode, resolutionNode,
family, sgDef, instanceNode, promptNode: instanceNode, durationNode: instanceNode, durationAsFrames: false,
loadImageNode, lastLoadImageNode, resolutionNode,
firstFrameSlot, lastFrameSlot, promptIdx, durationIdx,
widthIdx, heightIdx, noiseSeedIdx, turboModeIdx, turboStrengthIdx, turboStepsIdx, promptEnhanceIdx,
};
@@ -149,17 +247,20 @@ export function locateVideoModelNodes(workflow) {
// fields from whatever the workflow file already had.
export function readTemplateDefaults(nodes) {
const {
instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx,
family, instanceNode, promptNode, durationNode, durationAsFrames, resolutionNode, loadImageNode, lastLoadImageNode,
promptIdx, durationIdx,
widthIdx, heightIdx, noiseSeedIdx, turboModeIdx, turboStrengthIdx, turboStepsIdx, promptEnhanceIdx,
} = nodes;
const rawDuration = durationNode.widgets_values[durationIdx];
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,
prompt: promptNode.widgets_values[promptIdx] ?? "",
// durationAsFrames(FastH3でlengthが未配線)の場合はフレーム数を24fpsで秒数へ戻す。
duration: rawDuration == null ? 2 : (durationAsFrames ? Math.round((rawDuration / 24) * 10) / 10 : rawDuration),
hasResolution: !!resolutionNode,
aspectRatio: (resolutionNode && arIdx !== -1) ? resolutionNode.widgets_values[arIdx] : null,
megapixels: (resolutionNode && mpIdx !== -1) ? resolutionNode.widgets_values[mpIdx] : null,
@@ -172,7 +273,7 @@ export function readTemplateDefaults(nodes) {
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,
noiseSeed: (noiseSeedIdx !== -1 && family !== "fasth3") ? instanceNode.widgets_values[noiseSeedIdx] : null,
hasTurboMode: turboModeIdx !== -1,
turboMode: turboModeIdx !== -1 ? instanceNode.widgets_values[turboModeIdx] : null,
hasTurboStrength: turboStrengthIdx !== -1,
@@ -184,6 +285,23 @@ export function readTemplateDefaults(nodes) {
};
}
// instanceNodeのtargetSlot入力の接続を外す(リンク削除+両端の参照を解除)。配線元が
// LoadImageで他に出力先が無くなった場合は、生成記録に未使用の画像が残らないようノードごと除く。
function _disconnectInput(clone, instanceNode, targetSlot) {
const inp = instanceNode.inputs?.[targetSlot];
if (!inp || inp.link == null) return;
const linkId = inp.link;
const link = clone.links.find((l) => l[0] === linkId);
const src = link ? clone.nodes.find((n) => n.id === link[1]) : null;
const out = src?.outputs?.[link?.[2]];
if (Array.isArray(out?.links)) out.links = out.links.filter((id) => id !== linkId);
clone.links = clone.links.filter((l) => l[0] !== linkId);
inp.link = null;
if (src?.type === "LoadImage" && !(src.outputs || []).some((o) => o.links?.length)) {
clone.nodes = clone.nodes.filter((n) => n !== src);
}
}
// first_frame/last_frameが未接続のワークフローに対して、画像が指定された時だけ
// LoadImageノードを新規注入する共通ヘルパー。ノードID/リンクIDはclone内の実際の
// 最大値+1で採番するため、重複ID/リンクID不整合は起きない
@@ -228,15 +346,17 @@ export function injectFrameNode(clone, instanceNode, targetSlot, filename) {
// 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.
// template's own clean state. Reference-to-Video templates (disconnectUnsetFrames)
// additionally drop a template-wired LoadImage when its field is left unset.
export function applyBlockToWorkflow(clone, nodes, params) {
const {
instanceNode, resolutionNode, loadImageNode, lastLoadImageNode, promptIdx, durationIdx, firstFrameSlot, lastFrameSlot,
instanceNode, promptNode, durationNode, durationAsFrames, 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;
promptNode.widgets_values[promptIdx] = params.prompt || "";
durationNode.widgets_values[durationIdx] = durationAsFrames ? _durationToFrames(params.duration) : params.duration;
const arIdx = widgetIndex(resolutionNode, "aspect_ratio");
const mpIdx = widgetIndex(resolutionNode, "megapixels");
@@ -264,6 +384,8 @@ export function applyBlockToWorkflow(clone, nodes, params) {
} else if (firstFrameSlot !== -1) {
injectFrameNode(clone, instanceNode, firstFrameSlot, params.firstImageFilename);
}
} else if (nodes.disconnectUnsetFrames && firstFrameSlot !== -1) {
_disconnectInput(clone, instanceNode, firstFrameSlot);
}
if (params.lastImageFilename) {
if (lastLoadImageNode) {
@@ -272,5 +394,7 @@ export function applyBlockToWorkflow(clone, nodes, params) {
} else if (lastFrameSlot !== -1) {
injectFrameNode(clone, instanceNode, lastFrameSlot, params.lastImageFilename);
}
} else if (nodes.disconnectUnsetFrames && lastFrameSlot !== -1) {
_disconnectInput(clone, instanceNode, lastFrameSlot);
}
}
+21
View File
@@ -0,0 +1,21 @@
The MIT License
Copyright © 2010-2026 three.js authors
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
View File
@@ -0,0 +1,3 @@
three.js r187 (0.187.0) - MIT License (see LICENSE)
Bundled subset for the TagSpace tab: core classes + OrbitControls.
Built with: esbuild --bundle --format=esm --minify
File diff suppressed because one or more lines are too long
+62 -22
View File
@@ -11,6 +11,7 @@
<link rel="stylesheet" href="/wfm_static/css/image-edit-tab.css">
<link rel="stylesheet" href="/wfm_static/css/lab-tab.css">
<link rel="stylesheet" href="/wfm_static/css/video-tab.css">
<link rel="stylesheet" href="/wfm_static/css/tagspace-tab.css">
</head>
<body>
<!-- Header -->
@@ -28,6 +29,7 @@
<button class="wfm-tab" data-tab="image-edit">Image Edit</button>
<button class="wfm-tab" data-tab="video">Video</button>
<button class="wfm-tab" data-tab="tagger">Tagger</button>
<button class="wfm-tab" data-tab="tagspace">TagSpace</button>
<button class="wfm-tab" data-tab="settings">Settings</button>
<button class="wfm-tab" data-tab="help">Help</button>
<button class="wfm-tab" data-tab="ai">AI TOOL</button>
@@ -335,23 +337,28 @@
<!-- Tab: Input — left sub-col: Prompt/Image (tabbed), right sub-col: Raw JSON -->
<div id="wfm-gen-subtab-input" class="wfm-gen-subtab-content active">
<div class="wfm-gen-tab-cols">
<div class="wfm-gen-params-col">
<div class="wfm-input-inner-tabnav">
<button class="wfm-input-inner-tab active" data-input-tab="prompt">Prompt</button>
<button class="wfm-input-inner-tab" data-input-tab="image">Image</button>
</div>
<div id="wfm-input-panel-prompt" class="wfm-input-inner-panel">
<div id="wfm-gen-prompt-fields">
<p class="wfm-placeholder">Load a workflow to edit prompts</p>
<div class="wfm-gen-params-col wfm-gen-params-col--input">
<!-- Prompt (3) | Image (2) の2カラム。params-colの幅が狭いとImageがPromptの下へ折り返す(CSSコンテナクエリ) -->
<div class="wfm-input-split">
<div id="wfm-input-panel-prompt" class="wfm-input-inner-panel wfm-input-inner-panel--prompt">
<div class="wfm-input-panel-title">Prompt</div>
<div id="wfm-gen-prompt-fields">
<p class="wfm-placeholder">Load a workflow to edit prompts</p>
</div>
</div>
</div>
<div id="wfm-input-panel-image" class="wfm-input-inner-panel" style="display:none;">
<div id="wfm-gen-image-fields">
<p class="wfm-placeholder">Load a workflow to set input images</p>
<div id="wfm-input-panel-image" class="wfm-input-inner-panel wfm-input-inner-panel--image">
<div class="wfm-input-panel-title">Image</div>
<div id="wfm-gen-image-fields">
<p class="wfm-placeholder">Load a workflow to set input images</p>
</div>
</div>
</div>
</div>
<div class="wfm-gen-rawjson-col" id="wfm-gen-rawjson-col-input"></div>
<div class="wfm-gen-rawjson-col wfm-gen-rawjson-col--collapsible" id="wfm-gen-rawjson-col-input">
<button type="button" id="wfm-gen-rawjson-collapse-btn" class="wfm-rawjson-collapse-btn" title="Collapse / expand Raw JSON">
<span class="wfm-rawjson-collapse-icon">»</span><span class="wfm-rawjson-collapse-label">Raw JSON</span>
</button>
</div>
</div>
</div>
@@ -1349,6 +1356,7 @@
<button class="wfm-help-nav-item" data-help-page="sidepanel">Library (Side Panel)</button>
<button class="wfm-help-nav-item" data-help-page="aitool">AI TOOL Tab</button>
<button class="wfm-help-nav-item" data-help-page="tagger">Tagger Tab</button>
<button class="wfm-help-nav-item" data-help-page="tagspace">TagSpace Tab</button>
<button class="wfm-help-nav-item" data-help-page="imageedit">Image Edit Tab</button>
<button class="wfm-help-nav-item" data-help-page="video">Video Tab</button>
<button class="wfm-help-nav-item" data-help-page="shortcuts">Keyboard Shortcuts</button>
@@ -1424,7 +1432,7 @@
<h3 id="wfm-help-gen-card-tabs-title">Tab Layout</h3>
<ul>
<li id="wfm-help-gen-3">5-tab layout — Input (Prompt + Image), Model, Settings, Feeder, Batch — Input/Model/Settings each include a Raw JSON column for instant preview and direct editing</li>
<li id="wfm-help-gen-4">Input tab: inner tabs — <b>Prompt</b> and <b>Image</b> (drag-and-drop upload); Prompt tab has Positive Prompt, Negative Prompt, and an <b>Embeddings</b> selector at the bottom — select a model, set Weight (default 1.0), then click <b>Paste</b> to insert <code>(embedding:Name:weight)</code> at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a <b>↺</b> button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press <b>Ctrl+↑/↓</b> to adjust its emphasis weight in <code>(text:weight)</code> syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0</li>
<li id="wfm-help-gen-4">Input tab: <b>Prompt</b> (left) and <b>Image</b> (right, about 3:2) are shown side by side on one screen (drag-and-drop upload); when the Prompt/Image area gets narrow (about 720px or less) Image wraps under Prompt, and the Raw JSON column can be collapsed to a slim strip at the right edge with its <b>»</b> button (Input tab only; remembered); the Prompt area has Positive Prompt, Negative Prompt, and an <b>Embeddings</b> selector at the bottom — select a model, set Weight (default 1.0), then click <b>Paste</b> to insert <code>(embedding:Name:weight)</code> at the cursor position of the last focused textarea (defaults to Positive if neither is focused); a <b>↺</b> button next to each Apply button reverts the textarea to the node's currently applied value; select text (or just place the cursor on a word/parenthesis block) and press <b>Ctrl+↑/↓</b> to adjust its emphasis weight in <code>(text:weight)</code> syntax by ±0.05 — the parentheses are removed automatically when the weight returns to 1.0</li>
<li id="wfm-help-gen-5">Model tab: Checkpoint, VAE, Diffusion Model (UNETLoader / UnetLoaderGGUF / LoaderGGUF), Text Encoder (CLIPLoader / DualCLIPLoader / ClipLoaderGGUF / DualClipLoaderGGUF — type and device selectors; DualCLIP shows two clip selectors) are always shown; ControlNet and Hypernetwork (with Strength field) are collapsed by default since they're used less often — click their header to expand; LoRA (Single/Stack tabs) has its own column to the right; all selectors have a filter; LoRA Stack — Apply writes all active LoRAs to the target node and simultaneously inserts LoRA syntax and CivitAI trigger words into the Positive prompt; re-applying updates the prompt by removing inactive LoRAs and re-adding active ones</li>
<li id="wfm-help-gen-28">Model tab — Highlight color: the label of each model type (Checkpoint, VAE, Diffusion Model, Text Encoder, ControlNet, Hypernetwork) and the LoRA column header turn a distinct color (default bright green) when the loaded workflow actually contains that type of node; this stays visible even while ControlNet/Hypernetwork are collapsed, so you can tell at a glance whether they're in use without expanding them; the color is customizable in the Settings tab</li>
<li id="wfm-help-gen-6">Settings tab: KSampler and Latent Image side by side, each at 50% width</li>
@@ -1809,12 +1817,13 @@
<li id="wfm-help-gallery-17"><b>Send GenUI Image</b> button (toolbar, next to Image Edit): uploads the selected image to ComfyUI and sets it as the input for the first LoadImage node in the GenerateUI tab; automatically switches to GenerateUI → Input → Image; requires a workflow with at least one LoadImage node to be loaded first</li>
<li id="wfm-help-gallery-27"><b>Send to LI node</b> button (toolbar, next to Send GenUI Image): uploads the selected image and writes its filename into the image widget of the currently selected node on the ComfyUI canvas (falling back to the first LoadImage-type node found) — same destination as Image Edit tab's Send to LI node; requires Workflow Studio to have been opened from ComfyUI's top menu button</li>
<li id="wfm-help-gallery-31"><b>Send to LV node</b> button (toolbar, next to Send to LI node): the video equivalent — uploads the selected video and writes its filename into the file widget of the currently selected node, which must be ComfyUI's native <b>Load Video</b> node; only enabled when the selected item is a video (mp4/webm); requires Workflow Studio to have been opened from ComfyUI's top menu button</li>
<li id="wfm-help-gallery-37"><b>Send CC Layout / Send CC Image</b> buttons (toolbar, shown only when this Gallery is opened inside ComfyUI Comic Creator; v0.8.11): Send CC Layout sends the selected image to the Layout tab's selected panel / overlay (an MP4 goes to the Video tool); Send CC Image switches to Comic Creator's Image tab and loads the selected image there (as a new layer if a document is open, otherwise as a new canvas; videos are not supported)</li>
<li id="wfm-help-gallery-28"><b>Create PSD</b> bulk button: combines all selected images into a single layered PSD file and downloads it — each image becomes its own layer (named after the file), positioned top-left on a canvas sized to the largest selected image; the last selected image ends up on top Convert... bulk button (shown when audio/video files are selected): converts audio files — or extracts the audio track of videos — to FLAC / MP3 / Opus / M4A / WAV (bitrate, sample rate, channels selectable) into the same folder as new files; prompt/workflow tags are carried over for formats that can hold them (WAV cannot), favorite/tags/memo/groups can be carried over, and the originals can optionally be deleted afterwards.</li>
<li id="wfm-help-gallery-29"><b>Edit as Layers</b> bulk button: switches to the Image Edit tab and opens all selected images at once, each as an independent layer (video files in the selection are skipped); the last selected image ends up on top</li>
<li id="wfm-help-gallery-33">Semantic Search (v0.8.2): the S button next to the search box turns semantic search on. When ON, the search box finds images by meaning using Gemini Embedding 2 or the local EmbeddingGemma 2 (e.g. 'sunset city street') - press Enter to search; results are ordered by similarity with a score badge. When OFF it is the normal filename/tag/prompt search. Turning S on also shows a second toolbar row with Similar, the update button, the settings button and the result count. The settings button (gear) opens a window to build/update/delete the index for the selected folder (optionally with subfolders); choose the model with the radio buttons (Gemini needs GEMINI_API_KEY in the plugin's .env + a ComfyUI restart; EmbeddingGemma 2 runs locally and downloads its model on first use). Switching model or vector size needs 'Rebuild all'. Searches cover the selected folder tree; sort and tag/group filters do not apply to semantic results</li>
<li id="wfm-help-gallery-33">Semantic Search (v0.8.2): the S button next to the search box turns semantic search on. When ON, the search box finds images by meaning using Gemini Embedding 2 or EmbeddingGemma 2 running in Ollama (e.g. 'sunset city street') - press Enter to search; results are ordered by similarity with a score badge. When OFF it is the normal filename/tag/prompt search. Turning S on also shows a second toolbar row with Similar, the update button, the settings button and the result count. The settings button (gear) opens a window to build/update/delete the index for the selected folder (optionally with subfolders); choose the model with the radio buttons (Gemini needs GEMINI_API_KEY in the plugin's .env + a ComfyUI restart; EmbeddingGemma 2 needs Ollama running locally with the model downloaded: ollama pull embeddinggemma-2:740m or embeddinggemma-2:440m). Switching model or vector size needs 'Rebuild all'. Searches cover the selected folder tree; sort and tag/group filters do not apply to semantic results</li>
<li id="wfm-help-gallery-34">Similar toggle and update button (second toolbar row, shown while S is ON): Similar shows images similar to the selected one (an image not yet indexed is embedded on the fly). Selecting another image keeps the list as is; press the update button to show images similar to the newly selected one, or press Similar again to return to the normal list. Changing folder, Clear filters or turning S off also leaves similar mode</li>
<li id="wfm-help-gallery-35">EmbeddingGemma 2 performance: by default it runs on the CPU with half of the cores (about 6 s per image at full precision). Image precision trades accuracy for speed (Standard is about 2.5x and Light about 5x faster; vectors differ, so changing it needs 'Rebuild all'); fewer CPU threads keep the PC lighter while generating images. To use an NVIDIA GPU, install onnxruntime-gpu into ComfyUI's Python (pip uninstall onnxruntime, then pip install onnxruntime-gpu; the CUDA runtime/cuDNN that ComfyUI's PyTorch uses is picked up) and restart ComfyUI: indexing then takes about 0.1 s per image (measured on an RTX 4070, about 45x faster than the CPU) and the results are identical to the CPU's. DirectML is not supported (its vision model fails to run). The model is released from memory when indexing finishes and reloaded on the next search</li>
<li id="wfm-help-gallery-36">Modal tabs and the similarity threshold: the Semantic settings window has three tabs - Index (target folder, rebuild mode, progress, delete all), Model (Gemini / EmbeddingGemma 2, vector size, device, CPU threads, image precision, connection test) and Search. On the Search tab you can set a minimum score for similar-image results (e.g. 0.6 shows only images scoring 0.6 or higher), a minimum score for text search, and the maximum number of results. Scores differ by model, so each model keeps its own values; the list header shows the active threshold</li>
<li id="wfm-help-gallery-35">EmbeddingGemma 2 runs in Ollama (the built-in ONNX runtime was removed, so onnxruntime-gpu is no longer needed for it). On the Model tab set the Ollama URL (default http://localhost:11434; other hosts must be listed in WFS_ALLOWED_BACKEND_HOSTS) and the model size: 740m (text + image + audio) or 440m (text + image, smaller). Both return identical vectors, so you can switch sizes without rebuilding; the ':latest' tag is the same as 740m and is used when 740m is not downloaded. 270m and 570m cannot embed images and are not offered. Indexes made with the earlier ONNX version keep working (the vectors match closely; use 'Rebuild all' to regenerate them exactly). Images are sent 4 at a time (about 0.1-0.2 s per image with an NVIDIA GPU). The model is unloaded from VRAM when indexing finishes and Ollama reloads it on the next search</li>
<li id="wfm-help-gallery-36">Modal tabs and the similarity threshold: the Semantic settings window has three tabs - Index (target folder, rebuild mode, progress, delete all), Model (Gemini / EmbeddingGemma 2, vector size, Ollama URL, model size, connection test) and Search. On the Search tab you can set a minimum score for similar-image results (e.g. 0.6 shows only images scoring 0.6 or higher), a minimum score for text search, and the maximum number of results. Scores differ by model, so each model keeps its own values; the list header shows the active threshold</li>
</ul>
</div>
<div class="wfm-help-card">
@@ -1994,6 +2003,33 @@
</div>
</div>
<div class="wfm-help-page" id="wfm-help-page-tagspace">
<div class="wfm-help-article-header">
<h2 id="wfm-help-tagspace-title">TagSpace Tab</h2>
<button type="button" class="wfm-btn wfm-btn-sm wfm-help-jump-btn" data-jump-tab="tagspace">Open tab &rarr;</button>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-tagspace-card-overview-title">Overview &amp; Building the Space</h3>
<ul>
<li id="wfm-help-tagspace-1">TagSpace places WFS's own data in the EmbeddingGemma 2 vector space and shows it in 3D: Cards (ImagePrompt images with their prompt, shown as thumbnails), Tags (words split out of ImagePrompt prompts, the positive prompts embedded in Gallery images, wildcards, the Tagger DB and the Prompt library, colored by source) and Gallery points (a sample of indexed Gallery images as a faint background, each carrying the tags from its own prompt). Nearby items have similar meanings</li>
<li id="wfm-help-tagspace-2">Requirements: Ollama running with EmbeddingGemma 2 (Gallery &gt; Semantic settings &gt; Model). If the Gallery semantic index was made with Gemini, rebuild it with EmbeddingGemma 2 first</li>
<li id="wfm-help-tagspace-3">Build / Update: collects the cards, adds card images that are not yet indexed to the Gallery semantic index, reads the positive prompt embedded in each indexed Gallery image (followed upstream from the sampler's positive input, never the negative; cached in tagspace_prompts.json so only new or changed images are read again), embeds new tags with Ollama (cached in tagspace_tags.npz) and projects everything to 3D with PCA. Tags: how many tags to keep — each source is ranked by how many prompts use a tag and the sources take turns, so the many Gallery prompts do not crowd out the other sources; Gallery points: how many Gallery images to show (0 = none). Prompts are split only at commas (and | { } BREAK), not at spaces; long sentences (over 5 words) are skipped. Images and text are centered separately before PCA so cards and their matching tags overlap. The first build took about 2.5 minutes for the cards plus about 3 minutes to read the prompts of 29,000 Gallery images; rebuilds with caches take seconds</li>
<li id="wfm-help-tagspace-9">Choosing how many tags: &quot;All tags&quot; uses every candidate tag instead of the Tags number (up to 20,000). &quot;Min uses&quot; drops tags used in fewer prompts than this, counted over all sources — 2 removes one-off typos and fragments. &quot;Wildcards&quot; turns wildcard files on or off as a tag source: words found only in wildcards make up most of the distinct tags (about 37,000 of 47,600 in testing), so turning it off with All tags gives about 10,400 tags (about 6,800 with Min uses 2). The status line shows the number of candidates when only part of them is used. New tags are embedded once (the first build with many new tags takes a few extra minutes)</li>
</ul>
</div>
<div class="wfm-help-card">
<h3 id="wfm-help-tagspace-card-use-title">Choosing Tags &amp; Making a Prompt</h3>
<ul>
<li id="wfm-help-tagspace-4">Navigation: drag to rotate, right-drag to pan, wheel to zoom. Hover shows the name, thumbnail and prompt/sources; the checkboxes show or hide Cards, Thumbnails, Tags and Gallery. The source checkboxes (ImagePrompt / Gallery prompts / Tagger DB / Prompt library / Wildcards) show or hide tags by where they came from — a tag stays visible while any of its sources is on and takes the color of its first visible source; hidden tags are also left out of the nearby and search lists. The choices are remembered</li>
<li id="wfm-help-tagspace-5">Click a card or tag to select it and list nearby items (clicking only selects — it does not change the prompt). To add it to the Prompt panel, double-click it, press Add next to its name under Selection, or press + in the list (double-click / press again to remove) — cards and tags are ranked separately and listed alternately, so a card also shows its closest tags. Adding a Gallery point adds all tags from that image's prompt as one chip (images without readable tags cannot be added); clicking one lists similar Gallery images (round thumbnails) together with nearby tags and cards; selecting a card or tag, or searching, never lists Gallery images. Use + in the list to add, click a row to move to it. The search box (Enter, any language) places a white marker for the text and lists the nearest items</li>
<li id="wfm-help-tagspace-10">Search with a card's or Gallery image's tags: when a card or Gallery point is selected, its prompt tags are shown as buttons (a card's full prompt is under &quot;Full prompt&quot;; card tags appear after Build / Update). Click tags to choose them (click again to deselect) and press &quot;Search with selected&quot; to search the space with those tags joined in prompt order — the same as typing them into the search box. The choice is kept until another item is selected. While tags are selected, the Add button becomes &quot;Add selected (N)&quot; and adds only those tags (in prompt order) as one chip; with none selected it adds the whole item as before. For a Gallery point, &quot;Open in Gallery&quot; opens the Gallery tab with the image's folder selected and the image selected in the list (search and other filters are cleared)</li>
<li id="wfm-help-tagspace-6">Prompt panel: a card adds its whole prompt, a tag adds the tag, a Gallery image adds its prompt tags. The text joins them with duplicates removed (case and spacing ignored). "Add to GenerateUI (Positive)" appends it to the positive prompt of the workflow loaded in GenerateUI; Copy puts it on the clipboard</li>
<li id="wfm-help-tagspace-7">Tagger fill: about a third of Gallery images have no readable positive prompt (imported or edited images, prompts made only of LoRA tags or long sentences). Choose a Tagger model (ONNX models from the Tagger tab) next to "Tagger fill" to tag those images on Build / Update: "Gallery points only" tags just the sampled Gallery points, "All images without a prompt" tags every indexed image that lacks prompt tags. Default thresholds are used (WD 0.35 / character 0.85, PixAI its recommended values) and rating labels are dropped. Results are cached in tagspace_tagger.json per image and model, so later builds only tag new images; stopping keeps what was done. The tags become the "Tagger fill" source (shown/hidden like the others) and the tags of those Gallery points, marked "(Tagger fill)". The status shows whether the model runs on CUDA or CPU — on the CPU it takes about 0.5 s per image, so check that onnxruntime-gpu is active (see Troubleshooting) before tagging all images</li>
<li id="wfm-help-tagspace-8">Display: "Glow" draws points as glowing stars on a night-sky background (dense areas brighten; Gallery points are drawn dimmer so they don't wash out to white) — turn it off for the plain dots and the normal background. "Twinkle" (works with Glow) makes tags, cards and Gallery points slowly twinkle, each with its own rhythm; the selection and nearby highlights stay steady. Hover over the image under Selection or the thumbnails in the Nearby list to see an enlarged preview (clicking a list row changes the selection, so hovering lets you check images first). The Add / Remove button sits on the title row of Selection and stays visible while the text scrolls</li>
</ul>
</div>
</div>
<div class="wfm-help-page" id="wfm-help-page-imageedit">
<div class="wfm-help-article-header">
<h2 id="wfm-help-imageedit-title">Image Edit Tab</h2>
@@ -2131,12 +2167,12 @@
<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 &amp; Last Frame to Video), and Wan2.2 (Text to Video) workflows, independent of the GenerateUI tab. The center panel's Plan / Edit / Asset subtabs handle batch generation, clip editing, and browsing generated videos; the sidebar's Project subtab handles saved plans (while Plan is active) or saved Edit projects (while Edit is active).</p>
<p id="wfm-help-video-desc">A dedicated video generation tab for MiniMax H3 (Image to Video), LTX-2.5 (Text / Image / First &amp; Last Frame to Video), Wan2.2 (Text to Video), and FastH3 OmniRef (MiniMax H3 Reference to Video) workflows, independent of the GenerateUI tab. The center panel's Plan / Edit / Asset subtabs handle batch generation, clip editing, and browsing generated videos; the sidebar's Project subtab handles saved plans (while Plan is active) or saved Edit projects (while Edit is active).</p>
<div class="wfm-help-card">
<ul>
<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-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, a Wan2.2 Text-to-Video node, or a FastH3 OmniRef (MiniMax H3 Reference-to-Video) node — for FastH3 / Pika-H3-Flex the First Image and Last Image fields become Reference Image (ref_image_0) and Reference Image 2 (ref_image_1); leaving either one empty (None / Clear) disconnects that reference input even if the workflow had an image wired to it; Reference Image 2 is never used as the previous block's last frame for "Use previous block's last frame" (the actually generated last frame is used instead) — 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; "Register as Asset" copies the loaded video into the output folder and tags it into Video Assets so it shows up in the Asset subtab), 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 — check "Add to Video Assets group" first to also tag the saved frame into Gallery's Video Assets group.</li>
@@ -2211,8 +2247,8 @@
<div class="wfm-help-card">
<h3 id="wfm-help-trouble-card-semantic-title">Semantic Search (Gallery)</h3>
<ul>
<li id="wfm-help-trouble-10">GPU not detected for EmbeddingGemma 2 (Semantic settings &gt; Model says 'No GPU detected', or the connection test reports CPU): the onnxruntime in ComfyUI's Python is the CPU build, so 'CUDAExecutionProvider' is missing. Fix: stop ComfyUI (files in use cannot be replaced), then in ComfyUI's Python run 'pip uninstall -y onnxruntime onnxruntime-gpu' followed by 'pip install --no-deps onnxruntime-gpu', and start ComfyUI again. It can silently return to the CPU build later: other packages that require 'onnxruntime' (e.g. insightface, rtmlib, qwen-tts) make pip install the CPU build over the GPU files whenever they are installed or updated, so if the GPU disappears after adding a custom node, repeat the fix. Requires an NVIDIA GPU with the CUDA runtime/cuDNN that ComfyUI's PyTorch uses; DirectML is not supported. Without a GPU the CPU is used automatically (slower)</li>
<li id="wfm-help-trouble-11">Semantic Search with Gemini says 'GEMINI_API_KEY is not set' or the key is rejected: add GEMINI_API_KEY=your-key (no leading #) to the plugin's .env file (copy .env.example), then restart ComfyUI - the .env file is only read at startup. Get a key at Google AI Studio. If you do not want to use the API, choose EmbeddingGemma 2 (local, no key) in Semantic settings &gt; Model</li>
<li id="wfm-help-trouble-10">EmbeddingGemma 2 says 'Cannot reach Ollama' or 'not downloaded': start Ollama (it must be running while indexing and searching) and check the Ollama URL in Semantic settings &gt; Model; download the model with 'ollama pull embeddinggemma-2:740m' (or embeddinggemma-2:440m). If indexing fails now and then with 'connection was forcibly closed' errors, security software that filters per-app traffic (e.g. AdGuard) may be interrupting ollama.exe - exclude Ollama from filtering. Failed requests are retried automatically; images that still fail are counted as failed and are picked up again by the next 'New / changed images only' run</li>
<li id="wfm-help-trouble-11">Semantic Search with Gemini says 'GEMINI_API_KEY is not set' or the key is rejected: add GEMINI_API_KEY=your-key (no leading #) to the plugin's .env file (copy .env.example), then restart ComfyUI - the .env file is only read at startup. Get a key at Google AI Studio. If you do not want to use the API, choose EmbeddingGemma 2 (Ollama, local, no key) in Semantic settings &gt; Model</li>
<li id="wfm-help-trouble-12">Semantic Search or Similar shows no results: results only include images that are already indexed inside the selected folder (a green dot in the folder tree means the folder is fully indexed) - build the index from the gear button first, and select a folder that contains indexed images. After changing the model, vector size or image precision, choose 'Rebuild all'. A minimum score set in Semantic settings &gt; Search can also hide everything; set it to 0 to check. The first search after indexing takes a few seconds because the local model is reloaded</li>
</ul>
</div>
@@ -2304,7 +2340,8 @@
<button id="wfm-gallery-send-genui-image-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to GenerateUI Image input">Send GenUI Image</button>
<button id="wfm-gallery-send-li-node-btn" class="wfm-btn wfm-btn-sm" title="Upload and write selected image's filename into the selected node's image widget (e.g. LoadImage)">Send to LI node</button>
<button id="wfm-gallery-send-lv-node-btn" class="wfm-btn wfm-btn-sm" title="Upload and write selected video's filename into the selected node's file widget (native Load Video node)">Send to LV node</button>
<button id="wfm-gallery-send-cc-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to ComfyUI Comic Creator's selected panel" style="display:none;">Send CC</button>
<button id="wfm-gallery-send-cc-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to ComfyUI Comic Creator's Layout tab (selected panel / overlay)" style="display:none;">Send CC Layout</button>
<button id="wfm-gallery-send-cc-image-btn" class="wfm-btn wfm-btn-sm" title="Send selected image to ComfyUI Comic Creator's Image tab" style="display:none;">Send CC Image</button>
</div>
<!-- Semantic Search ON時の2行目: 類似画像 / 更新 / 設定 / 結果件数 -->
<div id="wfm-gallery-sem-row" class="wfm-toolbar-row wfm-gallery-sem-row" style="display:none;">
@@ -3388,6 +3425,9 @@
</div>
</section>
<!-- TagSpace Tab (内容は tagspace-tab.js が生成) -->
<section id="wfm-tab-tagspace" class="wfm-tab-content"></section>
<!-- AI Tab -->
<section id="wfm-tab-ai" class="wfm-tab-content">
<!-- Translation pane -->
+34 -16
View File
@@ -652,17 +652,6 @@ window.wfmOpenMaskEditorForNode = async (imageDataUrl, maskDataUrl) => {
});
if (!resp.ok) throw new Error("Failed to send image to Mask Editor One");
// WFS側で既にマスクレイヤーを描いていた場合、それを初期マスクとしてそのまま引き継ぐ
// (applyImageAndMaskToMaskEditorOneNode の layer_data 形式と同じスキーマ)
if (maskDataUrl) {
const layerWidget = node.widgets?.find((w) => w.name === "layer_data");
if (layerWidget) {
layerWidget.value = JSON.stringify({
layers: [{ visible: true, opacity: 1, operation: "add", imageData: maskDataUrl }],
});
}
}
// ノード側のプレビュー/モーダル背景を、送信した画像に同期させる
node._bgDataUrl = imageDataUrl;
node._bgImg = await new Promise((r) => {
@@ -672,6 +661,29 @@ window.wfmOpenMaskEditorForNode = async (imageDataUrl, maskDataUrl) => {
img.src = imageDataUrl;
});
node._previewMode = "image";
// ワークフロー保存/再読み込み時に古い画像が復元されないよう、node.properties.bg_image を同期する
// (mask-editor-one 側が node._persistBgDataUrl を提供している場合のみ。旧バージョンでは無視)
if (typeof node._persistBgDataUrl === "function") {
node._persistBgDataUrl(imageDataUrl, "wfs_image.png").catch(() => {});
}
// WFS側で既にマスクレイヤーを描いていた場合、それを初期マスクとしてそのまま引き継ぐ
// (applyImageAndMaskToMaskEditorOneNode の layer_data 形式と同じスキーマ。
// width/height は送信画像のサイズで、ノードプレビュー復元時のレイヤーサイズ決定に使われる)
if (maskDataUrl) {
const layerWidget = node.widgets?.find((w) => w.name === "layer_data");
if (layerWidget) {
const layerData = {
layers: [{ visible: true, opacity: 1, operation: "add", imageData: maskDataUrl }],
};
if (node._bgImg) {
layerData.width = node._bgImg.naturalWidth;
layerData.height = node._bgImg.naturalHeight;
}
layerWidget.value = JSON.stringify(layerData);
}
}
node.setDirtyCanvas?.(true, true);
const prevMaskUrl = node._maskDataUrl;
@@ -3549,9 +3561,12 @@ function _extractPromptsAPI(wf) {
// 自ノードの"prompt"入力に直接テキストを持つ(positive/negativeの区別も無い)ため、
// _isTextEncoderNode判定を通さずtextMapへ直接投入する(fallbackのtextsに載る)。
// Gemini系の画像生成ノード(Nano Banana等)も同様に自ノードの"prompt"入力を持つ。
if (typeof n.inputs?.prompt === "string" && /ImageToVideo|TextToVideo|^Gemini(Image|NanoBanana)/i.test(ct)) {
textMap.set(id, n.inputs.prompt);
continue;
// FastH3 OmniRef(MiniMaxH3ReferenceToVideo)のように"prompt"が別ノードから配線される場合はリンク先を解決する。
if (/ImageToVideo|TextToVideo|ReferenceToVideo|^Gemini(Image|NanoBanana)/i.test(ct)) {
const pv = n.inputs?.prompt;
const txt = typeof pv === "string" ? pv : Array.isArray(pv) ? _resolveLinkedText(wf, pv[0], pv[1] ?? 0) : null;
if (txt) textMap.set(id, txt);
if (pv !== undefined) continue;
}
if (!_isTextEncoderNode(ct)) continue;
// "prompt" — TextEncodeQwenImageEdit(Plus)/TextEncodeBooguEdit and similar Image Edit
@@ -3586,8 +3601,11 @@ function _extractPromptsAPI(wf) {
// TextEncodeMageFlowEdit / TextEncodeBooguEdit — 1ノードでprompt/negative_prompt両方を
// 直接持つため、textMap(1ノード1テキスト)では両ロールを表現できない
const srcNode = wf[String(val[0])];
if (srcNode?.class_type === "TextEncodeMageFlowEdit" || srcNode?.class_type === "TextEncodeBooguEdit") {
const txt = isPos ? srcNode.inputs?.prompt : srcNode.inputs?.negative_prompt;
// TextEncodeFibo2(Fibo 2.0)も同形。promptはPreviewAny→プロンプト強化スイッチ経由でリンクされる。
if (srcNode?.class_type === "TextEncodeMageFlowEdit" || srcNode?.class_type === "TextEncodeBooguEdit"
|| srcNode?.class_type === "TextEncodeFibo2") {
const raw = isPos ? srcNode.inputs?.prompt : srcNode.inputs?.negative_prompt;
const txt = Array.isArray(raw) ? _resolveLinkedText(wf, raw[0], raw[1] ?? 0) : raw;
if (txt && typeof txt === "string") { if (isPos) pos.add(txt); else neg.add(txt); }
continue;
}