Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54940ccf87 | ||
|
|
db1e834f86 | ||
|
|
1db6fda6f1 | ||
|
|
6cdf4919e4 | ||
|
|
d9fc3bfcda | ||
|
|
410fdbc1bb |
@@ -2,6 +2,9 @@
|
||||
|
||||
Condensed version-by-version index of DEVLOG.md (each line: version + one-line summary of what changed and why). Full rationale, code details, and "How to apply" lessons live in the excluded DEVLOG.md itself; this index exists so graphify can extract a queryable semantic node per release without feeding the full log to the local Ollama model. Regenerate with `python tools/generate_doc_index.py devlog` whenever DEVLOG.md changes.
|
||||
|
||||
- **v0.9.3(2026-11-05)** — Image Edit: Drawツールのカラーパレット・ショートカット・スポイト(Comic Creator v1.67.0 から移植)
|
||||
- **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 対応)
|
||||
|
||||
@@ -2,6 +2,60 @@
|
||||
|
||||
---
|
||||
|
||||
## v0.9.3(2026-11-05)
|
||||
|
||||
### Image Edit: Drawツールのカラーパレット・ショートカット・スポイト(Comic Creator v1.67.0 から移植)
|
||||
|
||||
- 新規 `static/js/image-edit/DrawPalette.js`: Drawツールの2段目(`ie-tool-options`)に色1/色2、基本色20色、カスタム色20枠を表示する。右クリックで現在の色の登録・色の編集・削除(カスタム色)・初期の色に戻す(変更済みの基本色)。保存先は localStorage `ie_draw_palette_v1`。
|
||||
- `image-edit-tab.js`: 色の変更を `_setDrawColor` に集約し、モードは `_setDrawMode`、サイズは `_setDrawBrushSize` / `_stepDrawBrushSize` に分離。
|
||||
- ショートカット(Draw中のみ): `D` Draw / `E` Erase / `X` 色1・色2切替 / `[` `]` サイズ増減(1〜10pxは1、10〜50pxは5、50〜200pxは10刻み)/ `B` ブラシ選択の開閉。ブラシ選択の表示中は D/E/X/[/] を無効にし、Escで閉じる。他のツールからのBはこれまでどおりDrawへの切り替え。
|
||||
- スポイト: WFSのDrawツールには無かったためCC版から追加。右パネルのColorの隣のボタンからキャンバスの色を拾う。Esc・再クリック・ツール切替・キャンバス外クリック・Closeで解除。
|
||||
- ブラシの初期色を赤から黒に変更(色1/色2 = 黒/白)。
|
||||
|
||||
**CC版との違い**
|
||||
|
||||
- 色の引き継ぎは、Drawツールの表示時ではなく `_initCanvases` で `DrawTool` を作り直す時点で行う。
|
||||
- スポイトは `ie-canvas-draw` から色を読むため、アクティブレイヤーのみの表示なら合成し直してから読む。
|
||||
- 右クリックメニューを開いたままツールを切り替えても残らないよう、`_renderToolOptions` で閉じる。
|
||||
|
||||
**検証(Playwright、ComfyUI :8189)**: パレットからの描画色、登録と再読み込み後の保持、重複登録の通知、右クリックメニュー、基本色の復元、Color入力との連動、各ショートカット、入力欄やCtrl/Alt同時押しで反応しないこと、サイズの刻み、ブラシ選択の開閉、ブラシ未登録時の通知、Newでの色の引き継ぎ、スポイトの取得と解除、Undo履歴が増えないこと、別レイヤーの色の取得を確認。コンソールエラーなし。
|
||||
|
||||
**未確認**: 「色を編集…」で開くブラウザ標準のカラーピッカーの表示と、日本語キーボードでの `[` `]` の実打鍵。
|
||||
|
||||
**補足**: 透明部分をスポイトすると黒を拾う(CCと同じ)。描いた線から拾うと値が1ずれることがある。READMEのバージョンバッジが0.8.11のままだったので0.9.3に更新した。
|
||||
|
||||
---
|
||||
|
||||
## 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 に改訂
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
|
||||
- Built-in AI tools (translation and more)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Features (tab -> feature names)
|
||||
|
||||
@@ -128,10 +128,10 @@ Samples for the Feeder tab: `ws_sdxl_image_feeder_i2i` / `ws_dwpose_image_feeder
|
||||
|
||||
## Manual
|
||||
|
||||
A beginner-oriented manual (covers v0.9.0, 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.9.0_en.zip`
|
||||
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.9.0.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`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ A comprehensive workflow, asset management, and generation UI plugin for [ComfyU
|
||||
- Built-in AI tools (translation and more)
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -423,7 +423,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
|
||||
- **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)
|
||||
- **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
|
||||
@@ -442,7 +442,7 @@ An experimental batch generator: runs the workflow currently loaded in GenerateU
|
||||
- **New button** — create a blank canvas with custom dimensions (WxH prompt); clears all existing layers and automatically adds an empty Layer 1 (v0.3.70)
|
||||
- **Tools** — Select (V), Draw (B), Text (T), Shape (S), Fill (G), Mask (🎭), Blur (≈), BG Remove (⬚), Filter (★), Inpaint (🩹); tool options bar updates per active tool
|
||||
- **Select** — click to select; drag to move; drag corner handles to resize; drag circle handle to rotate; Flip H / Flip V / Rotate angle in the options bar; double-click a text layer to re-edit its content
|
||||
- **Draw** — freehand brush; options: color, brush size, blend mode; paints directly onto the active draw layer while all other layers remain visible; brush cursor shown as a size-accurate circle; strokes can start from outside the canvas margin and continue past the edge; **pen tablet support** (v0.6.2) — brush size and opacity respond to pen pressure (mouse behaves exactly as before); the canvas listens for Pointer Events so pen, touch, and mouse all work through the same code path
|
||||
- **Draw** — freehand brush; options: color, brush size, blend mode; paints directly onto the active draw layer while all other layers remain visible; brush cursor shown as a size-accurate circle; strokes can start from outside the canvas margin and continue past the edge; **pen tablet support** (v0.6.2) — brush size and opacity respond to pen pressure (mouse behaves exactly as before); the canvas listens for Pointer Events so pen, touch, and mouse all work through the same code path; **color palette** on the second row — Color 1/Color 2, 20 basic colors, and 20 custom slots (registered and edited colors are saved in the browser); **eyedropper** button next to Color picks a color from the canvas (`Esc` cancels); shortcuts while Draw is active: `D` Draw, `E` Erase, `X` switch Color 1/2, `[` `]` brush size, `B` open or close the brush picker (`Esc` also closes it)
|
||||
- **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
|
||||
@@ -595,10 +595,10 @@ Samples for the Feeder tab: `ws_sdxl_image_feeder_i2i` / `ws_dwpose_image_feeder
|
||||
|
||||
## Manual
|
||||
|
||||
A beginner-oriented manual (covers v0.9.0, 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.9.0_en.zip`
|
||||
- 日本語: [`docs/manual/`](docs/manual/) — ZIP: `Workflow_Studio_Manual_v0.9.0.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`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
ノードが苦手でも大丈夫 ― 画像生成をもっと手軽に、もっと整理して
|
||||
|
||||
- 対象バージョン:Workflow Studio v0.9.0
|
||||
- 対象バージョン:Workflow Studio v0.9.1
|
||||
- 著者:ketle-man
|
||||
- © 2026 ketle-man
|
||||
|
||||
このマニュアルは、Kindle版をもとにした **画像なしのテキスト版** です。
|
||||
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.9.0.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.9.0.md](Workflow_Studio_Manual_v0.9.0.md)
|
||||
全章まとめ:[Workflow_Studio_Manual_v0.9.1.md](Workflow_Studio_Manual_v0.9.1.md)
|
||||
|
||||
+9
-3
@@ -2,12 +2,12 @@
|
||||
|
||||
ノードが苦手でも大丈夫 ― 画像生成をもっと手軽に、もっと整理して
|
||||
|
||||
- 対象バージョン:Workflow Studio v0.9.0
|
||||
- 対象バージョン:Workflow Studio v0.9.1
|
||||
- 著者:ketle-man
|
||||
- © 2026 ketle-man
|
||||
|
||||
このマニュアルは、Kindle版をもとにした **画像なしのテキスト版** です。
|
||||
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.9.0.md` です。
|
||||
章ごとのファイルは `chapters/` フォルダ、全章をまとめたファイルは `Workflow_Studio_Manual_v0.9.1.md` です。
|
||||
画面の例は省略しているため、実際の画面はWorkflow Studioのヘルプタブとあわせてご覧ください。
|
||||
|
||||
---
|
||||
@@ -143,7 +143,7 @@ ComfyUIの「自由さ」はそのままに、「分かりやすさ」と「手
|
||||
|
||||
## 本書の対象バージョンと環境
|
||||
|
||||
- **Workflow Studio**:v0.9.0
|
||||
- **Workflow Studio**:v0.9.1
|
||||
- **ComfyUI**:本書執筆時点の最新版
|
||||
- **OS**:Windows(画面の例はWindowsのものです)
|
||||
|
||||
@@ -2977,6 +2977,12 @@ Workflow Studioとは別にインストールするソフトですが、両方
|
||||
カードやGallery点を選ぶと、**選択中** に、そのプロンプトのタグがボタンで並びます。
|
||||
タグをクリックして選び(もう一度で解除)、**選択したタグで空間検索** を押すと、選んだタグで空間を検索します。
|
||||
「この画像の、髪型と服装だけに近いものを探したい」といったときに便利です。
|
||||
タグを選んでいる間は、**選択中** の **追加** ボタンが **選択したタグを追加(N)** に変わり、選んだタグだけをプロンプト欄に追加できます。
|
||||
タグを選んでいなければ、これまでどおり全体(カードはプロンプト全文、Gallery点はすべてのタグ)が追加されます。
|
||||
|
||||
Gallery点を選んでいるときは、**選択中** に **Galleryで開く** ボタンも表示されます。
|
||||
押すとギャラリータブに切り替わり、その画像のフォルダが選ばれ、画像一覧でその画像が選択された状態になります(右の詳細も開きます)。
|
||||
画像が一覧に必ず出るよう、ギャラリーの検索・お気に入り・タグ・グループの絞り込みは解除されます。
|
||||
カードのプロンプト全文は、**プロンプト全文** を開くと読めます。
|
||||
|
||||
---
|
||||
BIN
Binary file not shown.
@@ -129,7 +129,7 @@ ComfyUIの「自由さ」はそのままに、「分かりやすさ」と「手
|
||||
|
||||
## 本書の対象バージョンと環境
|
||||
|
||||
- **Workflow Studio**:v0.9.0
|
||||
- **Workflow Studio**:v0.9.1
|
||||
- **ComfyUI**:本書執筆時点の最新版
|
||||
- **OS**:Windows(画面の例はWindowsのものです)
|
||||
|
||||
|
||||
@@ -317,6 +317,12 @@ Workflow Studioとは別にインストールするソフトですが、両方
|
||||
カードやGallery点を選ぶと、**選択中** に、そのプロンプトのタグがボタンで並びます。
|
||||
タグをクリックして選び(もう一度で解除)、**選択したタグで空間検索** を押すと、選んだタグで空間を検索します。
|
||||
「この画像の、髪型と服装だけに近いものを探したい」といったときに便利です。
|
||||
タグを選んでいる間は、**選択中** の **追加** ボタンが **選択したタグを追加(N)** に変わり、選んだタグだけをプロンプト欄に追加できます。
|
||||
タグを選んでいなければ、これまでどおり全体(カードはプロンプト全文、Gallery点はすべてのタグ)が追加されます。
|
||||
|
||||
Gallery点を選んでいるときは、**選択中** に **Galleryで開く** ボタンも表示されます。
|
||||
押すとギャラリータブに切り替わり、その画像のフォルダが選ばれ、画像一覧でその画像が選択された状態になります(右の詳細も開きます)。
|
||||
画像が一覧に必ず出るよう、ギャラリーの検索・お気に入り・タグ・グループの絞り込みは解除されます。
|
||||
カードのプロンプト全文は、**プロンプト全文** を開くと読めます。
|
||||
|
||||
---
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
Don't Be Afraid of Nodes - Generate Images More Easily and Keep Them Organized
|
||||
|
||||
- Covers: Workflow Studio v0.9.0
|
||||
- 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.9.0_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.9.0_en.md](Workflow_Studio_Manual_v0.9.0_en.md)
|
||||
Whole book: [Workflow_Studio_Manual_v0.9.1_en.md](Workflow_Studio_Manual_v0.9.1_en.md)
|
||||
|
||||
+9
-3
@@ -2,12 +2,12 @@
|
||||
|
||||
Don't Be Afraid of Nodes - Generate Images More Easily and Keep Them Organized
|
||||
|
||||
- Covers: Workflow Studio v0.9.0
|
||||
- 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.9.0_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.
|
||||
|
||||
---
|
||||
@@ -143,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.9.0
|
||||
- **Workflow Studio**: v0.9.1
|
||||
- **ComfyUI**: the latest version at the time of writing
|
||||
- **OS**: Windows (screen examples are from Windows)
|
||||
|
||||
@@ -2961,6 +2961,12 @@ Choose the settings in the toolbar and press **Build / Update**.
|
||||
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**.
|
||||
|
||||
---
|
||||
BIN
Binary file not shown.
@@ -129,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.9.0
|
||||
- **Workflow Studio**: v0.9.1
|
||||
- **ComfyUI**: the latest version at the time of writing
|
||||
- **OS**: Windows (screen examples are from Windows)
|
||||
|
||||
|
||||
@@ -311,6 +311,12 @@ Choose the settings in the toolbar and press **Build / Update**.
|
||||
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**.
|
||||
|
||||
---
|
||||
|
||||
@@ -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()
|
||||
|
||||
+1
-1
@@ -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.9.0"
|
||||
version = "0.9.3"
|
||||
license = { file = "LICENSE" }
|
||||
requires-python = ">= 3.10"
|
||||
dependencies = ["jinja2"]
|
||||
|
||||
@@ -466,3 +466,103 @@
|
||||
background: var(--wfm-border);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* Draw tool palette */
|
||||
.ie-palette-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 14px;
|
||||
}
|
||||
|
||||
.ie-palette-wells {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.ie-palette-well,
|
||||
.ie-palette-swatch {
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
background: var(--swatch, transparent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ie-palette-well {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border: 1px solid var(--wfm-text-secondary);
|
||||
}
|
||||
|
||||
.ie-palette-well.is-active {
|
||||
outline: 2px solid var(--wfm-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.ie-palette-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(10, 16px);
|
||||
grid-auto-rows: 16px;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.ie-palette-swatch {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 1px solid rgba(128, 128, 128, 0.7);
|
||||
}
|
||||
|
||||
.ie-palette-swatch.is-empty {
|
||||
border-color: var(--wfm-text-secondary);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.ie-palette-swatch:hover,
|
||||
.ie-palette-swatch:focus-visible,
|
||||
.ie-palette-well:focus-visible {
|
||||
outline: 1px solid var(--wfm-text);
|
||||
outline-offset: 1px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.ie-palette-swatch.is-current {
|
||||
outline: 2px solid var(--wfm-primary);
|
||||
outline-offset: 0;
|
||||
}
|
||||
|
||||
.ie-palette-picker {
|
||||
position: fixed;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ie-palette-menu {
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 150px;
|
||||
padding: 4px;
|
||||
border: 1px solid var(--wfm-border);
|
||||
border-radius: 4px;
|
||||
background: var(--wfm-surface);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.ie-palette-menu button {
|
||||
padding: 5px 10px;
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
background: transparent;
|
||||
color: var(--wfm-text);
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ie-palette-menu button:hover {
|
||||
background: var(--wfm-surface-hover);
|
||||
}
|
||||
|
||||
@@ -645,6 +645,8 @@ function applyI18nToHtml() {
|
||||
"wfm-help-imageedit-26": "helpImageEdit26", "wfm-help-imageedit-27": "helpImageEdit27",
|
||||
"wfm-help-imageedit-28": "helpImageEdit28", "wfm-help-imageedit-29": "helpImageEdit29",
|
||||
"wfm-help-imageedit-30": "helpImageEdit30",
|
||||
"wfm-help-imageedit-draw-palette": "helpImageEditDrawPalette", "wfm-help-imageedit-draw-kbd": "helpImageEditDrawKbd",
|
||||
"wfm-help-imageedit-tabkbd-draw": "helpImageEditDrawKbd",
|
||||
"wfm-help-imageedit-31": "helpImageEdit31", "wfm-help-imageedit-32": "helpImageEdit32",
|
||||
"wfm-help-imageedit-33": "helpImageEdit33", "wfm-help-imageedit-34": "helpImageEdit34",
|
||||
"wfm-help-imageedit-7b": "helpImageEdit7b", "wfm-help-imageedit-7c": "helpImageEdit7c",
|
||||
|
||||
@@ -2146,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() {
|
||||
|
||||
+69
-3
@@ -790,6 +790,10 @@ const LANGUAGES = {
|
||||
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.",
|
||||
@@ -1185,7 +1189,7 @@ const LANGUAGES = {
|
||||
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",
|
||||
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",
|
||||
@@ -1383,6 +1387,24 @@ const LANGUAGES = {
|
||||
helpImageEditGmicInstall2: "Extract the zip to any folder (e.g. C:\\tools\\gmic); no installer required",
|
||||
helpImageEditGmicInstall3: "Open Settings → G'MIC-Qt Executable Path, enter the full path to gmic_qt.exe (e.g. C:\\tools\\gmic\\gmic_qt.exe), then click Save",
|
||||
helpImageEditTabKbdTitle: "Image Edit Tab Shortcuts",
|
||||
imageEditPaletteColor1: "Color 1",
|
||||
imageEditPaletteColor2: "Color 2",
|
||||
imageEditPaletteBase: "Basic",
|
||||
imageEditPaletteCustom: "Custom",
|
||||
imageEditPaletteAddTitle: "Register the current color in the next empty custom slot",
|
||||
imageEditPaletteEmptyTitle: "Click to register the current color; right-click to choose a color",
|
||||
imageEditPaletteSwatchTitle: "Click to use; right-click to register or edit",
|
||||
imageEditPaletteRegisterCurrent: "Register current color",
|
||||
imageEditPaletteEditColor: "Edit color…",
|
||||
imageEditPalettePickColor: "Choose color to register…",
|
||||
imageEditPaletteDelete: "Delete",
|
||||
imageEditPaletteResetBase: "Restore default color",
|
||||
imageEditPaletteExists: "This color is already registered",
|
||||
imageEditPaletteFull: "All custom color slots are full. Right-click a slot to overwrite or delete it",
|
||||
imageEditNoAbrBrushes: "No brushes available. Import ABR brushes in Mask Editor One",
|
||||
helpImageEditDrawPalette: "Draw color palette (second row): Color 1/Color 2, 20 basic colors, and 20 custom slots. Click a color to paint with it. Use + or click an empty slot to register the current color; right-click a color to register, edit, or delete it (basic colors can be changed and restored). Registered colors are saved per browser. The eyedropper button next to Color picks a color from the canvas (Esc cancels)",
|
||||
imageEditPixelColorFail: "Could not read pixel color",
|
||||
helpImageEditDrawKbd: "While Draw is active: D Draw / E Erase / X switch Color 1/2 / [ ] brush size / B open or close the brush picker (Esc also closes it)",
|
||||
helpShortcutsTitle: "Keyboard Shortcuts",
|
||||
helpShortcuts1: "Escape: Close modal/panel",
|
||||
helpShortcuts2: "Enter: Confirm rename, send chat",
|
||||
@@ -2595,6 +2617,10 @@ const LANGUAGES = {
|
||||
tsPickSearch: (n) => `選択したタグで空間検索(${n})`,
|
||||
tsPickClear: "選択解除",
|
||||
tsFullPrompt: "プロンプト全文",
|
||||
tsAddPicked: (n) => `選択したタグを追加(${n})`,
|
||||
tsOpenInGallery: "Galleryで開く",
|
||||
tsRevealFailed: "この画像をGalleryで表示できませんでした(GalleryのOutputフォルダの外にあるか、画像が見つかりません)",
|
||||
tsChipPicked: (name, n) => `${name}(${n}タグ)`,
|
||||
tsListEmpty: "要素を選ぶか検索すると、近いカードやタグを一覧表示します。",
|
||||
tsBuilderTitle: "プロンプト",
|
||||
tsChipsEmpty: "空間のカードやタグをダブルクリックするか、「追加」・一覧の+で追加できます。",
|
||||
@@ -2990,7 +3016,7 @@ const LANGUAGES = {
|
||||
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点を選ぶと、プロンプトのタグがボタンで表示されます(カードのプロンプト全文は「プロンプト全文」で表示。カードのタグは「作成 / 更新」後に表示されます)。タグをクリックして選び(もう一度で解除)、「選択したタグで空間検索」を押すと、選んだタグをプロンプトの順につないだ文で空間を検索します(検索欄に入力した場合と同じ)。選択は別の要素を選ぶまで保持されます",
|
||||
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ならそのタグは表示され、色は表示中の出典のうち最初のものになります。非表示のタグは近くの要素・検索結果の一覧からも除かれます。選択は保存されます",
|
||||
@@ -3188,6 +3214,24 @@ const LANGUAGES = {
|
||||
helpImageEditGmicInstall2: "zipを任意のフォルダに解凍する(例: C:\\tools\\gmic);インストーラー不要",
|
||||
helpImageEditGmicInstall3: "設定タブ → G'MIC-Qt Executable Path に gmic_qt.exe のフルパスを入力(例: C:\\tools\\gmic\\gmic_qt.exe)して Save をクリック",
|
||||
helpImageEditTabKbdTitle: "Image Edit タブのショートカット",
|
||||
imageEditPaletteColor1: "色1",
|
||||
imageEditPaletteColor2: "色2",
|
||||
imageEditPaletteBase: "基本色",
|
||||
imageEditPaletteCustom: "カスタム",
|
||||
imageEditPaletteAddTitle: "現在の色をカスタム色の空き枠に登録します",
|
||||
imageEditPaletteEmptyTitle: "クリックで現在の色を登録・右クリックで色を指定",
|
||||
imageEditPaletteSwatchTitle: "クリックで使用・右クリックで登録/編集",
|
||||
imageEditPaletteRegisterCurrent: "現在の色を登録",
|
||||
imageEditPaletteEditColor: "色を編集…",
|
||||
imageEditPalettePickColor: "色を指定して登録…",
|
||||
imageEditPaletteDelete: "削除",
|
||||
imageEditPaletteResetBase: "初期の色に戻す",
|
||||
imageEditPaletteExists: "この色は登録済みです",
|
||||
imageEditPaletteFull: "カスタム色の枠がいっぱいです。右クリックで上書きするか削除してください",
|
||||
imageEditNoAbrBrushes: "ブラシがありません。Mask Editor OneでABRブラシをインポートしてください",
|
||||
helpImageEditDrawPalette: "Drawのカラーパレット(2段目):色1/色2、基本色20色、カスタム色20枠。色をクリックするとその色で描けます。「+」か空き枠のクリックで現在の色を登録し、色の上で右クリックすると登録・編集・削除ができます(基本色も変更でき、初期の色に戻せます)。登録した色はブラウザごとに保存されます。Colorの隣のスポイトボタンでキャンバスから色を拾えます(Escで取り消し)",
|
||||
imageEditPixelColorFail: "ピクセルの色を取得できませんでした",
|
||||
helpImageEditDrawKbd: "Drawツール中:D Draw / E Erase / X 色1・色2の切り替え / [ ] ブラシサイズ / B ブラシ選択の開閉(Escでも閉じます)",
|
||||
helpShortcutsTitle: "キーボード操作",
|
||||
helpShortcuts1: "Escape:モーダル・パネルを閉じる",
|
||||
helpShortcuts2: "Enter:名前変更の確定、チャット送信",
|
||||
@@ -4400,6 +4444,10 @@ const LANGUAGES = {
|
||||
tsPickSearch: (n) => `用所选标签搜索空间(${n})`,
|
||||
tsPickClear: "取消选择",
|
||||
tsFullPrompt: "完整提示词",
|
||||
tsAddPicked: (n) => `添加所选标签(${n})`,
|
||||
tsOpenInGallery: "在Gallery中打开",
|
||||
tsRevealFailed: "无法在Gallery中显示该图像(位于Gallery的Output文件夹之外,或图像不存在)",
|
||||
tsChipPicked: (name, n) => `${name}(${n}个标签)`,
|
||||
tsListEmpty: "选择元素或搜索后,会列出附近的卡片和标签。",
|
||||
tsBuilderTitle: "提示词",
|
||||
tsChipsEmpty: "双击空间中的卡片或标签,或使用“添加”·列表中的+即可添加。",
|
||||
@@ -4795,7 +4843,7 @@ const LANGUAGES = {
|
||||
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点后,其提示词标签以按钮显示(卡片的完整提示词在“完整提示词”中显示;卡片标签在“创建 / 更新”后显示)。点击标签进行选择(再次点击取消),按“用所选标签搜索空间”即可将所选标签按提示词顺序连接后搜索空间(与在搜索框中输入相同)。在选择其他元素之前会保留所选内容",
|
||||
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库/通配符)可按来源显示或隐藏标签:只要标签的任一来源为开启就会显示,颜色取显示中来源的第一个;隐藏的标签也会从附近元素和搜索结果列表中排除。所选内容会被保存",
|
||||
@@ -4993,6 +5041,24 @@ const LANGUAGES = {
|
||||
helpImageEditGmicInstall2: "将zip解压到任意文件夹(如 C:\\tools\\gmic);无需安装程序",
|
||||
helpImageEditGmicInstall3: "打开设置 → G'MIC-Qt Executable Path,输入 gmic_qt.exe 的完整路径(如 C:\\tools\\gmic\\gmic_qt.exe),点击 Save",
|
||||
helpImageEditTabKbdTitle: "图像编辑选项卡快捷键",
|
||||
imageEditPaletteColor1: "颜色1",
|
||||
imageEditPaletteColor2: "颜色2",
|
||||
imageEditPaletteBase: "基本色",
|
||||
imageEditPaletteCustom: "自定义",
|
||||
imageEditPaletteAddTitle: "将当前颜色登记到自定义颜色的空位",
|
||||
imageEditPaletteEmptyTitle: "单击登记当前颜色,右键指定颜色",
|
||||
imageEditPaletteSwatchTitle: "单击使用,右键登记或编辑",
|
||||
imageEditPaletteRegisterCurrent: "登记当前颜色",
|
||||
imageEditPaletteEditColor: "编辑颜色…",
|
||||
imageEditPalettePickColor: "指定颜色并登记…",
|
||||
imageEditPaletteDelete: "删除",
|
||||
imageEditPaletteResetBase: "恢复初始颜色",
|
||||
imageEditPaletteExists: "此颜色已登记",
|
||||
imageEditPaletteFull: "自定义颜色已满。请右键覆盖或删除",
|
||||
imageEditNoAbrBrushes: "没有可用画笔。请在 Mask Editor One 中导入 ABR 画笔",
|
||||
helpImageEditDrawPalette: "Draw调色板(第二行):颜色1/颜色2、20种基本色和20个自定义颜色位。单击颜色即可用该颜色绘制。使用“+”或单击空位可登记当前颜色;在颜色上右键可登记、编辑或删除(基本色也可修改并恢复初始颜色)。登记的颜色按浏览器分别保存。使用Color旁的吸管按钮可从画布取色(按Esc取消)",
|
||||
imageEditPixelColorFail: "无法读取像素颜色",
|
||||
helpImageEditDrawKbd: "Draw工具使用中:D Draw / E Erase / X 切换颜色1/2 / [ ] 笔刷大小 / B 打开或关闭笔刷选择(也可按Esc关闭)",
|
||||
helpShortcutsTitle: "键盘操作",
|
||||
helpShortcuts1: "Escape:关闭弹窗/面板",
|
||||
helpShortcuts2: "Enter:确认重命名、发送聊天",
|
||||
|
||||
+140
-26
@@ -6,6 +6,7 @@
|
||||
|
||||
import { LayerManager, Layer } from "./image-edit/LayerManager.js";
|
||||
import { DrawTool } from "./image-edit/DrawTool.js";
|
||||
import { DrawPalette } from "./image-edit/DrawPalette.js";
|
||||
import { TextTool, TEXT_FONTS } from "./image-edit/TextTool.js";
|
||||
import { SelectTool } from "./image-edit/SelectTool.js";
|
||||
import { ShapeTool } from "./image-edit/ShapeTool.js";
|
||||
@@ -20,10 +21,22 @@ import { MaskEditorOneBridge } from "./image-edit/MaskEditorOneBridge.js";
|
||||
import { InpaintI2IActions } from "./image-edit/InpaintI2IActions.js";
|
||||
import { FileExport } from "./image-edit/FileExport.js";
|
||||
import { showToast } from "./app.js";
|
||||
import { t as tr } from "./i18n.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
import { comfyWorkflow } from "./comfyui-workflow.js";
|
||||
|
||||
// Draw Tool: スポイト(Eyedropper)アイコン。ボタンとカスタムカーソルの両方で使い回す。
|
||||
const EYEDROPPER_ICON_PATH = "M20.71 5.63l-2.34-2.34a1 1 0 0 0-1.41 0L14.7 5.55 12 8.24 3 17.24V21h3.76l9-9 2.69-2.69 2.26-2.26a1 1 0 0 0 0-1.41zM6.34 19H5v-1.34l8.06-8.06 1.41 1.41L6.34 19z";
|
||||
const EYEDROPPER_ICON_SVG =
|
||||
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="${EYEDROPPER_ICON_PATH}"/></svg>`;
|
||||
|
||||
function _eyedropperCursorCss() {
|
||||
const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>`
|
||||
+ `<path d='${EYEDROPPER_ICON_PATH}' fill='%23ffffff' stroke='%23000000' stroke-width='1'/></svg>`;
|
||||
return `url("data:image/svg+xml,${svg}") 2 22, crosshair`;
|
||||
}
|
||||
|
||||
const TOOL_DEFS = [
|
||||
{ id: "select", icon: "▲", label: "Select", ready: true },
|
||||
{ id: "draw", icon: "✏", label: "Draw", ready: true },
|
||||
@@ -49,6 +62,11 @@ class ImageEditTab {
|
||||
this._layerMgr = null;
|
||||
this._activeTool = "select";
|
||||
this._drawTool = new DrawTool(null);
|
||||
this._eyedropperActive = false; // Drawツールのスポイト(色抽出)モード
|
||||
this._drawPalette = new DrawPalette({
|
||||
onColorChange: hex => this._setDrawColor(hex),
|
||||
toast: showToast,
|
||||
});
|
||||
this._textTool = new TextTool(null);
|
||||
this._selectTool = new SelectTool();
|
||||
this._zoom = 1.0;
|
||||
@@ -196,6 +214,7 @@ class ImageEditTab {
|
||||
_updateBrushCursor(e) {
|
||||
const el = this._brushCursorEl;
|
||||
if (!el) return;
|
||||
this._lastBrushCursorEvent = e; // キー操作でサイズを変えたときに再描画するため保持
|
||||
const tool = this._activeTool;
|
||||
const size = tool === "draw"
|
||||
? this._drawTool?.brushSize
|
||||
@@ -226,6 +245,79 @@ class ImageEditTab {
|
||||
if (this._brushCursorEl) this._brushCursorEl.style.display = "none";
|
||||
}
|
||||
|
||||
// ── Draw: スポイト(Eyedropper) ─────────────────
|
||||
|
||||
_setEyedropperActive(active) {
|
||||
this._eyedropperActive = active;
|
||||
const drawCanvas = document.getElementById("ie-canvas-draw");
|
||||
const overlay = document.getElementById("ie-canvas-overlay");
|
||||
const cursor = active ? _eyedropperCursorCss() : "";
|
||||
if (drawCanvas) drawCanvas.style.cursor = cursor;
|
||||
if (overlay) overlay.style.cursor = cursor;
|
||||
if (active) this._hideBrushCursor();
|
||||
document.getElementById("ie-draw-eyedropper")?.classList.toggle("ie-opt-active", active);
|
||||
}
|
||||
|
||||
_pickColorAt(x, y) {
|
||||
const canvas = document.getElementById("ie-canvas-draw");
|
||||
const px = Math.floor(x), py = Math.floor(y);
|
||||
if (!canvas || px < 0 || py < 0 || px >= canvas.width || py >= canvas.height) {
|
||||
this._setEyedropperActive(false);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 見えている色を拾うため、アクティブレイヤーのみの表示なら合成し直す
|
||||
if (!this._compositeMode) this._updateCompositeView();
|
||||
const [r, g, b] = canvas.getContext("2d").getImageData(px, py, 1, 1).data;
|
||||
const hex = "#" + [r, g, b].map(v => v.toString(16).padStart(2, "0")).join("");
|
||||
this._setDrawColor(hex);
|
||||
this._drawPalette.syncColor(hex);
|
||||
} catch {
|
||||
showToast(tr("imageEditPixelColorFail"), "error");
|
||||
}
|
||||
this._setEyedropperActive(false);
|
||||
}
|
||||
|
||||
_setDrawMode(mode) {
|
||||
this._drawTool.mode = mode;
|
||||
this._drawTool._stamp = null;
|
||||
this._renderDrawProps();
|
||||
}
|
||||
|
||||
_setDrawBrushSize(size) {
|
||||
this._drawTool.brushSize = size;
|
||||
this._drawTool._stamp = null;
|
||||
const slider = document.getElementById("ie-draw-size");
|
||||
if (slider) slider.value = size;
|
||||
const label = document.getElementById("ie-draw-size-lbl");
|
||||
if (label) label.textContent = size + "px";
|
||||
if (this._lastBrushCursorEvent && !this._eyedropperActive) {
|
||||
this._updateBrushCursor(this._lastBrushCursorEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/** [ / ] キー: サイズが大きいほど刻みを粗くする */
|
||||
_stepDrawBrushSize(direction) {
|
||||
const size = this._drawTool.brushSize;
|
||||
const base = direction < 0 ? size - 1 : size;
|
||||
const step = base < 10 ? 1 : base < 50 ? 5 : 10;
|
||||
this._setDrawBrushSize(Math.min(200, Math.max(1, size + direction * step)));
|
||||
}
|
||||
|
||||
/** Drawツール中のBキー: ブラシ選択モーダルを開閉する */
|
||||
_toggleDrawBrushPicker() {
|
||||
if (this._abrAvailable) this._openAbrBrushPickerForDraw();
|
||||
else showToast(tr("imageEditNoAbrBrushes"), "info");
|
||||
}
|
||||
|
||||
_setDrawColor(hex) {
|
||||
this._drawTool.color = hex;
|
||||
this._drawTool._stamp = null;
|
||||
this._drawTool._imgStamp = null;
|
||||
const input = document.getElementById("ie-draw-color");
|
||||
if (input) input.value = hex;
|
||||
}
|
||||
|
||||
// ── ツールボタン ──────────────────────────────
|
||||
|
||||
_setupToolButtons() {
|
||||
@@ -240,6 +332,7 @@ class ImageEditTab {
|
||||
|
||||
_setActiveTool(toolId) {
|
||||
this._hideBrushCursor();
|
||||
if (this._eyedropperActive) this._setEyedropperActive(false);
|
||||
if (this._activeTool === "draw") this._drawTool?.deactivate();
|
||||
if (this._activeTool === "text") this._textTool?.deactivate();
|
||||
if (this._activeTool === "select") this._selectTool?.deactivate();
|
||||
@@ -306,6 +399,7 @@ class ImageEditTab {
|
||||
_renderToolOptions(toolId) {
|
||||
const el = document.getElementById("ie-tool-options");
|
||||
if (!el) return;
|
||||
this._drawPalette.closeMenu();
|
||||
el.innerHTML = "";
|
||||
|
||||
if (toolId === "select" && this._selectTool) {
|
||||
@@ -355,6 +449,7 @@ class ImageEditTab {
|
||||
|
||||
} else if (toolId === "draw" && this._drawTool) {
|
||||
el.innerHTML = "";
|
||||
this._drawPalette.render(el);
|
||||
this._renderDrawProps();
|
||||
|
||||
} else if (toolId === "fill" && this._fillTool) {
|
||||
@@ -873,18 +968,22 @@ class ImageEditTab {
|
||||
<div class="ie-props-row">
|
||||
<label>Mode</label>
|
||||
<div style="display:flex;gap:4px;">
|
||||
<button class="wfm-btn wfm-btn-sm${t.mode === "draw" ? " ie-opt-active" : ""}" id="ie-draw-mode-draw" style="flex:1;">Draw</button>
|
||||
<button class="wfm-btn wfm-btn-sm${t.mode === "erase" ? " ie-opt-active" : ""}" id="ie-draw-mode-erase" style="flex:1;">Erase</button>
|
||||
<button class="wfm-btn wfm-btn-sm${t.mode === "draw" ? " ie-opt-active" : ""}" id="ie-draw-mode-draw" title="Draw (D)" style="flex:1;">Draw</button>
|
||||
<button class="wfm-btn wfm-btn-sm${t.mode === "erase" ? " ie-opt-active" : ""}" id="ie-draw-mode-erase" title="Erase (E)" style="flex:1;">Erase</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ie-props-row">
|
||||
<label>Color</label>
|
||||
<input type="color" id="ie-draw-color" value="${t.color}"
|
||||
style="width:36px;height:24px;padding:0;border:1px solid var(--wfm-border);cursor:pointer;border-radius:3px;flex-shrink:0;">
|
||||
<div style="display:flex;gap:4px;align-items:center;">
|
||||
<input type="color" id="ie-draw-color" value="${t.color}"
|
||||
style="width:36px;height:24px;padding:0;border:1px solid var(--wfm-border);cursor:pointer;border-radius:3px;flex-shrink:0;">
|
||||
<button class="wfm-btn wfm-btn-sm${this._eyedropperActive ? " ie-opt-active" : ""}" id="ie-draw-eyedropper"
|
||||
title="Eyedropper" style="flex-shrink:0;width:auto;height:24px;padding:2px 6px;display:flex;align-items:center;justify-content:center;">${EYEDROPPER_ICON_SVG}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ie-props-row">
|
||||
<label>Size</label>
|
||||
<input type="range" id="ie-draw-size" min="1" max="200" value="${t.brushSize}">
|
||||
<label title="[ / ]">Size</label>
|
||||
<input type="range" id="ie-draw-size" min="1" max="200" value="${t.brushSize}" title="[ / ]">
|
||||
<span id="ie-draw-size-lbl">${t.brushSize}px</span>
|
||||
</div>
|
||||
<div class="ie-props-row">
|
||||
@@ -906,7 +1005,7 @@ class ImageEditTab {
|
||||
<label>Brush</label>
|
||||
<span style="font-size:11px;color:var(--wfm-text-secondary);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"
|
||||
title="${t.brushName ?? "Circle"}">${t.brushName ?? "Circle"}</span>
|
||||
<button class="wfm-btn wfm-btn-sm" id="ie-draw-select-brush" style="font-size:10px;padding:1px 6px;flex-shrink:0;" ${this._abrAvailable ? "" : "disabled"}>Select</button>
|
||||
<button class="wfm-btn wfm-btn-sm" id="ie-draw-select-brush" title="B" style="font-size:10px;padding:1px 6px;flex-shrink:0;" ${this._abrAvailable ? "" : "disabled"}>Select</button>
|
||||
${t.brushImage ? `<button class="wfm-btn wfm-btn-sm" id="ie-draw-clear-brush" style="font-size:10px;padding:1px 5px;flex-shrink:0;">✕</button>` : ""}
|
||||
</div>
|
||||
${t.brushImage ? `
|
||||
@@ -933,25 +1032,17 @@ class ImageEditTab {
|
||||
</div>` : ""}
|
||||
`;
|
||||
|
||||
document.getElementById("ie-draw-mode-draw")?.addEventListener("click", () => {
|
||||
this._drawTool.mode = "draw";
|
||||
this._drawTool._stamp = null;
|
||||
this._renderDrawProps();
|
||||
});
|
||||
document.getElementById("ie-draw-mode-erase")?.addEventListener("click", () => {
|
||||
this._drawTool.mode = "erase";
|
||||
this._drawTool._stamp = null;
|
||||
this._renderDrawProps();
|
||||
});
|
||||
document.getElementById("ie-draw-mode-draw")?.addEventListener("click", () => this._setDrawMode("draw"));
|
||||
document.getElementById("ie-draw-mode-erase")?.addEventListener("click", () => this._setDrawMode("erase"));
|
||||
document.getElementById("ie-draw-color")?.addEventListener("input", e => {
|
||||
this._drawTool.color = e.target.value;
|
||||
this._drawTool._stamp = null;
|
||||
this._drawTool._imgStamp = null;
|
||||
this._setDrawColor(e.target.value);
|
||||
this._drawPalette.syncColor(e.target.value);
|
||||
});
|
||||
document.getElementById("ie-draw-eyedropper")?.addEventListener("click", () => {
|
||||
this._setEyedropperActive(!this._eyedropperActive);
|
||||
});
|
||||
document.getElementById("ie-draw-size")?.addEventListener("input", e => {
|
||||
this._drawTool.brushSize = parseInt(e.target.value);
|
||||
document.getElementById("ie-draw-size-lbl").textContent = e.target.value + "px";
|
||||
this._drawTool._stamp = null;
|
||||
this._setDrawBrushSize(parseInt(e.target.value));
|
||||
});
|
||||
document.getElementById("ie-draw-hard")?.addEventListener("input", e => {
|
||||
this._drawTool.hardness = parseInt(e.target.value) / 100;
|
||||
@@ -1461,7 +1552,9 @@ class ImageEditTab {
|
||||
}
|
||||
// Draw/Mask: update brush cursor and continue stroke outside canvas
|
||||
const tool = this._activeTool;
|
||||
if (tool === "draw" || tool === "mask") {
|
||||
if (this._eyedropperActive) {
|
||||
this._hideBrushCursor();
|
||||
} else if (tool === "draw" || tool === "mask") {
|
||||
this._updateBrushCursor(e);
|
||||
const isDrawing = tool === "draw"
|
||||
? this._drawTool?._drawing
|
||||
@@ -1514,6 +1607,11 @@ class ImageEditTab {
|
||||
// PointerEvent.pressure: pen -> actual pressure, mouse -> 0.5 while a button is held.
|
||||
const pressure = e.pressure || 0.5;
|
||||
|
||||
if (this._eyedropperActive) {
|
||||
this._pickColorAt(pos.x, pos.y);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._activeTool === "draw" && this._drawTool) {
|
||||
const activeLayer = this._layerMgr.activeLayer;
|
||||
if (!activeLayer) return;
|
||||
@@ -1781,6 +1879,7 @@ class ImageEditTab {
|
||||
|
||||
// 現在のドキュメントを閉じ、未保存の変更を破棄してプレースホルダー表示に戻す
|
||||
_closeDocument() {
|
||||
if (this._eyedropperActive) this._setEyedropperActive(false);
|
||||
if (!this._layerMgr) return;
|
||||
if (!confirm("Close the current document? Unsaved changes will be lost.")) return;
|
||||
|
||||
@@ -1848,6 +1947,8 @@ class ImageEditTab {
|
||||
this._layerMgr.on("change", () => this._refreshLayerList());
|
||||
|
||||
this._drawTool = new DrawTool(null);
|
||||
// 新規ドキュメントでも選択中の色を引き継ぐ(パレットを色の正とする)
|
||||
this._drawTool.color = this._drawPalette.currentColor;
|
||||
this._drawTool.onChange(() => {
|
||||
// layer.canvas に直接描くため sync 不要
|
||||
this._updateCompositeView();
|
||||
@@ -2458,6 +2559,9 @@ class ImageEditTab {
|
||||
const wrap = document.getElementById("ie-canvas-wrap");
|
||||
if (wrap && !this._panning) wrap.style.cursor = "grab";
|
||||
}
|
||||
if (e.key === "Escape" && this._eyedropperActive) this._setEyedropperActive(false);
|
||||
const brushPicker = document.getElementById("wfm-abr-picker-overlay");
|
||||
if (e.key === "Escape") brushPicker?.remove();
|
||||
if (e.ctrlKey && e.key === "z") { e.preventDefault(); this._undo(); }
|
||||
if (e.ctrlKey && e.key === "y") { e.preventDefault(); this._redo(); }
|
||||
if (this._activeTool === "mask" && this._maskSubtool === "vector") {
|
||||
@@ -2465,10 +2569,20 @@ class ImageEditTab {
|
||||
}
|
||||
if (!e.ctrlKey && !e.target.closest("input, textarea, select")) {
|
||||
if (e.key === "v") this._setActiveTool("select");
|
||||
if (e.key === "b") this._setActiveTool("draw");
|
||||
if (e.key === "b") {
|
||||
if (this._activeTool === "draw") this._toggleDrawBrushPicker();
|
||||
else this._setActiveTool("draw");
|
||||
}
|
||||
if (e.key === "t") this._setActiveTool("text");
|
||||
if (e.key === "s") this._setActiveTool("shape");
|
||||
if (e.key === "g") this._setActiveTool("fill");
|
||||
if (this._activeTool === "draw" && !brushPicker && !e.altKey && !e.metaKey) {
|
||||
if (e.key === "d") this._setDrawMode("draw");
|
||||
if (e.key === "e") this._setDrawMode("erase");
|
||||
if (e.key === "x") this._drawPalette.toggleWell();
|
||||
if (e.key === "[") this._stepDrawBrushSize(-1);
|
||||
if (e.key === "]") this._stepDrawBrushSize(1);
|
||||
}
|
||||
// Delete/Backspaceで選択オブジェクト削除
|
||||
if ((e.key === "Delete" || e.key === "Backspace") && this._activeTool === "select") {
|
||||
const layer = this._selectTool?.getSelectedLayer();
|
||||
@@ -2929,7 +3043,7 @@ class ImageEditTab {
|
||||
return null;
|
||||
};
|
||||
|
||||
const currentColor = this._drawTool?.color ?? "#ff0000";
|
||||
const currentColor = this._drawTool?.color ?? "#000000";
|
||||
const hex = currentColor.replace("#", "");
|
||||
const cr = parseInt(hex.slice(0, 2), 16);
|
||||
const cg = parseInt(hex.slice(2, 4), 16);
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* Image Edit Tab - Draw Tool color palette
|
||||
* Drawツールの2段目(ie-tool-options)に並べるカラーパレット。
|
||||
* 色1/色2の切替、基本色、カスタム色の登録を担当する。
|
||||
* 基本色・カスタム色はユーザー設定として localStorage に保存する(作品データには含めない)。
|
||||
*/
|
||||
|
||||
import { t } from "../i18n.js";
|
||||
|
||||
const STORAGE_KEY = "ie_draw_palette_v1";
|
||||
const CUSTOM_SLOTS = 20;
|
||||
|
||||
const DEFAULT_BASE = [
|
||||
"#000000", "#7f7f7f", "#880015", "#ed1c24", "#ff7f27", "#fff200", "#22b14c", "#00a2e8", "#3f48cc", "#a349a4",
|
||||
"#ffffff", "#c3c3c3", "#b97a57", "#ffaec9", "#ffc90e", "#efe4b0", "#b5e61d", "#99d9ea", "#7092be", "#c8bfe7",
|
||||
];
|
||||
|
||||
function normalizeHex(value) {
|
||||
if (typeof value !== "string") return null;
|
||||
const hex = value.toLowerCase();
|
||||
return /^#[0-9a-f]{6}$/.test(hex) ? hex : null;
|
||||
}
|
||||
|
||||
function loadPalette() {
|
||||
let saved = null;
|
||||
try { saved = JSON.parse(localStorage.getItem(STORAGE_KEY)); } catch { /* 破損時は初期値 */ }
|
||||
return {
|
||||
base: DEFAULT_BASE.map((c, i) => normalizeHex(saved?.base?.[i]) ?? c),
|
||||
custom: Array.from({ length: CUSTOM_SLOTS }, (_, i) => normalizeHex(saved?.custom?.[i])),
|
||||
};
|
||||
}
|
||||
|
||||
export class DrawPalette {
|
||||
/**
|
||||
* @param {object} opts
|
||||
* @param {(hex: string) => void} opts.onColorChange ブラシ色を変更する
|
||||
* @param {(msg: string, type?: string) => void} opts.toast
|
||||
*/
|
||||
constructor({ onColorChange, toast }) {
|
||||
this._onColorChange = onColorChange;
|
||||
this._toast = toast;
|
||||
this._wells = ["#000000", "#ffffff"];
|
||||
this._activeWell = 0;
|
||||
Object.assign(this, loadPalette());
|
||||
this._content = null;
|
||||
this._picker = null;
|
||||
this._pickerTarget = null;
|
||||
this._menu = null;
|
||||
this._closeMenuOnOutside = e => { if (!this._menu?.contains(e.target)) this.closeMenu(); };
|
||||
this._closeMenuOnEscape = e => { if (e.key === "Escape") this.closeMenu(); };
|
||||
}
|
||||
|
||||
get currentColor() { return this._wells[this._activeWell]; }
|
||||
|
||||
/** ie-tool-options へパレットを描画する */
|
||||
render(container) {
|
||||
this.closeMenu();
|
||||
|
||||
const root = document.createElement("div");
|
||||
root.className = "ie-palette";
|
||||
this._content = document.createElement("div");
|
||||
this._content.className = "ie-palette-content";
|
||||
this._picker = document.createElement("input");
|
||||
this._picker.type = "color";
|
||||
this._picker.className = "ie-palette-picker";
|
||||
this._picker.tabIndex = -1;
|
||||
root.append(this._content, this._picker);
|
||||
container.appendChild(root);
|
||||
|
||||
root.addEventListener("click", e => this._onClick(e));
|
||||
root.addEventListener("contextmenu", e => this._onContextMenu(e));
|
||||
this._picker.addEventListener("input", () => this._onPickerInput());
|
||||
this._refresh();
|
||||
}
|
||||
|
||||
/** スポイト・カラー入力などパレット外で変わった色を反映する */
|
||||
syncColor(color) {
|
||||
const hex = normalizeHex(color);
|
||||
if (!hex) return;
|
||||
this._wells[this._activeWell] = hex;
|
||||
this._refresh();
|
||||
}
|
||||
|
||||
/** 色1/色2を切り替える */
|
||||
toggleWell() {
|
||||
this._selectWell(1 - this._activeWell);
|
||||
}
|
||||
|
||||
closeMenu() {
|
||||
if (!this._menu) return;
|
||||
this._menu.remove();
|
||||
this._menu = null;
|
||||
document.removeEventListener("pointerdown", this._closeMenuOnOutside, true);
|
||||
document.removeEventListener("keydown", this._closeMenuOnEscape, true);
|
||||
}
|
||||
|
||||
_refresh() {
|
||||
if (!this._content?.isConnected) return;
|
||||
const wells = this._wells.map((color, i) => {
|
||||
const label = t(i === 0 ? "imageEditPaletteColor1" : "imageEditPaletteColor2");
|
||||
return `<button type="button" class="ie-palette-well${i === this._activeWell ? " is-active" : ""}"
|
||||
data-well="${i}" style="--swatch:${color}" title="${label} (X): ${color}" aria-label="${label}"></button>`;
|
||||
}).join("");
|
||||
this._content.innerHTML = `
|
||||
<div class="ie-opt-group ie-palette-wells">${wells}</div>
|
||||
<div class="ie-opt-group">
|
||||
<label>${t("imageEditPaletteBase")}</label>
|
||||
<div class="ie-palette-grid">${this._swatches("base")}</div>
|
||||
</div>
|
||||
<div class="ie-opt-group">
|
||||
<label>${t("imageEditPaletteCustom")}</label>
|
||||
<div class="ie-palette-grid">${this._swatches("custom")}</div>
|
||||
<button type="button" class="wfm-btn wfm-btn-sm" data-palette-add
|
||||
title="${t("imageEditPaletteAddTitle")}">+</button>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
_swatches(kind) {
|
||||
return this[kind].map((color, i) => {
|
||||
const attrs = `data-kind="${kind}" data-index="${i}"`;
|
||||
if (!color) {
|
||||
const title = t("imageEditPaletteEmptyTitle");
|
||||
return `<button type="button" class="ie-palette-swatch is-empty" ${attrs} title="${title}" aria-label="${title}"></button>`;
|
||||
}
|
||||
const current = color === this.currentColor ? " is-current" : "";
|
||||
const title = `${color} — ${t("imageEditPaletteSwatchTitle")}`;
|
||||
return `<button type="button" class="ie-palette-swatch${current}" ${attrs}
|
||||
style="--swatch:${color}" title="${title}" aria-label="${color}"></button>`;
|
||||
}).join("");
|
||||
}
|
||||
|
||||
_onClick(e) {
|
||||
const well = e.target.closest("[data-well]");
|
||||
if (well) {
|
||||
this._selectWell(Number(well.dataset.well));
|
||||
return;
|
||||
}
|
||||
if (e.target.closest("[data-palette-add]")) {
|
||||
this._addCurrent();
|
||||
return;
|
||||
}
|
||||
const swatch = e.target.closest("[data-kind]");
|
||||
if (!swatch) return;
|
||||
const { kind, index } = swatch.dataset;
|
||||
const color = this[kind][index];
|
||||
if (color) this._applyColor(color);
|
||||
else this._setSlot(kind, index, this.currentColor);
|
||||
}
|
||||
|
||||
_onContextMenu(e) {
|
||||
const swatch = e.target.closest("[data-kind]");
|
||||
if (!swatch) return;
|
||||
e.preventDefault();
|
||||
this._openMenu(swatch, e.clientX, e.clientY);
|
||||
}
|
||||
|
||||
_selectWell(index) {
|
||||
this._activeWell = index;
|
||||
this._applyColor(this.currentColor);
|
||||
}
|
||||
|
||||
_applyColor(color) {
|
||||
this._wells[this._activeWell] = color;
|
||||
this._onColorChange(color);
|
||||
this._refresh();
|
||||
}
|
||||
|
||||
_addCurrent() {
|
||||
const color = this.currentColor;
|
||||
if (this.custom.includes(color)) {
|
||||
this._toast(t("imageEditPaletteExists"), "info");
|
||||
return;
|
||||
}
|
||||
const index = this.custom.indexOf(null);
|
||||
if (index < 0) {
|
||||
this._toast(t("imageEditPaletteFull"), "error");
|
||||
return;
|
||||
}
|
||||
this._setSlot("custom", index, color);
|
||||
}
|
||||
|
||||
_setSlot(kind, index, color) {
|
||||
this[kind][index] = color;
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify({ base: this.base, custom: this.custom }));
|
||||
} catch { /* 保存できなくてもこのセッション中は使える */ }
|
||||
this._refresh();
|
||||
}
|
||||
|
||||
_openMenu(swatch, x, y) {
|
||||
this.closeMenu();
|
||||
const { kind, index } = swatch.dataset;
|
||||
const color = this[kind][index];
|
||||
const items = [
|
||||
["imageEditPaletteRegisterCurrent", () => this._setSlot(kind, index, this.currentColor)],
|
||||
[color ? "imageEditPaletteEditColor" : "imageEditPalettePickColor", () => this._openPicker(kind, index, x, y)],
|
||||
];
|
||||
if (kind === "custom" && color) {
|
||||
items.push(["imageEditPaletteDelete", () => this._setSlot(kind, index, null)]);
|
||||
}
|
||||
if (kind === "base" && color !== DEFAULT_BASE[index]) {
|
||||
items.push(["imageEditPaletteResetBase", () => this._setSlot(kind, index, DEFAULT_BASE[index])]);
|
||||
}
|
||||
|
||||
const menu = document.createElement("div");
|
||||
menu.className = "ie-palette-menu";
|
||||
for (const [key, action] of items) {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.textContent = t(key);
|
||||
button.addEventListener("click", () => { this.closeMenu(); action(); });
|
||||
menu.appendChild(button);
|
||||
}
|
||||
this._content.closest("#wfm-tab-image-edit").appendChild(menu);
|
||||
menu.style.left = `${Math.min(x, window.innerWidth - menu.offsetWidth - 4)}px`;
|
||||
menu.style.top = `${Math.min(y, window.innerHeight - menu.offsetHeight - 4)}px`;
|
||||
this._menu = menu;
|
||||
document.addEventListener("pointerdown", this._closeMenuOnOutside, true);
|
||||
document.addEventListener("keydown", this._closeMenuOnEscape, true);
|
||||
}
|
||||
|
||||
_openPicker(kind, index, x, y) {
|
||||
this._pickerTarget = { kind, index };
|
||||
this._picker.value = this[kind][index] ?? this.currentColor;
|
||||
this._picker.style.left = `${x}px`;
|
||||
this._picker.style.top = `${y}px`;
|
||||
this._picker.click();
|
||||
}
|
||||
|
||||
_onPickerInput() {
|
||||
const { kind, index } = this._pickerTarget;
|
||||
this._setSlot(kind, index, this._picker.value);
|
||||
this._applyColor(this._picker.value);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export class DrawTool {
|
||||
this.brushSize = 20;
|
||||
this.hardness = 0.8; // 0.0 = very soft, 1.0 = hard edge
|
||||
this.opacity = 1.0;
|
||||
this.color = "#ff0000";
|
||||
this.color = "#000000";
|
||||
this.mode = "draw"; // "draw" | "erase"
|
||||
this.spacing = 0.25; // stamp interval as fraction of brushSize (image brush only)
|
||||
this.angle = 0; // degrees [0, 359]
|
||||
|
||||
@@ -12,6 +12,7 @@ import { escapeHtml } from "./util.js";
|
||||
import { comfyUI } from "./comfyui-client.js";
|
||||
import { comfyEditor } from "./comfyui-editor.js";
|
||||
import { semanticErrorMessage } from "./gallery-semantic.js";
|
||||
import { revealInGallery } from "./gallery-tab.js";
|
||||
|
||||
const API = {
|
||||
status: "/wfm/tagspace/status",
|
||||
@@ -203,7 +204,13 @@ function bindShell() {
|
||||
});
|
||||
$("wfm-ts-detail").addEventListener("click", (e) => {
|
||||
const id = e.target.closest("[data-ts-toggle]")?.dataset.tsToggle;
|
||||
if (id) return toggleChip(id);
|
||||
if (id) return toggleChip(id, pickedTags(state.items.get(id)));
|
||||
const reveal = e.target.closest("[data-ts-reveal]")?.dataset.tsReveal;
|
||||
if (reveal) {
|
||||
hideZoom();
|
||||
revealInGallery(reveal).then((ok) => { if (!ok) showToast(t("tsRevealFailed"), "error"); });
|
||||
return;
|
||||
}
|
||||
const tag = e.target.closest("[data-ts-pick]")?.dataset.tsPick;
|
||||
if (tag != null) {
|
||||
const set = state.picked.tags;
|
||||
@@ -860,11 +867,17 @@ function renderDetail() {
|
||||
: it.kind === "tag" ? `<div class="wfm-ts-muted">${escapeHtml(sourcesText(it))}</div>`
|
||||
: (it.tags?.length ? tagPicker(it) : `<div class="wfm-ts-detail-text">${escapeHtml(t("tsImageNoTags"))}</div>`) +
|
||||
`<div class="wfm-ts-muted wfm-ts-path">${escapeHtml(it.id)}</div>`;
|
||||
// タグを選んでいるときは「選択したタグを追加」(選んだタグだけ)、選んでいなければ全体を追加する
|
||||
const nPicked = pickedTags(it).length;
|
||||
const btnLabel = inChips ? t("tsRemove") : nPicked ? t("tsAddPicked", nPicked) : t("tsAdd");
|
||||
const btn = !canAdd(it) ? ""
|
||||
: `<button class="wfm-btn wfm-btn-sm ${inChips ? "" : "wfm-btn-primary"}" data-ts-toggle="${escapeHtml(it.id)}">${escapeHtml(t(inChips ? "tsRemove" : "tsAdd"))}</button>`;
|
||||
: `<button class="wfm-btn wfm-btn-sm ${inChips ? "" : "wfm-btn-primary"}" data-ts-toggle="${escapeHtml(it.id)}">${escapeHtml(btnLabel)}</button>`;
|
||||
// Gallery点は、ギャラリータブでその画像を表示するボタンも置く
|
||||
const reveal = it.kind === "image"
|
||||
? `<button class="wfm-btn wfm-btn-sm" data-ts-reveal="${escapeHtml(it.id)}">${escapeHtml(t("tsOpenInGallery"))}</button>` : "";
|
||||
// 追加/削除ボタンは見出し行に置く(本文が長くてもスクロールせずに押せる)
|
||||
box.innerHTML = `<div class="wfm-ts-detail-head"><span class="wfm-ts-detail-title"><b>${escapeHtml(itemTitle(it))}</b> ` +
|
||||
`<span class="wfm-ts-muted">${escapeHtml(t(`tsKind_${it.kind}`))}</span></span>${btn}</div>${thumb}${body}`;
|
||||
`<span class="wfm-ts-muted">${escapeHtml(t(`tsKind_${it.kind}`))}</span></span>${reveal}${btn}</div>${thumb}${body}`;
|
||||
}
|
||||
|
||||
/** カード・Gallery画像のプロンプトのタグ: クリックで選び、選んだタグで空間検索する */
|
||||
@@ -950,18 +963,33 @@ function canAdd(it) {
|
||||
return !!it && (it.kind !== "image" || it.tags?.length > 0);
|
||||
}
|
||||
|
||||
function chipText(it) {
|
||||
return it.kind === "card" ? it.prompt : it.kind === "image" ? it.tags.join(", ") : it.label;
|
||||
/** タグをプロンプトに入れる形にする。タグは分解時にエスケープを外しているので、
|
||||
* カッコを \( \) に戻す(そのままだと "rapunzel (disney)" の (disney) が強調指定になる) */
|
||||
function promptTag(tag) {
|
||||
return tag.replace(/[()]/g, "\\$&");
|
||||
}
|
||||
|
||||
function toggleChip(id) {
|
||||
function chipText(it) {
|
||||
return it.kind === "card" ? it.prompt : it.kind === "image" ? it.tags.map(promptTag).join(", ") : promptTag(it.label);
|
||||
}
|
||||
|
||||
/** 選択中パネルで選んだタグ(プロンプトの順)。その要素のものでなければ空 */
|
||||
function pickedTags(it) {
|
||||
if (!it || state.picked.id !== it.id || !it.tags?.length) return [];
|
||||
return it.tags.filter((tg) => state.picked.tags.has(tg));
|
||||
}
|
||||
|
||||
/** チップの追加/削除。tags を渡すと、全体ではなくそのタグだけを1つのチップとして追加する */
|
||||
function toggleChip(id, tags = []) {
|
||||
const i = state.chips.findIndex((c) => c.id === id);
|
||||
if (i >= 0) {
|
||||
state.chips.splice(i, 1);
|
||||
} else {
|
||||
const it = state.items.get(id);
|
||||
if (!canAdd(it)) return;
|
||||
state.chips.push({ id, kind: it.kind, label: itemTitle(it), text: chipText(it) });
|
||||
state.chips.push(tags.length
|
||||
? { id, kind: it.kind, label: t("tsChipPicked", itemTitle(it), tags.length), text: tags.map(promptTag).join(", ") }
|
||||
: { id, kind: it.kind, label: itemTitle(it), text: chipText(it) });
|
||||
}
|
||||
refreshChips();
|
||||
}
|
||||
|
||||
@@ -2022,7 +2022,7 @@
|
||||
<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 "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</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 "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)</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>
|
||||
@@ -2050,6 +2050,7 @@
|
||||
<ul>
|
||||
<li id="wfm-help-imageedit-4">Select (V): click to select a layer; drag to move; drag corner handles to resize; drag the circle above the top edge to rotate; double-click a text layer to re-edit its content; Tool Options bar shows Flip H / Flip V / Rotate field</li>
|
||||
<li id="wfm-help-imageedit-5">Draw (B): freehand brush drawing onto the active draw layer; Tool Options: color, brush size, blend mode; Properties pane includes a MASK EDITOR ONE (COLOR) section for ABR image brushes — always visible, header text is green when brushes are available, gray when none are imported yet; Select is disabled until at least one brush exists</li>
|
||||
<li id="wfm-help-imageedit-draw-palette">Draw color palette (second row): Color 1/Color 2, 20 basic colors, and 20 custom slots. Click a color to paint with it. Use + or click an empty slot to register the current color; right-click a color to register, edit, or delete it (basic colors can be changed and restored). Registered colors are saved per browser. The eyedropper button next to Color picks a color from the canvas (Esc cancels)</li>
|
||||
<li id="wfm-help-imageedit-6">Text (T): click on the canvas to place a text input overlay; configure font family, size, bold/italic, align, color in the Tool Options bar; click OK to place the text as an exact-size Text layer; double-click an existing text layer with the Select tool to re-edit</li>
|
||||
<li id="wfm-help-imageedit-7">Shape (S): draw geometric shapes onto the canvas; each committed shape becomes an independent draw layer; Tool Options: Shape type (Rect / Ellipse / Line / FreeLine), Rounded checkbox (Rect / Ellipse only), Fill color + None toggle (hidden for Line / FreeLine), Stroke color + width + None toggle (None hidden for Line / FreeLine where stroke is always active), Opacity slider, ↩ Undo button; drag to draw — a blue dashed outline previews the shape; release to commit</li>
|
||||
<li id="wfm-help-imageedit-7a2">Fill (G): bucket fill — click a contiguous same-color region on the active layer to flood-fill it with a solid color or a linear/radial gradient; Tool Options: Mode (Solid / Gradient), Color (solid) or Shape + Ramp (drag stops to reposition, click a stop then use the color swatch, +/- to add/remove) + Direction dial (drag to set angle/radius, gradient), Tolerance (color-match threshold), Opacity</li>
|
||||
@@ -2156,6 +2157,7 @@
|
||||
<li id="wfm-help-imageedit-24">T: Text tool</li>
|
||||
<li id="wfm-help-imageedit-25">S: Shape tool</li>
|
||||
<li id="wfm-help-imageedit-25b">G: Fill tool</li>
|
||||
<li id="wfm-help-imageedit-draw-kbd">While Draw is active: D Draw / E Erase / X switch Color 1/2 / [ ] brush size / B open or close the brush picker (Esc also closes it)</li>
|
||||
<li id="wfm-help-imageedit-26">Delete: Delete selected layer (requires 2+ layers)</li>
|
||||
<li id="wfm-help-imageedit-27">Ctrl+Z / Ctrl+Y: Undo / Redo</li>
|
||||
<li id="wfm-help-imageedit-28">Space + drag: Pan canvas</li>
|
||||
@@ -2208,6 +2210,7 @@
|
||||
<li id="wfm-help-imageedit-tabkbd-3">T: Text tool</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-4">S: Shape tool</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-4b">G: Fill tool</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-draw">While Draw is active: D Draw / E Erase / X switch Color 1/2 / [ ] brush size / B open or close the brush picker (Esc also closes it)</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-5">Delete: Delete selected layer (requires 2+ layers)</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-6">Ctrl+Z / Ctrl+Y: Undo / Redo</li>
|
||||
<li id="wfm-help-imageedit-tabkbd-7">Space + drag: Pan canvas</li>
|
||||
|
||||
Reference in New Issue
Block a user