Skip to content

12 个视觉参考图库与浏览器无限画布 AI 创作台(5,700+ 素材、中英提示词、多图对比、ComfyUI & MCP)· Visual reference library & infinite-canvas AI studio in the browser

feat: v1.5.0 infinite spatial canvas studio, compare studio, recipes & docs

atuizz4390edaed79f
diff --git a/AGENTS.md b/AGENTS.md
index 4f15212..15c5913 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -22,7 +22,10 @@
| `src/palette.js` | 灯箱主色调提取与色卡渲染(`window.PoseWearPalette`) |
| `src/sketch.js` | 全屏速写定时练习工作室(`window.PoseWearSketch`) |
| `src/command-palette.js` | 全局 `⌘K` 命令面板(`window.PoseWearCommandPalette`) |
-| `src/board-export.js` | 参考画板高分 PNG 拼贴导出(`window.PoseWearBoardExport`) |
+| `src/compare.js` | 2–4 图同屏参考对比工作室(`window.PoseWearCompare`,含同步镜像/参考线/三阶明度/剪影/线稿深度切换) |
+| `src/board-export.js` | 参考画板高分 PNG 拼贴导出与剪贴板直拷(`window.PoseWearBoardExport`) |
+| `src/recipes.js` | 工作台造型方案与角色档案管理(`window.PoseWearRecipes`,`localStorage['wbRecipes']`、保留姿势换角与 JSON 导入导出) |
+| `src/canvas.js` | 工作台无限空间画布引擎(`window.PoseWearCanvas`,平移缩放、自由拖拽/缩放参考卡、可注入提示词的导演便签、语义连线、输出节点与专注画布) |
| `src/references.js` | 浏览器与 MCP 共用选定视角、公开图片地址与复制文本的格式 |
| `src/i18n.js` | 中英日越土界面词条与语言切换,`pwUiLocale` 独立于提示词设置 |
| `src/studio.js` | 工作台选材、提示词、生成与结果;对外接口是 `window.WB` |
@@ -118,7 +121,7 @@ U=http://127.0.0.1:8902 npm test
- 图片缓存策略:图库图片路径(/p/ /c/ /a/ /r/ /e/ /y/ /s/ /l/ /t/ /f/ /o/)与 R2 对象一律 `max-age=31536000, immutable`(图片按 ID 寻址、内容不变);只有 HTML 与 sw.js 走 revalidate/no-cache。勿把图片改回 must-revalidate。
- 公告、应用更新和最近操作由 `#noticeMenu` 集中展示。素材来源与许可位于页脚 `#credits`。
- `copyRefs` 默认开启。卡片、灯箱、悬浮及完整工作台复用同一参考图格式。保留选定的 `angles` 视角和原站热链,本地上传图在复制文本中提示用户另附。
-- localStorage 键:`wbCfg`、`wbSel`(试穿台选材)、`sel`(组合)、`fav`、`theme`、`lang` 等,改名即丢用户数据,慎改。
+- localStorage 键:`wbCfg`、`wbSel`(试穿台选材)、`wbRecipes`(工作台造型方案)、`wbShot`、`sel`(组合)、`fav`、`theme`、`lang` 等,改名即丢用户数据,慎改。
## 约定
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8452710..8a130ee 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,16 @@
## 简体中文
+### 2026-11-28 · v1.5.0
+
+- **无限空间画布工作台(Infinite Spatial Canvas Studio)**:将中心参考画板全面升级为支持滚轮居中缩放(`35%–240%`)与自由平移的无限空间画布,动态点阵背景随视角跟随;支持自由拖拽排布与右下角缩放参考卡、卡片悬浮操作条(替换 / 切视角 / 画布镜像 / 移除)、**可注入提示词的导演便签**(支持双击空白处添加并一键切换 `↳ 提示词` 实时注入)、自动连接的**语义贝塞尔连线**、随画幅实时变化的**输出预览节点与成品回钉迭代**,以及一键整理(Tidy)、适配视野(`0`)与全屏专注画布(Zen Focus)模式;560px 以下移动端自动切换零溢出紧凑流式排版。
+- **2–4 图同屏参考对比工作室(Compare Studio)**:新增 `src/compare.js`,支持从批量栏、悬浮创作台或 `⌘K` 一键同屏对比 2–4 项参考,提供同步镜像(`H`)、构图参考线(`G`)、灰度 / 三阶明度块面(`B`)、剪影轮廓(`U`)与线稿↔深度图切换(`V`),并支持单卡原地切视角、收藏、复制与跳转大图。
+- **绘画专业视觉检视升级**:新增纯 SVG `<filter>` 实现的**三阶明度块面(Notan)**与**剪影轮廓检查(`U`)**,零 Canvas CORS 污染、严格 CSP 兼容并支持深度图专属反色剪影;覆盖灯箱、速写练习与同屏对比三大场景。
+- **造型方案与角色档案(Studio Recipes)**:新增 `src/recipes.js`(持久化于 `localStorage['wbRecipes']`,上限 60 条),支持保存常用人物/服饰/场景/画风/镜头/避坑词搭配、缩略图预览、**「保留当前姿势」只换角色与服饰**、删除撤销及 JSON 备份导入导出。
+- **创作力与多生态导出扩展**:工作台画风扩充至 **12 种**(新增杂志画报、游戏原画、角色三视图、黑白漫画、3D 手办、霓虹夜色),新增 **9 档镜头景别/焦段**、**负向避坑词(含一键填入常用)**、**参考拼图直拷剪贴板(Copy PNG)**,以及一键导出 **Midjourney / SD·NovelAI 标签 / 结构化 JSON** 提示词格式。
+- **2026 前沿生图模型、自定义中转预设 & ComfyUI 多图模板**:更新 OpenAI(`gpt-image-2.5`)、Gemini(`gemini-nano-banana-2.1` / `3.1`)、豆包 Seedream `5.5 / 5.0` 模型列表,新增 5 组自定义中转快捷预设(xAI Grok / FLUX.2 / Qwen-Image / Gemini 中转 / 本机网关);本机引擎适配 `inputs.prompt` 节点字段,随仓附带 `depth-controlnet-api.json` 与 `multi-ref-qwen-edit-api.json`(人物+服饰+姿势三图 Qwen-Image-Edit)工作流模板。
+- **土耳其语(Türkçe)界面与文档 & Windows 兼容**:合并社区贡献的土耳其语全站界面与 `README.tr.md`(感谢 [@Burakceliks](https://github.com/Burakceliks) #32),补全全部新增功能的中/英/日/越/土五语词条与端到端回归测试(14 项离线套件全绿),并修复 Windows 离线测试兼容(#33)。
+
### 2026-11-25 · v1.4.0
- **画师级大图检视台**:新增 2× 缩放拖拽(`Z` / 双击)、水平镜像(`H`)、三分与中心红轴构图参考线(`G`)、灰度明度检查(`B`)、彩色参考图中心加权 5 色自动取色板(点击复制 `#HEX`)及线稿 × 深度图同视角实时卷帘对比(`V`)。
@@ -77,6 +87,16 @@
## English
+### 2026-11-28 · v1.5.0
+
+- **Infinite Spatial Canvas Studio**: upgraded the center reference board into a true pan-and-zoom infinite canvas (`35%–240%`, cursor-centered wheel zoom, dynamic dot-matrix parallax) with draggable/resizable reference cards, quick hover actions (replace / angle / canvas mirror / remove), **prompt-linked art-direction sticky notes** (double-click empty space to drop, live `↳ Prompt` injection), **semantic Bézier flow wires**, a live aspect-ratio **Output Preview Hub** with pinned result iterations, Auto-Arrange (Tidy), Fit to View (`0`), and **Zen Focus Canvas** mode — with automatic overflow-free compact flow below `560px`.
+- **Side-by-Side Reference Compare Studio (2–4 items)**: added `src/compare.js` accessible from the batch bar, floating workspace dock, and `⌘K` palette, featuring synced horizontal flip (`H`), composition grids (`G`), grayscale / 3-tone Notan (`B`), silhouette (`U`), line-art ↔ depth toggle (`V`), plus per-card inline angle switching and quick actions.
+- **3-Tone Notan & Silhouette Inspection**: added pure inline SVG `<filter>` pipelines for 3-tone Notan value blocks (`B` cycle) and Silhouette contour checks (`U`, with dedicated depth-map silhouette support) across Lightbox, Gesture Studio, and Compare Studio — zero CORS taint, strict-CSP safe.
+- **Named Studio Recipes & Character Profiles**: added `src/recipes.js` (`localStorage['wbRecipes']`, up to 60 recipes) with thumbnail collages, full reload, **Keep Current Pose** character/outfit swap, delete with Undo, and JSON export/import backup.
+- **Expanded Creative Controls & Multi-Ecosystem Prompt Export**: expanded to **12 art styles** (adding Magazine, Concept Art, Character Turnaround Sheet, Manga Ink, 3D Figurine, Neon Night), added **9 camera framing/lens presets**, **negative prompts with one-click defaults**, **Copy Board PNG directly to clipboard**, and formatted prompt export for **Midjourney (`--no` / `--ar`)**, **SD / NovelAI tags**, and **Structured JSON**.
+- **2026 Frontier Models, Custom Relay Presets & ComfyUI Multi-Ref Templates**: updated OpenAI (`gpt-image-2.5`), Gemini (`gemini-nano-banana-2.1` / `3.1`), and Seedream `5.5 / 5.0` model lists; added 5 one-click custom relay presets (xAI Grok, FLUX.2, Qwen-Image, Gemini Relay, Local Gateway); extended `scripts/local-engine.mjs` to support `inputs.prompt` nodes and bundled `depth-controlnet-api.json` and 3-reference `multi-ref-qwen-edit-api.json` ComfyUI templates.
+- **Turkish Locale (`Türkçe`) & Windows Compatibility**: includes Turkish UI & `README.tr.md` (contributed by [@Burakceliks](https://github.com/Burakceliks) in #32), full 5-language (`zh/en/ja/vi/tr`) parity for all new features, Windows offline test fixes (#33), and 14/14 passing offline regression suites.
+
### 2026-11-25 · v1.4.0
- **Artist Lightbox Studio**: added 2× zoom & drag-to-pan (`Z` / double-click), horizontal mirror (`H`), rule-of-thirds and center-axis composition grids (`G`), grayscale luminance study (`B`), center-weighted 5-swatch auto color palette (click to copy `#HEX`), and live same-angle line-art × depth split compare (`V`).
@@ -147,6 +167,16 @@
## 日本語
+### 2026-11-28 · v1.5.0
+
+- **無限空間キャンバススタジオ(Infinite Spatial Canvas)**:中央リファレンスボードをパン&カーソル中心ズーム(`35%–240%`)対応の無限キャンバスへ刷新。カードの自由ドラッグ&リサイズ、ホバー操作バー(差替/アングル/反転/削除)、**プロンプト連動アートディレクション付箋**(空白ダブルクリックで追加・`↳ プロンプト` リアルタイム注入)、**セマンティック・ベジェ配線**、比率連動の**出力プレビューノード&生成結果ピン留め**、自動整列(整列)、全体表示(`0`)、集中フルキャンバス(集中)を搭載。560px 未満のスマホでは自動でコンパクト配置へ切替。
+- **最大 4 枚同画面リファレンス比較スタジオ**:`src/compare.js` を追加。一括選択バー・創作パネル・`⌘K` から起動でき、左右反転(`H`)・構図ガイド(`G`)・グレースケール/3 階調明度(`B`)・シルエット(`U`)・線画↔深度切替(`V`)を一括同期、カード個別のアングル切替にも対応。
+- **3 階調ノータン明度&シルエット輪郭チェック**:純 SVG `<filter>` による 3 階調明度ブロック(`B` 循環)とシルエット確認(`U`、深度画像専用モード付き)をプレビュー・クロッキー・同画面比較へ導入(CORS 制限なし・厳格 CSP 準拠)。
+- **スタイルレシピ&キャラ設定保存**:`src/recipes.js`(`localStorage['wbRecipes']`・最大 60 件)を追加。サムネイル一覧、全復元、**現在のポーズを保ったままキャラと衣装だけ差し替え**、削除の元に戻す、JSON バックアップ書出/読込に対応。
+- **12 画風・9 カメラプリセット・ネガティブプロンプト・多形式コピー&PNG 直接コピー**:画風を 12 種(雑誌グラビア・ゲーム原画・三面図・モノクロ漫画・3D フィギュア・ネオン夜景を追加)へ拡充し、カメラ画角、定番ネガティブプロンプト入力、**ボード PNG のクリップボード直接コピー**、**Midjourney/SD・NovelAI タグ/構造化 JSON** 形式エクスポートに対応。
+- **2026 最新モデル・中継プリセット&ComfyUI 複数参照テンプレート**:OpenAI `gpt-image-2.5`、Gemini `gemini-nano-banana-2.1`、Seedream `5.5 / 5.0` 候補を更新し、5 種のカスタム中継プリセットを追加。ローカルエンジンが `inputs.prompt` に対応し、`depth-controlnet-api.json` と 3 枚参照 `multi-ref-qwen-edit-api.json` テンプレートを同梱。
+- **トルコ語(Türkçe)UI&Windows テスト互換**:[@Burakceliks](https://github.com/Burakceliks) 貢献のトルコ語 UI/`README.tr.md`(#32)と Windows 互換修正(#33)を収録し、全機能を 5 言語完全同期・14 スイートのオフライン回帰テスト全合格を確認。
+
### 2026-11-25 · v1.4.0
- **作画向けプレビュービューア**:2× 拡大&ドラッグ移動(`Z`/ダブルクリック)、左右反転(`H`)、三分割・中央赤軸構図ガイド(`G`)、グレースケール明度確認(`B`)、カラー写真からの中央重視 5 色自動パレット抽出(クリックで `#HEX` コピー)、同アングル線画 × 深度マップのリアルタイム重ね比較(`V`)を追加。
diff --git a/README.en.md b/README.en.md
index f15793e..b980315 100644
--- a/README.en.md
+++ b/README.en.md
@@ -33,28 +33,42 @@
## Highlights
-### Artist Lightbox Studio · Live Line-Art × Depth Split Compare
+### Infinite Spatial Canvas Studio · Semantic Wires, Sticky Notes & Try-On
<p align="center">
- <img src="docs/lightbox-en.jpg" alt="Artist lightbox inspection studio with live line-art and depth split compare and composition grid" width="900">
+ <img src="docs/studio-en.jpg" alt="Infinite Spatial Canvas Studio with draggable reference cards, prompt-linked sticky notes, semantic wires, and output preview hub" width="900">
</p>
-Every pose comes paired with a **line sketch** and a **matching depth map** from the exact same camera angle. Flip any card in place from its badge, or open the lightbox to inspect with built-in artist tools:
+The static reference board is now a **true pan-and-zoom Infinite Spatial Canvas** — fusing a PureRef-style visual moodboard with a live multi-reference AI studio:
-- **`Z` / Double-click**: 2× zoom with drag-to-pan for folds, hands, and perspective details
-- **`H` Mirror**: instant horizontal flip to check balance and anatomical proportions
-- **`G` Composition Grid**: cycle between rule-of-thirds and center-axis / quarter proportion guides
-- **`B` Grayscale Value Study & Auto Color Palette**: toggle luminance grayscale for tonal study and extract up to 5 real `#HEX` swatches from color photos (one click to copy)
-- **`V` Split Compare**: drag a live curtain between line art and depth map from the same angle
+- **Smooth Pan & Cursor-Centered Zoom**: wheel zoom (`35%–240%`), drag-to-pan, one-key Fit to View (`0`), Auto-Arrange (`Tidy`), and full-bleed **Zen Focus Canvas** mode
+- **Draggable & Resizable Spatial Cards**: every card shows its send index (`1 / 2 / 3`) and angle, drags smoothly on an 8px snap grid, resizes from its corner handle, and offers a quick hover bar (replace / cycle angle / canvas mirror / remove)
+- **Prompt-Linked Art-Direction Sticky Notes**: double-click empty canvas or click `+ Note` to jot lighting, framing, or mood notes — toggle `↳ Prompt` to inject them live into the AI prompt with an automatic flow connector
+- **Semantic Bézier Wires & Live Output Hub**: subtle curved wires connect all references and linked notes into an aspect-ratio-accurate **Output Frame**; finished renders pin directly onto the canvas for side-by-side iteration and one-click **Use as original**
+- **Studio Recipes & Multi-Ecosystem Export**: save reusable character/outfit/scene sets as named **Recipes** (with **Keep pose** character swaps & JSON backup); choose from **12 art styles**, **9 camera shots**, **negative prompts**, **Copy PNG to clipboard**, and one-click **Midjourney / SD·NovelAI / Structured JSON** prompt export
---
-### Creative Studio · Numbered Reference Board & Try-On
+### Side-by-Side Reference Compare (2–4 Items) · 3-Tone Notan & Silhouette
<p align="center">
- <img src="docs/studio-en.jpg" alt="Creative studio with numbered reference board cards and camera angle badges" width="900">
+ <img src="docs/compare-en.jpg" alt="Side-by-side 4-item reference compare studio with synced composition grid, mirror, Notan, silhouette, and inline angles" width="900">
</p>
+<p align="center">
+ <img src="docs/lightbox-en.jpg" alt="Artist lightbox inspection studio with live line-art and depth split compare and composition grid" width="900">
+</p>
+
+Every pose comes paired with a **line sketch** and a **matching depth map** from the exact same camera angle. Flip any card in place, compare **2–4 references side by side** (from batch mode, floating dock, or `⌘K`), or inspect in the lightbox:
+
+- **`Z` / Double-click**: 2× zoom with drag-to-pan for folds, hands, and perspective details
+- **`H` Mirror & `G` Composition Grid**: check symmetry and proportions across rule-of-thirds and center-axis guides (synced across all cards in Compare Studio)
+- **`B` Grayscale / 3-Tone Notan & Auto Color Palette**: cycle through Grayscale → 3-tone Notan value blocks → Off, plus auto-extracted 5-swatch real `#HEX` palettes (one click to copy)
+- **`U` Silhouette Check**: pure inline SVG filter checks silhouette readability (works on hotlinked images with zero CORS issues, auto-inverted for depth maps)
+- **`V` Split Compare**: drag a live curtain between line art and depth map from the same angle
+
+---
+
<table>
<tr>
<td width="33.3%" valign="top">
@@ -65,35 +79,35 @@ Every pose comes paired with a **line sketch** and a **matching depth map** from
<td width="33.3%" valign="top">
<img src="docs/dark-en.jpg" alt="Dark mode gallery and floating workspace dock"><br>
<b>Dark Canvas & Floating Workspace</b><br>
- <sub>Collect references without leaving the gallery, edit prompts in the dock, and generate on the spot.</sub>
+ <sub>Collect references without leaving the gallery, compare side by side, edit prompts, and generate on the spot.</sub>
</td>
<td width="33.3%" valign="top">
<img src="docs/mobile-en.jpg" alt="Mobile touch browsing and card flip"><br>
<b>Built for Touch & Mobile</b><br>
- <sub>Flip poses, switch angles, assemble sets, and review history comfortably on a phone.</sub>
+ <sub>Flip poses, switch angles, assemble sets, and use the overflow-free compact studio cleanly down to 320px.</sub>
</td>
</tr>
</table>
<table>
<tr>
- <td width="50%" valign="top">
- <b>Numbered Board & One-Click Moodboard PNG Export</b><br>
- Each card displays its send index (<code>1 / 2 / 3</code>) and camera angle matching <code>image 1 / 2 / 3</code> in the prompt. Shuffle looks, clear with Undo, and <b>export a high-resolution reference sheet PNG</b> ready for Midjourney, Kling, PureRef, or sharing.
- </td>
<td width="50%" valign="top">
<b>Fullscreen Gesture Drawing Studio</b><br>
- Launch a distraction-free timed practice session from your current filtered gallery—with <code>30s / 60s / 2m / 5m</code> timers, <code>5 / 10 / 20 / Endless</code> decks, optional chime, mirror / grid / grayscale / depth-flip tools, and a clickable session recap sheet.
+ Launch a distraction-free timed practice session from your current filtered gallery—with <code>30s / 60s / 2m / 5m</code> timers, <code>5 / 10 / 20 / Endless</code> decks, optional chime, mirror / grid / 3-tone Notan / silhouette / depth-flip tools, and a clickable session recap sheet.
</td>
- </tr>
- <tr>
<td width="50%" valign="top">
<b>Local History with Reference Traceability</b><br>
Generated outputs stay in your browser’s IndexedDB with mode filters (Try-on / Generate), prompt/model search, clickable thumbnails of the exact references used inside the lightbox, single downloads, and batch ZIP export.
</td>
+ </tr>
+ <tr>
<td width="50%" valign="top">
<b>Global Command Palette (⌘K) & Fast Picker</b><br>
- Press <code>⌘K</code> / <code>Ctrl+K</code> anywhere to jump across all 12 libraries, search, launch Gesture Practice, or toggle themes & languages; the studio picker adds category chips, Favorites-only filtering, and drag-and-drop uploads.
+ Press <code>⌘K</code> / <code>Ctrl+K</code> anywhere to jump across all 12 libraries, infinite canvas tools, Recipes, Compare Studio, Gesture Practice, or themes & languages; the picker adds category chips, Favorites-only filtering, and drag-and-drop uploads.
+ </td>
+ <td width="50%" valign="top">
+ <b>5-Language UI & Zero-Account Privacy</b><br>
+ Native UI switching across Simplified Chinese, English, Japanese, Vietnamese, and Turkish (independent from prompt language); favorites, recipes, canvas layout, and API keys stay strictly in your browser.
</td>
</tr>
</table>
@@ -104,7 +118,7 @@ Every pose comes paired with a **line sketch** and a **matching depth map** from
| Group | Libraries | Items | Highlights |
| :--- | :--- | :---: | :--- |
-| **Movement** | Poses · Depth poses | `288` × 2 | Paired line sketches and depth maps, multiple angles, in-place card flip & lightbox split compare |
+| **Movement** | Poses · Depth poses | `288` × 2 | Paired line sketches and depth maps, multiple angles, in-place card flip, side-by-side compare & split curtain |
| **People** | Portraits · Expressions · Hairstyles | `1,499` / `95` / `122` | CC0 fictional portraits, ICT-FaceKit expression intensity filters, multi-color hairstyle variants |
| **Wardrobe** | Outfits · Anime outfits · Historical dress | `1,407` / `1,760` / `57` | Visual color swatches & garment filters spanning contemporary, anime, and period outfits |
| **Setting** | Scenes · Lighting · Props · Furniture | `64` / `50` / `32` / `41` | Multi-angle environments, lighting setups, props, and furniture for full scene composition |
@@ -115,8 +129,8 @@ Every pose comes paired with a **line sketch** and a **matching depth map** from
| Mode | Best For | How It Works |
| :--- | :--- | :--- |
-| **Cloud API Key** | Fastest setup & top multi-image models | Connect OpenAI, Gemini, Seedream, or any OpenAI / Gemini / xAI-compatible relay. Send directly from your browser or via the site proxy (`http`/`https` and any port supported for custom relays). |
-| **Local Engine** | Full privacy & zero API cost | Connect **ComfyUI** or **stable-diffusion.cpp** (`sd-server`) running on your own machine—images never leave your device. Supports built-in single-ref and custom multi-ref ComfyUI API workflows. [Setup guide →](docs/local-engines.md) |
+| **Cloud API Key** | Fastest setup & 2026 multi-image models | Connect OpenAI (`gpt-image-2.5` / `1`), Gemini (`gemini-nano-banana-2.1` / `3.1`), Seedream `5.5 / 5.0`, or **5 one-click custom relay presets** (xAI Grok, FLUX.2, Qwen-Image, Gemini Relay, Local Gateway). Send directly or via the site proxy (`http`/`https`, any port). |
+| **Local Engine** | Full privacy & zero API cost | Connect **ComfyUI** or **stable-diffusion.cpp** (`sd-server`) running on your own machine—images never leave your device. Ships with img2img, **ControlNet Depth**, and **3-ref Qwen-Image-Edit** ComfyUI templates. [Setup guide →](docs/local-engines.md) |
| **AI Agent (MCP)** | Automated reference hunting in Codex / Claude | Ships a read-only stdio MCP server and reference-picking skill so your agent can search all 12 libraries, pick exact angles, and assemble briefs with image links. [MCP guide →](mcp/README.md) |
```sh
@@ -142,7 +156,7 @@ npm start
Open `http://127.0.0.1:8787/`. Browsing, favorites, and copying require no account or API key; catalogs load from the public site on first open and images load on demand.
- **No accounts**: zero sign-ups, zero server-side tracking
-- **Browser-local state**: favorites, settings, and API keys stay in `localStorage`; history stays in IndexedDB
+- **Browser-local state**: favorites, recipes, canvas layout, settings, and API keys stay in `localStorage`; history stays in IndexedDB
- **Clean removal**: clearing site data removes all local data immediately
<details>
@@ -150,17 +164,17 @@ Open `http://127.0.0.1:8787/`. Browsing, favorites, and copying require no accou
| Key | Action |
| :---: | :--- |
-| `⌘K` / `Ctrl+K` | Open global Command Palette (libraries, search, Gesture Studio, settings) |
+| `⌘K` / `Ctrl+K` | Open global Command Palette (libraries, search, Infinite Canvas, Recipes, Compare, Gesture Studio) |
| `/` | Focus search |
| `R` | Pick a random reference |
| `T` | Toggle light / dark theme (works in gallery & lightbox) |
| `L` | Switch reference description language (ZH / EN) |
| `1` – `9` | Jump across libraries |
| `←` `→` / `↑` `↓` | Lightbox: previous / next item, switch camera angle |
-| `Z` / `H` / `G` / `B` / `V` | Lightbox: 2× zoom / mirror / composition grid / grayscale value check / split depth compare |
-| `Space` | Gesture Studio: pause / resume timer |
+| `Z` / `H` / `G` / `B` / `U` / `V` | Lightbox / Compare: 2× zoom / mirror / grid / grayscale & 3-tone Notan / silhouette / depth compare |
+| `0` / `Space` + drag | Infinite Canvas: fit to view / pan canvas (`Space` pauses/resumes Gesture Studio) |
| `F` / `A` / `C` / `S` | Lightbox: favorite / add to set / copy prompt / share link |
-| `Esc` | Close lightbox, Gesture Studio, Command Palette, or dialog |
+| `Esc` | Close lightbox, Compare, Recipes, Gesture Studio, Command Palette, or exit Zen Focus |
</details>
@@ -171,14 +185,14 @@ Open `http://127.0.0.1:8787/`. Browsing, favorites, and copying require no accou
Pure static architecture: **vanilla JS + Python build + Cloudflare Pages** (no framework, no bundler). See [AGENTS.md](AGENTS.md) for asset setup, build steps, and deployment checks.
```sh
-# Offline regression suite (works cleanly from source with no asset archive)
+# Offline regression suite (14 suites — works cleanly from source with no asset archive)
npm run test:offline
# Full site regression suite (against local preview or staging build)
npm test
```
-Current release **v1.4.0** (2026-11-25) · [Full changelog](CHANGELOG.md)
+Current release **v1.5.0** (2026-11-28) · [Full changelog](CHANGELOG.md)
---
diff --git a/README.ja.md b/README.ja.md
index 43ccc7e..ae56d0d 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -33,28 +33,42 @@
## 主な特徴
-### 作画向けプレビュービューア · 線画 × 深度マップのリアルタイム重ね比較
+### 無限空間キャンバススタジオ · セマンティック配線、プロンプト連動付箋&試着
<p align="center">
- <img src="docs/lightbox-ja.jpg" alt="線画と深度マップの重ね比較と構図ガイドを備えたプレビュー画面" width="900">
+ <img src="docs/studio-ja.jpg" alt="無限空間キャンバススタジオ:自由配置カード、プロンプト連動付箋、セマンティック配線、出力プレビューノード" width="900">
</p>
-すべてのポーズに同じ動き・同じアングルの**線画**と**深度マップ**が対で用意されています。カードの番号からその場で裏返せるほか、拡大プレビュー下部のフロートツールバーで作画チェックに役立つ機能が使えます:
+従来の固定ボードを、**自由にパン・ズームできる無限空間キャンバス**へ進化させました。PureRef 風のムードボードと、複数参照 AI 生成スタジオを 1 つに融合しています:
-- **`Z` / ダブルクリック**:2× 拡大&ドラッグ移動でしわ・手先・パースの細部を確認
-- **`H` 左右反転**:ワンキーで水平反転し、重心やプロポーションのバランスを検証
-- **`G` 構図ガイド**:三分割グリッドと中央赤軸+四分割ラインを切り替え
-- **`B` グレースケール明度確認&自動カラーパレット**:ワンキーで白黒明度をチェック。カラー写真からは主要 5 色の `#HEX` を自動抽出し、クリックで即コピー
-- **`V` 重ね比較**:同アングルの線画と深度マップをスライダーでリアルタイム比較
+- **無限パン&カーソル中心ズーム**:ホイールで滑らかに拡縮(`35%–240%`)、空白ドラッグで移動、`0` キーで全体表示、「整列」で自動レイアウト、さらに全画面の「集中」キャンバスモードにも対応
+- **自由配置&リサイズ可能な参考カード**:送信番号(`1 / 2 / 3`)とアングルを表示し、自由ドラッグ・右下コーナーからのサイズ変更・ホバー操作バー(差替/アングル切替/反転プレビュー/削除)に対応
+- **プロンプト連動アートディレクション付箋**:空白ダブルクリックや「+ 付箋」から光・構図・雰囲気メモを追加。`↳ プロンプト` をオンにすると生成プロンプトへリアルタイム反映され自動で配線
+- **セマンティック配線 × 出力プレビューノード**:すべての参考カードと付箋が、縦横比に連動する「出力プレビュー」へ滑らかなベジェ曲線で接続。生成結果はキャンバスへピン留めされ、そのまま比較・反復やワンクリック「元画像として使う」が可能
+- **スタイルレシピ × 多形式エクスポート**:お気に入りの組合せを名前付き「レシピ」として保存し、**ポーズを保ったままキャラと衣装だけ差し替え**可能(JSON バックアップ対応)。**12 画風**、**9 カメラ画角**、**ネガティブプロンプト**、**ボード PNG クリップボード直接コピー**、**Midjourney/SD・NovelAI/JSON** 書き出しを搭載
---
-### 創作スタジオ · 送信番号付きリファレンスボード&バーチャル試着
+### 最大 4 枚同画面リファレンス比較 · 3 階調ノータン明度&シルエット確認
<p align="center">
- <img src="docs/studio-ja.jpg" alt="送信番号とアングルバッジ付きのリファレンスボードを備えた創作スタジオ" width="900">
+ <img src="docs/compare-ja.jpg" alt="最大4枚同画面比較スタジオ:構図ガイド・左右反転・3階調明度・シルエット・個別アングル切替" width="900">
</p>
+<p align="center">
+ <img src="docs/lightbox-ja.jpg" alt="線画と深度マップの重ね比較と構図ガイドを備えたプレビュー画面" width="900">
+</p>
+
+すべてのポーズに同じ動き・同じアングルの**線画**と**深度マップ**が対で用意されています。カードのその場裏返し、**最大 4 枚の同画面比較**(一括選択バー・創作パネル・`⌘K` から起動)、拡大プレビューに対応:
+
+- **`Z` / ダブルクリック**:2× 拡大&ドラッグ移動でしわ・手先・パースの細部を確認
+- **`H` 左右反転 & `G` 構図ガイド**:重心バランスと三分割/中央赤軸ガイドを確認(同画面比較では全カード一括同期)
+- **`B` グレースケール/3 階調明度(ノータン)&自動カラーパレット**:グレースケール → 3 階調明度ブロック → オフを切替。カラー写真からは主要 5 色の `#HEX` を自動抽出しクリックで即コピー
+- **`U` シルエット輪郭確認**:純 SVG フィルタでシルエットの明快さを即時チェック(外部リンク画像でも CORS 制限なし、深度画像専用反転対応)
+- **`V` 重ね比較**:同アングルの線画と深度マップをスライダーでリアルタイム比較
+
+---
+
<table>
<tr>
<td width="33.3%" valign="top">
@@ -65,35 +79,35 @@
<td width="33.3%" valign="top">
<img src="docs/dark-ja.jpg" alt="ダークモードとフローティング創作パネル"><br>
<b>ダークキャンバス × 創作パネル</b><br>
- <sub>閲覧を止めずに素材を集め、下部パネルからプロンプト調整と生成までそのまま完結。</sub>
+ <sub>閲覧を止めずに素材を集め、同画面比較・プロンプト調整・生成までそのまま完結。</sub>
</td>
<td width="33.3%" valign="top">
<img src="docs/mobile-ja.jpg" alt="スマートフォンでの閲覧と裏返し操作"><br>
<b>モバイル・タッチ操作対応</b><br>
- <sub>スマホでもカード反転、アングル切替、素材選択、履歴確認が快適に行えます。</sub>
+ <sub>320px 幅のスマホでもカード反転、アングル切替、コンパクト配置スタジオが快適に動作。</sub>
</td>
</tr>
</table>
<table>
<tr>
- <td width="50%" valign="top">
- <b>番号付きボード&リファレンス PNG 書き出し</b><br>
- ボード上の各カードに送信番号(<code>1 / 2 / 3</code>)とアングルを表示し、プロンプト内の <code>image 1 / 2 / 3</code> と対応づけ。シャッフルや一括クリア(元に戻す)に加え、<b>高解像度ムードボード PNG の書き出し</b>にも対応しています。
- </td>
<td width="50%" valign="top">
<b>全画面クロッキー練習(タイマー自動切替)</b><br>
- 絞り込み中の素材集からそのまま集中練習へ。<code>30s / 60s / 2m / 5m</code> タイマー、<code>5 / 10 / 20 / 無制限</code> 枚数、チャイム音、左右反転・ガイド・明度・深度切替、終了後の振り返り一覧まで完結。
+ 絞り込み中の素材集からそのまま集中練習へ。<code>30s / 60s / 2m / 5m</code> タイマー、<code>5 / 10 / 20 / 無制限</code> 枚数、チャイム音、反転・ガイド・3 階調明度・シルエット・深度切替、終了後の振り返り一覧まで完結。
</td>
- </tr>
- <tr>
<td width="50%" valign="top">
<b>参照元を辿れるローカル生成履歴</b><br>
生成画像はブラウザ内 IndexedDB に保存。モード別(試着/生成)絞り込み、プロンプト・モデル名検索、プレビュー内での使用済み参考画像サムネイル表示、単体保存・ZIP 一括書き出しに対応。
</td>
+ </tr>
+ <tr>
<td width="50%" valign="top">
<b>コマンドパレット(⌘K)&高速ピッカー</b><br>
- どこからでも <code>⌘K</code> / <code>Ctrl+K</code> で 12 素材集の移動・検索・クロッキー開始・外観切替を即時実行。素材選択モーダルはカテゴリ絞り込み、「お気に入りのみ」、ドラッグアップロードに対応。
+ どこからでも <code>⌘K</code> / <code>Ctrl+K</code> で 12 素材集・無限キャンバス操作・レシピ・同画面比較・クロッキー開始・外観切替を即時実行。ピッカーはカテゴリ絞り込み、「お気に入りのみ」、ドラッグアップロードに対応。
+ </td>
+ <td width="50%" valign="top">
+ <b>5 言語 UI × アカウント不要の完全ローカル</b><br>
+ 簡体字中国語・English・日本語・Tiếng Việt・Türkçe の 5 言語を切替可能(プロンプト言語とは独立)。お気に入り・レシピ・キャンバス配置・API キーはすべて端末内にのみ保存。
</td>
</tr>
</table>
@@ -104,7 +118,7 @@
| グループ | 素材集 | 収録数 | 特徴 |
| :--- | :--- | :---: | :--- |
-| **動作** | ポーズ · 深度ポーズ | `288` × 2 | 同ポーズ・同アングルの線画+深度ペア、カード反転&プレビュー重ね比較 |
+| **動作** | ポーズ · 深度ポーズ | `288` × 2 | 同ポーズ・同アングルの線画+深度ペア、カード反転・同画面比較&重ね比較 |
| **人物・髪型** | 人物 · 表情 · 髪型 | `1,499` / `95` / `122` | CC0 架空ポートレート、ICT-FaceKit 感情強度分類、複数髪色バリエーション |
| **衣類** | 衣装 · アニメ衣装 · 時代衣装 | `1,407` / `1,760` / `57` | 色スウォッチ&アイテム絞り込み対応。普段着からアニメ・歴史衣装まで網羅 |
| **空間・小物** | 背景 · 照明 · 小道具 · 家具 | `64` / `50` / `32` / `41` | 複数アングル対応。背景・ライティング・持ち物や家具で場面全体を構成 |
@@ -115,8 +129,8 @@
| 方法 | 向いている用途 | 仕組み |
| :--- | :--- | :--- |
-| **自分の API キー** | すぐ始めたい・高性能モデルを使いたい | OpenAI・Gemini・豆包 Seedream や OpenAI / Gemini / xAI 互換中継を設定。ブラウザ直結またはサイトプロキシ経由に対応(カスタム中継は `http`/`https`・任意ポート対応)。 |
-| **ローカルエンジン** | プライバシー重視・API 費用ゼロ | PC 上の **ComfyUI** または **stable-diffusion.cpp**(`sd-server`)に接続し、画像を端末外に出さずに生成。カスタム多画像 ComfyUI ワークフローにも対応。[設定ガイド →](docs/local-engines.md) |
+| **自分の API キー** | すぐ始めたい・2026 最新マルチ画像モデル | OpenAI(`gpt-image-2.5` / `1`)・Gemini(`gemini-nano-banana-2.1` / `3.1`)・Seedream `5.5 / 5.0` に加え、**xAI Grok / FLUX.2 / Qwen-Image / Gemini 中継 / ローカルゲートウェイ**の 5 プリセットを内蔵。直結/プロキシ経由に対応(`http`/`https`・任意ポート)。 |
+| **ローカルエンジン** | プライバシー重視・API 費用ゼロ | PC 上の **ComfyUI** または **stable-diffusion.cpp**(`sd-server`)に接続し、画像を端末外に出さずに生成。標準 img2img、**深度 ControlNet**、**Qwen-Image-Edit 3 枚参照**テンプレートを同梱。[設定ガイド →](docs/local-engines.md) |
| **AI エージェント(MCP)** | Codex / Claude 等に素材探しを任せる | 読み取り専用 stdio MCP サーバーと選図スキルを同梱。12 素材集の検索、アングル指定取得、画像リンク付きプロンプト生成を自動化。[MCP ガイド →](mcp/README.md) |
```sh
@@ -142,7 +156,7 @@ npm start
起動後 `http://127.0.0.1:8787/` を開きます。閲覧・お気に入り・コピーにアカウントや API キーは不要です。初回起動時に公開目録を読み込み、画像は必要に応じて取得します。
- **アカウント不要**:登録・ログイン・サーバー側追跡なし
-- **端末内のみ保存**:お気に入り・設定・API キーは `localStorage`、生成履歴は IndexedDB に保存
+- **端末内のみ保存**:お気に入り・レシピ・キャンバス配置・設定・API キーは `localStorage`、生成履歴は IndexedDB に保存
- **完全消去**:ブラウザのサイトデータを削除すればすべて消えます
<details>
@@ -150,17 +164,17 @@ npm start
| キー | 操作 |
| :---: | :--- |
-| `⌘K` / `Ctrl+K` | グローバルコマンドパレットを開く(素材集移動・検索・クロッキー開始) |
+| `⌘K` / `Ctrl+K` | グローバルコマンドパレットを開く(素材集・無限キャンバス・レシピ・比較・クロッキー) |
| `/` | 検索欄にフォーカス |
| `R` | ランダムに 1 件開く |
| `T` | ライト/ダーク切替(一覧・プレビュー両対応) |
| `L` | 素材説明言語の切替(中国語/英語) |
| `1` – `9` | ライブラリの切替 |
| `←` `→` / `↑` `↓` | プレビュー:前後の項目・アングル切替 |
-| `Z` / `H` / `G` / `B` / `V` | プレビュー:2× 拡大 / 左右反転 / 構図ガイド / グレースケール明度 / 線画・深度重ね比較 |
-| `Space` | クロッキー練習:タイマーの一時停止・再開 |
+| `Z` / `H` / `G` / `B` / `U` / `V` | プレビュー/比較:2× 拡大 / 左右反転 / 構図ガイド / 明度・3 階調 / シルエット / 深度比較 |
+| `0` / `Space` + ドラッグ | 無限キャンバス:全体表示 / パン移動(クロッキー中は `Space` で一時停止・再開) |
| `F` / `A` / `C` / `S` | プレビュー:お気に入り / 組合せ追加 / 説明コピー / 共有リンク |
-| `Esc` | プレビュー・クロッキー・コマンドパレット・ダイアログを閉じる |
+| `Esc` | プレビュー・比較・レシピ・クロッキー・パレットを閉じる/集中モード終了 |
</details>
@@ -171,14 +185,14 @@ npm start
フレームワークなしの純静的構成:**素の JS + Python ビルド + Cloudflare Pages**。ビルド・素材管理・デプロイ手順は [AGENTS.md](AGENTS.md) を参照してください。
```sh
-# オフライン回帰テスト(素材アーカイブ不要)
+# オフライン回帰テスト(14 スイート・素材アーカイブ不要)
npm run test:offline
# 全サイト回帰テスト(ローカルプレビューまたは staging 向け)
npm test
```
-現在のリリース:**v1.4.0**(2026-11-25)· [全バージョン履歴](CHANGELOG.md)
+現在のリリース:**v1.5.0**(2026-11-28)· [全バージョン履歴](CHANGELOG.md)
---
diff --git a/README.md b/README.md
index c5f0a00..8798ce2 100644
--- a/README.md
+++ b/README.md
@@ -33,28 +33,42 @@
## 核心亮点
-### 画师级参考检视台 · 线稿 × 深度图实时卷帘对比
+### 无限空间画布创作台 · 语义连线、导演便签与自由试穿
<p align="center">
- <img src="docs/lightbox.jpg" alt="画师级大图检视台:姿势线稿与深度图同视角卷帘对比与构图参考线" width="900">
+ <img src="docs/studio.jpg" alt="无限空间画布创作台:自由拖拽参考卡、可注入提示词的导演便签、语义连线与输出预览节点" width="900">
</p>
-每一套姿势都配有同动作、同机位的**线稿**与**深度图**。在卡片上点编号即可原地翻面;点开大图后,底部浮动检视工具栏内置绘画常用核查工具:
+把传统静态画板升级为**真正可平移缩放的无限空间画布**——既是 PureRef 风格的视觉情绪板,也是实时联动的 AI 多图创作台:
-- **`Z` / 双击画面**:2× 细节缩放并自由拖拽查看衣纹、手势与关节透视
-- **`H` 镜像翻转**:一键水平镜像,核对人体重心与左右对称
-- **`G` 构图参考线**:在三分构图线、中心红轴与四分比例线之间循环切换
-- **`B` 灰度明度检查 & 自动取色板**:一键切灰度核对黑白素描明度关系,彩色参考图自动提取 5 枚实拍主色 `#HEX`(点击即复制)
-- **`V` 透视对比**:线稿与深度图同视角实时卷帘叠加,立体体积一目了然
+- **无限平移与居中缩放**:鼠标滚轮居中缩放(`35%–240%`)、拖拽空白平移、`0` 键一键适配视野、一键「整理」排版与全屏「专注」画布模式
+- **自由空间参考卡**:每张参考卡标注发送序号(`1 / 2 / 3`)与当前视角,支持自由拖拽、右下角缩放大小,以及悬浮快捷条(替换 / 切视角 / 画布镜像 / 移除)
+- **可注入提示词的导演便签**:双击画布空白或点「+ 便签」写下光影、构图与情绪要求,开启 `↳ 提示词` 即刻实时注入生图提示词并自动连线
+- **语义连线 × 输出预览节点**:优雅的贝塞尔连线将所有参考卡与便签汇聚到随画幅实时变化的「输出预览」节点,生成后成品自动回钉画布,支持多轮迭代对比与一键「当原图」
+- **造型方案 × 多生态导出**:支持保存常用搭配为命名「方案」并**保留当前姿势一键换角**(JSON 备份);提供 **12 种画风**、**9 档镜头景别**、**负向避坑词**、**拼图直拷剪贴板(Copy PNG)** 与 **Midjourney / SD·NovelAI / 结构化 JSON** 一键格式导出
---
-### 自由混搭创作工作台 · 序号画板与一键试穿
+### 2–4 图同屏参考对比 · 三阶明度块面与剪影检查
<p align="center">
- <img src="docs/studio.jpg" alt="完整创作工作台:带发送序号与视角标签的参考画板" width="900">
+ <img src="docs/compare.jpg" alt="2–4 图同屏参考对比工作室:同步构图参考线、镜像、明度块面、剪影与角度切换" width="900">
</p>
+<p align="center">
+ <img src="docs/lightbox.jpg" alt="画师级大图检视台:姿势线稿与深度图同视角卷帘对比与构图参考线" width="900">
+</p>
+
+每一套姿势都配有同动作、同机位的**线稿**与**深度图**。支持卡片原地翻面、**2–4 图同屏参考对比**(从批量栏、悬浮创作台或 `⌘K` 唤起)与画师级大图检视:
+
+- **`Z` / 双击画面**:2× 细节缩放并自由拖拽查看衣纹、手势与关节透视
+- **`H` 镜像翻转 & `G` 构图参考线**:水平镜像核对人体重心,在三分线与中心红轴/四分比例线间循环切换(同屏对比全卡同步)
+- **`B` 灰度 / 三阶明度块面(Notan)& 自动取色板**:在「灰度 → 三阶明度块面 → 关闭」间循环核对黑白素描关系;彩色图自动提取 5 枚实拍主色 `#HEX`(点击即复制)
+- **`U` 剪影轮廓检查**:纯 SVG 滤镜实时检查剪影可读性(外链图零 CORS 限制,深度图自动反色匹配)
+- **`V` 透视对比**:线稿与深度图同视角实时卷帘叠加,立体体积一目了然
+
+---
+
<table>
<tr>
<td width="33.3%" valign="top">
@@ -65,35 +79,35 @@
<td width="33.3%" valign="top">
<img src="docs/dark.jpg" alt="深色模式与悬浮创作台"><br>
<b>深色画布 × 悬浮创作台</b><br>
- <sub>随逛随加不打断浏览,在底部浮层里直接编辑提示词、选比例并出图。</sub>
+ <sub>随逛随加不打断浏览,在底部浮层里直接编辑提示词、选比例、同屏对比并出图。</sub>
</td>
<td width="33.3%" valign="top">
<img src="docs/mobile.jpg" alt="移动端浏览与翻面"><br>
<b>移动端原生适配</b><br>
- <sub>触屏翻面、切视角、选材、生成与查看历史记录在手机上同样顺手。</sub>
+ <sub>触屏翻面、切视角、选材、生成与紧凑流式画板在 320px 手机上同样零溢出顺手。</sub>
</td>
</tr>
</table>
<table>
<tr>
- <td width="50%" valign="top">
- <b>画板序号对齐提示词 · 一键导出拼图 PNG</b><br>
- 参考画板为每张参考图标注发送序号(<code>1 / 2 / 3</code>)与当前机位,与提示词中的 <code>image 1 / 2 / 3</code> 一一对应;支持「换一组」抽卡、一键清空并撤销,还可直接<b>导出高分参考拼图 PNG</b>,方便发给 Midjourney / Kling / PureRef 或与团队分享。
- </td>
<td width="50%" valign="top">
<b>全屏速写定时练习(Gesture Studio)</b><br>
- 基于当前筛选结果进入无干扰全屏定时练习,支持 <code>30s / 60s / 2m / 5m</code> 计时与 <code>5 / 10 / 20 / 无限</code> 张数、可选柔和提示音、镜像 / 参考线 / 灰度 / 线稿深度切换,结束后自动生成可点击回溯的练习回顾接触表。
+ 基于当前筛选结果进入无干扰全屏定时练习,支持 <code>30s / 60s / 2m / 5m</code> 计时与 <code>5 / 10 / 20 / 无限</code> 张数、柔和提示音、镜像 / 参考线 / 三阶明度 / 剪影 / 线稿深度切换,结束后自动生成可点击回溯的练习回顾接触表。
</td>
- </tr>
- <tr>
<td width="50%" valign="top">
<b>本地生成记录与参考溯源</b><br>
所有成图存在本机浏览器 IndexedDB,支持按模式(试穿 / 生图)筛选与关键词搜索提示词/模型,大图侧栏自动列出本次所用的全部参考图并可点击回溯原条目,支持单张下载与批量 ZIP 打包。
</td>
+ </tr>
+ <tr>
<td width="50%" valign="top">
<b>全局命令面板(⌘K)× 快捷选择器</b><br>
- 任意页面按 <code>⌘K</code> / <code>Ctrl+K</code> 模糊检索并直达 12 个图库、工作台、速写计时器与外观/语言切换;工作台选择器支持分类快筛、「仅看收藏」与拖拽上传人物/服装图。
+ 任意页面按 <code>⌘K</code> / <code>Ctrl+K</code> 模糊检索并直达 12 个图库、无限画布工具、造型方案、同屏对比、速写计时器与外观/语言切换;选择器支持分类快筛、「仅看收藏」与拖拽上传。
+ </td>
+ <td width="50%" valign="top">
+ <b>五语界面 × 零账号纯本地</b><br>
+ 原生支持简体中文、English、日本語、Tiếng Việt、Türkçe 五语切换,界面语言独立于提示词语言;所有偏好、造型方案、画布布局与 API Key 均仅存本机浏览器。
</td>
</tr>
</table>
@@ -104,7 +118,7 @@
| 分组 | 素材库 | 规模 | 特点 |
| :--- | :--- | :---: | :--- |
-| **姿态** | 姿势 · 深度姿势 | `288` × 2 | 同动作同机位成对联动,多拍摄角度,支持卡片原地翻面与灯箱卷帘对比 |
+| **姿态** | 姿势 · 深度姿势 | `288` × 2 | 同动作同机位成对联动,多拍摄角度,支持卡片原地翻面、同屏对比与卷帘叠加 |
| **人物造型** | 人像 · 表情 · 发型 | `1,499` / `95` / `122` | CC0 虚构人像脸模、ICT-FaceKit 情绪强度分级、多发色变体热链参考 |
| **服饰** | 服装 · 动画服装 · 历代服饰 | `1,407` / `1,760` / `57` | 支持真实色卡与单品筛选,覆盖日常穿搭、动画造型与历代传统服饰 |
| **环境与物件** | 场景 · 光影 · 道具 · 家具 | `64` / `50` / `32` / `41` | 机位/视角可选,补全构图背景、布光氛围与手持/陈设细节 |
@@ -115,8 +129,8 @@
| 方式 | 适用场景 | 说明 |
| :--- | :--- | :--- |
-| **云端 API Key** | 开箱即用,支持最强多图编辑模型 | 填 OpenAI、Gemini、豆包 Seedream 密钥,或任意兼容 OpenAI / Gemini / xAI 协议的中转。支持浏览器直连或本站代理转发,自定义中转支持 `http` / `https` 与任意端口。 |
-| **本机引擎** | 隐私优先、零 API 费用 | 直连本机 **ComfyUI** 或 **stable-diffusion.cpp**(`sd-server`),图片不出本机;ComfyUI 支持内置单图与自定义多图 API 工作流。[配置说明 →](docs/local-engines.md) |
+| **云端 API Key** | 开箱即用,支持最新多图编辑模型 | 支持 OpenAI(`gpt-image-2.5` / `1`)、Gemini(`gemini-nano-banana-2.1` / `3.1`)、豆包 Seedream `5.5 / 5.0`,内置 **xAI Grok / FLUX.2 / Qwen-Image / Gemini 中转 / 本机网关** 5 组一键预设;自定义中转支持 `http` / `https` 任意端口直连或代理转发。 |
+| **本机引擎** | 隐私优先、零 API 费用 | 直连本机 **ComfyUI** 或 **stable-diffusion.cpp**(`sd-server`),图片不出本机;随仓附带默认图生图、**深度图 ControlNet** 与 **Qwen-Image-Edit 三参考图** API 工作流模板。[配置说明 →](docs/local-engines.md) |
| **AI 智能体(MCP)** | 交给 Codex / Claude 等智能体自动挑图 | 仓库内置只读 stdio MCP 服务与选图 Skill,智能体可自主检索 12 个图库、挑选精确机位并组装带图链的提示词。[MCP 接入文档 →](mcp/README.md) |
```sh
@@ -142,7 +156,7 @@ npm start
启动后访问本地预览地址 `http://127.0.0.1:8787/`。浏览、收藏与复制均无需账号和密钥;首次打开自动加载公开目录,图片按需加载。
- **零账号**:无注册、无追踪登录态
-- **纯本地持久化**:收藏、设置与 API Key 仅存浏览器 `localStorage`,生成记录仅存本机 IndexedDB
+- **纯本地持久化**:收藏、方案、画布布局、设置与 API Key 仅存浏览器 `localStorage`,生成记录仅存本机 IndexedDB
- **一清即净**:清除站点数据即可完整删除全部本地状态
<details>
@@ -150,17 +164,17 @@ npm start
| 快捷键 | 作用 |
| :---: | :--- |
-| `⌘K` / `Ctrl+K` | 打开全局命令面板(跳转图库、搜索、启动速写、切换外观) |
+| `⌘K` / `Ctrl+K` | 打开全局命令面板(跳转图库、搜索、无限画布、方案、对比、速写、外观) |
| `/` | 聚焦搜索框 |
| `R` | 随机挑一个参考 |
| `T` | 切换深浅外观(图库与灯箱内均可用) |
| `L` | 切换素材描述语言(中 / 英) |
| `1` – `9` | 快速切换栏目 |
| `←` `→` / `↑` `↓` | 大图:切换上一张 / 下一张、切换拍摄角度 |
-| `Z` / `H` / `G` / `B` / `V` | 大图:2× 缩放 / 镜像翻转 / 构图参考线 / 灰度明度检查 / 线稿深度卷帘对比 |
-| `Space` | 速写练习:暂停 / 继续倒计时 |
+| `Z` / `H` / `G` / `B` / `U` / `V` | 大图 / 对比:2× 缩放 / 镜像 / 参考线 / 灰度与三阶明度 / 剪影 / 线稿深度对比 |
+| `0` / `Space` + 拖拽 | 无限画布:一键适配视野 / 自由平移画布(速写内 `Space` 暂停/继续) |
| `F` / `A` / `C` / `S` | 大图:收藏 / 加入组合 / 复制描述 / 复制分享链接 |
-| `Esc` | 关闭灯箱、速写练习、命令面板或弹窗 |
+| `Esc` | 关闭灯箱、同屏对比、方案窗、速写、命令面板或退出专注画布 |
</details>
@@ -171,14 +185,14 @@ npm start
纯静态架构:**原生 JS + Python 构建 + Cloudflare Pages**(无框架、无前端打包器)。构建、素材准备、部署与架构约束详见 [AGENTS.md](AGENTS.md)。
```sh
-# 离线回归(无需素材档案与外部网络)
+# 离线回归(无需素材档案与外部网络,14 项套件)
npm run test:offline
# 完整全站回归(配合本地预览或 staging 目录)
npm test
```
-当前发布版本 **v1.4.0**(2026-11-25)· [查看全部更新日志](CHANGELOG.md)
+当前发布版本 **v1.5.0**(2026-11-28)· [查看全部更新日志](CHANGELOG.md)
---
diff --git a/README.tr.md b/README.tr.md
index bb1830f..a264508 100644
--- a/README.tr.md
+++ b/README.tr.md
@@ -33,28 +33,42 @@
## Öne Çıkanlar
-### Sanatçı Işık Kutusu Stüdyosu · Canlı Çizgi Sanatı × Derinlik Bölünmüş Karşılaştırma
+### Sonsuz Uzamsal Tuval Stüdyosu · Semantik Kablolar, Yapışkan Notlar ve Sanal Deneme
<p align="center">
- <img src="docs/lightbox-en.jpg" alt="Canlı çizgi sanatı ve derinlik bölünmüş karşılaştırmalı ve kompozisyon ızgaralı sanatçı ışık kutusu stüdyosu" width="900">
+ <img src="docs/studio-en.jpg" alt="Sürüklenebilir referans kartları, istem bağlantılı yapışkan notlar, semantik kablolar ve çıktı önizleme düğümüyle Sonsuz Uzamsal Tuval Stüdyosu" width="900">
</p>
-Her poz, birebir aynı kamera açısından bir **çizgi eskizi** ve **eşleşen derinlik haritasıyla** birlikte gelir. Herhangi bir kartı rozetinden olduğu yerde çevirin veya yerleşik sanatçı araçlarıyla incelemek için ışık kutusunu açın:
+Statik referans panosu artık **gerçek kaydırma ve yakınlaştırma destekli bir Sonsuz Uzamsal Tuval** — PureRef tarzı görsel moodboard'u canlı çoklu referanslı yapay zeka stüdyosuyla birleştiriyor:
-- **`Z` / Çift tıklama**: Kıvrımlar, eller ve perspektif ayrıntıları için sürüklenebilir 2× yakınlaştırma
-- **`H` Ayna**: Denge ve anatomik oranları kontrol etmek için anında yatay çevirme
-- **`G` Kompozisyon Izgarası**: Üçler kuralı ile merkez eksen / çeyrek oran kılavuzları arasında geçiş
-- **`B` Gri Tonlama Değer Çalışması ve Otomatik Renk Paleti**: Ton çalışması için gri tonlamaya geçin ve renkli fotoğraflardan en fazla 5 gerçek `#HEX` renk örneği çıkarın (tek tıkla kopyalayın)
-- **`V` Bölünmüş Karşılaştırma**: Aynı açıdaki çizgi sanatı ile derinlik haritası arasında canlı perde sürükleyin
+- **Akıcı Kaydırma ve İmleç Odaklı Yakınlaştırma**: tekerlekle yakınlaştırma (`35%–240%`), boş alandan sürükleyerek kaydırma, `0` tuşuyla görünüme sığdırma, otomatik «Düzenle» ve tam ekran **Odak Tuval** modu
+- **Sürüklenebilir ve Boyutlandırılabilir Kartlar**: her kart gönderim sırasını (`1 / 2 / 3`) ve açıyı gösterir, 8px ızgaraya hizalanarak sürüklenir, köşe tutamacından boyutlandırılır ve hızlı işlem çubuğu (değiştir / açı / ayna / kaldır) sunar
+- **İsteme Bağlı Sanat Yönetimi Notları**: boş tuvale çift tıklayın veya `+ Not` ile ışık, kadraj ve atmosfer notları ekleyin — `↳ İstem` açıkken notlarınız canlı olarak isteme eklenir ve otomatik bağlanır
+- **Semantik Bézier Kablolar ve Canlı Çıktı Çerçevesi**: akıcı eğri kablolar tüm referansları seçili en-boy oranına göre değişen **Çıktı Çerçevesi**ne bağlar; üretilen görseller yan yana yineleme ve tek tıkla **Orijinal olarak kullan** için doğrudan tuvale sabitlenir
+- **Stüdyo Tarifleri ve Çoklu Ekosistem Dışa Aktarımı**: tekrar kullanılan kombinasyonları adlandırılmış **Tarifler** olarak kaydedin (**Pozu koru** ile yalnızca karakter/kıyafet değiştirin & JSON yedekleyin); **12 stil**, **9 kamera çekimi**, **negatif istem**, **panoya PNG kopyalama** ve **Midjourney / SD·NovelAI / JSON** dışa aktarımı sunar
---
-### Yaratıcı Stüdyo · Numaralı Referans Panosu ve Sanal Deneme
+### Yan Yana Referans Karşılaştırma (2–4 Öğe) · 3 Ton Notan ve Silüet Kontrolü
<p align="center">
- <img src="docs/studio-en.jpg" alt="Numaralı referans panosu kartları ve kamera açısı rozetleriyle yaratıcı stüdyo" width="900">
+ <img src="docs/compare-en.jpg" alt="Eşzamanlı kompozisyon ızgarası, ayna, Notan, silüet ve satır içi açı değiştiricili 4'lü yan yana referans karşılaştırma stüdyosu" width="900">
</p>
+<p align="center">
+ <img src="docs/lightbox-en.jpg" alt="Canlı çizgi sanatı ve derinlik bölünmüş karşılaştırmalı ve kompozisyon ızgaralı sanatçı ışık kutusu stüdyosu" width="900">
+</p>
+
+Her poz, birebir aynı kamera açısından bir **çizgi eskizi** ve **eşleşen derinlik haritasıyla** gelir. Kartları yerinde çevirin, **2–4 referansı yan yana karşılaştırın** (toplu seçim, yüzen panel veya `⌘K` üzerinden) ya da ışık kutusunda inceleyin:
+
+- **`Z` / Çift tıklama**: Kıvrımlar, eller ve perspektif ayrıntıları için sürüklenebilir 2× yakınlaştırma
+- **`H` Ayna ve `G` Kompozisyon Izgarası**: Denge, simetri ve üçler kuralı / merkez eksen kılavuzları (karşılaştırmada tüm kartlarla eşzamanlı)
+- **`B` Gri Ton / 3 Ton Notan ve Otomatik Renk Paleti**: Gri ton → 3 ton Notan değer blokları → Kapalı arasında geçiş yapın; renkli fotoğraflardan 5 gerçek `#HEX` örneği çıkarın (tek tıkla kopyalayın)
+- **`U` Silüet Kontrolü**: Saf SVG filtresiyle silüet okunabilirliğini anında kontrol edin (harici görsellerde CORS sorunsuz, derinlik haritalarında otomatik ters)
+- **`V` Bölünmüş Karşılaştırma**: Aynı açıdaki çizgi sanatı ile derinlik haritası arasında canlı perde sürükleyin
+
+---
+
<table>
<tr>
<td width="33.3%" valign="top">
@@ -65,35 +79,35 @@ Her poz, birebir aynı kamera açısından bir **çizgi eskizi** ve **eşleşen
<td width="33.3%" valign="top">
<img src="docs/dark-en.jpg" alt="Koyu mod galeri ve yüzen çalışma alanı paneli"><br>
<b>Koyu Tuval ve Yüzen Çalışma Alanı</b><br>
- <sub>Galeriden ayrılmadan referans toplayın, panelde istemleri düzenleyin ve anında görsel oluşturun.</sub>
+ <sub>Galeriden ayrılmadan referans toplayın, yan yana karşılaştırın, istemleri düzenleyin ve anında görsel oluşturun.</sub>
</td>
<td width="33.3%" valign="top">
<img src="docs/mobile-en.jpg" alt="Mobilde dokunmatik gezinme ve kart çevirme"><br>
<b>Dokunmatik ve Mobil İçin Tasarlandı</b><br>
- <sub>Telefonda pozları çevirin, açıları değiştirin, setler oluşturun ve geçmişi rahatça inceleyin.</sub>
+ <sub>320px ekranlarda dahi taşmasız kompakt stüdyo ile poz çevirme, açı değiştirme ve geçmiş inceleme akıcı çalışır.</sub>
</td>
</tr>
</table>
<table>
<tr>
- <td width="50%" valign="top">
- <b>Numaralı Pano ve Tek Tıkla Moodboard PNG Dışa Aktarımı</b><br>
- Her kart, istemdeki <code>image 1 / 2 / 3</code> ile eşleşen gönderim sırasını (<code>1 / 2 / 3</code>) ve kamera açısını gösterir. Görünümleri karıştırın, Geri Al ile temizleyin ve Midjourney, Kling, PureRef veya paylaşım için hazır <b>yüksek çözünürlüklü referans sayfası PNG'si dışa aktarın</b>.
- </td>
<td width="50%" valign="top">
<b>Tam Ekran Hızlı Eskiz Stüdyosu</b><br>
- Mevcut filtrelenmiş galerinizden dikkat dağıtmayan zamanlayıcılı bir pratik oturumu başlatın: <code>30s / 60s / 2m / 5m</code> zamanlayıcılar, <code>5 / 10 / 20 / Sınırsız</code> desteler, isteğe bağlı uyarı sesi, ayna / ızgara / gri tonlama / derinlik çevirme araçları ve tıklanabilir oturum özeti.
+ Mevcut filtrelenmiş galerinizden dikkat dağıtmayan zamanlayıcılı bir pratik oturumu başlatın: <code>30s / 60s / 2m / 5m</code> zamanlayıcılar, <code>5 / 10 / 20 / Sınırsız</code> desteler, isteğe bağlı uyarı sesi, ayna / ızgara / 3 ton Notan / silüet / derinlik araçları ve tıklanabilir oturum özeti.
</td>
- </tr>
- <tr>
<td width="50%" valign="top">
<b>Referans İzlenebilirliğine Sahip Yerel Geçmiş</b><br>
Oluşturulan çıktılar tarayıcınızın IndexedDB depolamasında kalır; mod filtreleri (Deneme / Oluşturma), istem/model arama, ışık kutusu içinde kullanılan tam referansların tıklanabilir küçük resimleri, tekli indirme ve toplu ZIP dışa aktarımı sunar.
</td>
+ </tr>
+ <tr>
<td width="50%" valign="top">
<b>Genel Komut Paleti (⌘K) ve Hızlı Seçici</b><br>
- 12 kitaplığın tamamına atlamak, arama yapmak, Eskiz Stüdyosu'nu başlatmak veya tema ve dil değiştirmek için her yerden <code>⌘K</code> / <code>Ctrl+K</code> tuşlarına basın; stüdyo seçicisi kategori etiketleri, yalnızca Favoriler filtresi ve sürükle-bırak yükleme ekler.
+ 12 kitaplık, sonsuz tuval araçları, Tarifler, Karşılaştırma, Eskiz Stüdyosu veya tema/dil değiştirmek için her yerden <code>⌘K</code> / <code>Ctrl+K</code> tuşlarına basın; seçici kategori etiketleri, yalnızca Favoriler ve sürükle-bırak yükleme sunar.
+ </td>
+ <td width="50%" valign="top">
+ <b>5 Dilli Arayüz ve Hesapsız Gizlilik</b><br>
+ Çince, İngilizce, Japonca, Vietnamca ve Türkçe arayüz desteği (istem dilinden bağımsız); favoriler, tarifler, tuval düzeni ve API anahtarları yalnızca tarayıcınızda saklanır.
</td>
</tr>
</table>
@@ -104,7 +118,7 @@ Her poz, birebir aynı kamera açısından bir **çizgi eskizi** ve **eşleşen
| Grup | Kitaplıklar | Öğe | Öne Çıkanlar |
| :--- | :--- | :---: | :--- |
-| **Hareket** | Pozlar · Derinlik pozları | `288` × 2 | Eşleştirilmiş çizgi eskizleri ve derinlik haritaları, çoklu açılar, kart içi çevirme ve ışık kutusunda bölünmüş karşılaştırma |
+| **Hareket** | Pozlar · Derinlik pozları | `288` × 2 | Eşleştirilmiş çizgi eskizleri ve derinlik haritaları, çoklu açılar, kart içi çevirme, yan yana karşılaştırma ve bölünmüş perde |
| **İnsan** | Portreler · İfadeler · Saç stilleri | `1.499` / `95` / `122` | CC0 kurgusal portreler, ICT-FaceKit ifade yoğunluğu filtreleri, çok renkli saç stili varyantları |
| **Giyim** | Kıyafetler · Anime kıyafetleri · Tarihsel kıyafetler | `1.407` / `1.760` / `57` | Modern, anime ve dönem kıyafetlerini kapsayan görsel renk örnekleri ve parça filtreleri |
| **Ortam** | Sahneler · Aydınlatma · Aksesuarlar · Mobilya | `64` / `50` / `32` / `41` | Tam sahne kompozisyonu için çok açılı mekanlar, ışık kurulumları, aksesuarlar ve mobilyalar |
@@ -115,8 +129,8 @@ Her poz, birebir aynı kamera açısından bir **çizgi eskizi** ve **eşleşen
| Mod | En Uygun Kullanım | Nasıl Çalışır |
| :--- | :--- | :--- |
-| **Bulut API Anahtarı** | En hızlı kurulum ve en güçlü çoklu görsel modelleri | OpenAI, Gemini, Seedream veya herhangi bir OpenAI / Gemini / xAI uyumlu aracı uç noktaya bağlanın. Doğrudan tarayıcınızdan veya site proxy'si üzerinden gönderin (özel uç noktalar için `http`/`https` ve tüm portlar desteklenir). |
-| **Yerel Motor** | Tam gizlilik ve sıfır API maliyeti | Kendi makinenizde çalışan **ComfyUI** veya **stable-diffusion.cpp** (`sd-server`) sunucusuna bağlanın — görseller cihazınızdan hiç çıkmaz. Yerleşik tek referanslı ve özel çok referanslı ComfyUI API iş akışlarını destekler. [Kurulum kılavuzu →](docs/local-engines.md) |
+| **Bulut API Anahtarı** | En hızlı kurulum ve 2026 çoklu görsel modelleri | OpenAI (`gpt-image-2.5` / `1`), Gemini (`gemini-nano-banana-2.1` / `3.1`), Seedream `5.5 / 5.0` veya **5 tek tıkla aktarıcı ön ayarına** (xAI Grok, FLUX.2, Qwen-Image, Gemini Aktarıcı, Yerel Ağ Geçidi) bağlanın. Doğrudan veya site proxy'si üzerinden (`http`/`https`, tüm portlar). |
+| **Yerel Motor** | Tam gizlilik ve sıfır API maliyeti | Makinenizdeki **ComfyUI** veya **stable-diffusion.cpp** (`sd-server`) sunucusuna bağlanın. img2img, **ControlNet Depth** ve **3 referanslı Qwen-Image-Edit** ComfyUI şablonlarıyla birlikte gelir. [Kurulum kılavuzu →](docs/local-engines.md) |
| **Yapay Zeka Ajanı (MCP)** | Codex / Claude içinde otomatik referans arama | Ajanınızın 12 kitaplıkta arama yapması, tam açıları seçmesi ve görsel bağlantılı özetler hazırlaması için salt okunur bir stdio MCP sunucusu ve referans seçme yeteneği içerir. [MCP kılavuzu →](mcp/README.md) |
```sh
@@ -142,7 +156,7 @@ npm start
`http://127.0.0.1:8787/` adresini açın. Gezinme, favoriler ve kopyalama için hesap veya API anahtarı gerekmez; kataloglar ilk açılışta herkese açık siteden, görseller ise talep üzerine yüklenir.
- **Hesap yok**: kayıt yok, sunucu tarafında izleme yok
-- **Tarayıcıda yerel durum**: favoriler, ayarlar ve API anahtarları `localStorage` içinde; geçmiş IndexedDB içinde saklanır
+- **Tarayıcıda yerel durum**: favoriler, tarifler, tuval düzeni, ayarlar ve API anahtarları `localStorage` içinde; geçmiş IndexedDB içinde saklanır
- **Temiz kaldırma**: site verilerini temizlemek tüm yerel verileri anında siler
<details>
@@ -150,17 +164,17 @@ npm start
| Tuş | İşlem |
| :---: | :--- |
-| `⌘K` / `Ctrl+K` | Genel Komut Paleti'ni aç (kitaplıklar, arama, Eskiz Stüdyosu, ayarlar) |
+| `⌘K` / `Ctrl+K` | Genel Komut Paleti'ni aç (kitaplıklar, sonsuz tuval, tarifler, karşılaştırma, eskiz) |
| `/` | Aramaya odaklan |
| `R` | Rastgele bir referans seç |
| `T` | Açık / koyu temayı değiştir (galeri ve ışık kutusunda çalışır) |
| `L` | Referans açıklama dilini değiştir (ZH / EN) |
| `1` – `9` | Kitaplıklar arasında geçiş yap |
| `←` `→` / `↑` `↓` | Işık kutusu: önceki / sonraki öğe, kamera açısını değiştir |
-| `Z` / `H` / `G` / `B` / `V` | Işık kutusu: 2× yakınlaştırma / ayna / kompozisyon ızgarası / gri tonlama değer kontrolü / bölünmüş derinlik karşılaştırması |
-| `Space` | Eskiz Stüdyosu: zamanlayıcıyı duraklat / devam ettir |
+| `Z` / `H` / `G` / `B` / `U` / `V` | Işık kutusu / Karşılaştırma: 2× yakınlaştırma / ayna / ızgara / gri ton & 3 ton Notan / silüet / derinlik |
+| `0` / `Space` + sürükle | Sonsuz Tuval: görünüme sığdır / kaydır (`Space` Eskiz Stüdyosu'nda duraklatır/devam ettirir) |
| `F` / `A` / `C` / `S` | Işık kutusu: favorilere ekle / sete ekle / istemi kopyala / bağlantıyı paylaş |
-| `Esc` | Işık kutusunu, Eskiz Stüdyosu'nu, Komut Paleti'ni veya pencereyi kapat |
+| `Esc` | Işık kutusunu, Karşılaştırma'yı, Tarifler'i, Eskiz'i, Komut Paleti'ni kapat veya Odak modundan çık |
</details>
@@ -171,14 +185,14 @@ npm start
Tamamen statik mimari: **saf JS + Python derleme + Cloudflare Pages** (framework yok, bundler yok). Varlık kurulumu, derleme adımları ve dağıtım kontrolleri için [AGENTS.md](AGENTS.md) dosyasına bakın.
```sh
-# Çevrimdışı regresyon paketi (varlık arşivi olmadan doğrudan kaynak koddan çalışır)
+# Çevrimdışı regresyon paketi (14 paket — varlık arşivi olmadan doğrudan kaynak koddan çalışır)
npm run test:offline
# Tam site regresyon paketi (yerel önizleme veya staging derlemesine karşı)
npm test
```
-Güncel sürüm **v1.4.0** (2026-11-25) · [Tam değişiklik günlüğü](CHANGELOG.md)
+Güncel sürüm **v1.5.0** (2026-11-28) · [Tam değişiklik günlüğü](CHANGELOG.md)
---
diff --git a/README.vi.md b/README.vi.md
index 6850889..b05b3f6 100644
--- a/README.vi.md
+++ b/README.vi.md
@@ -33,28 +33,42 @@
## Điểm nổi bật
-### Trình xem tham chiếu cho họa sĩ · So sánh kéo màn Phác thảo × Bản đồ độ sâu
+### Studio Bảng Vẽ Không Gian Vô Hạn · Dây Dẫn Ngữ Nghĩa, Ghi Chú Prompt & Thử Đồ
<p align="center">
- <img src="docs/lightbox-en.jpg" alt="Trình xem lớn với so sánh kéo màn phác thảo và bản đồ độ sâu kèm lưới bố cục" width="900">
+ <img src="docs/studio-en.jpg" alt="Studio bảng vẽ không gian vô hạn với thẻ kéo thả, ghi chú nối prompt, dây dẫn ngữ nghĩa và nút xem trước đầu ra" width="900">
</p>
-Mỗi tư thế đều có cặp **phác thảo nét vẽ** và **bản đồ độ sâu** trùng khớp từng góc chụp. Nhấn vào mã thẻ để lật tại chỗ, hoặc mở xem lớn để dùng thanh công cụ kiểm tra chuyên dụng cho vẽ:
+Bảng tham chiếu nay đã trở thành **Bảng Vẽ Không Gian Vô Hạn hỗ trợ kéo-thả & thu-phóng thực thụ** — kết hợp moodboard kiểu PureRef với studio tạo ảnh AI đa tham chiếu trực tiếp:
-- **`Z` / Nhấp đúp ảnh**: phóng to 2× và kéo tự do để soi nếp vải, bàn tay và phối cảnh khớp
-- **`H` Lật ngang**: lật gương ngay lập tức để kiểm tra trọng tâm và tỷ lệ đối xứng cơ thể
-- **`G` Lưới bố cục**: chuyển vòng giữa lưới 1/3 và trục tâm đỏ + lưới chia tư
-- **`B` Kiểm tra sắc độ xám & Bảng màu tự động**: chuyển đen trắng để kiểm tra sáng tối, đồng thời tự trích xuất tối đa 5 mã màu `#HEX` chủ đạo từ ảnh màu (nhấn để sao chép)
-- **`V` So sánh kéo màn**: kéo rèm trực tiếp giữa bản phác thảo và bản đồ độ sâu cùng góc chụp
+- **Di chuyển vô hạn & Thu phóng theo con trỏ**: lăn chuột thu phóng (`35%–240%`), kéo vùng trống để di chuyển, phím `0` để vừa khung nhìn, «Sắp xếp» tự động và chế độ **Tập trung toàn màn hình**
+- **Thẻ tham chiếu kéo thả & đổi kích thước**: hiển thị thứ tự gửi (`1 / 2 / 3`) và góc chụp, kéo tự do, đổi cỡ từ góc dưới phải, cùng thanh thao tác nhanh (đổi tư liệu / đổi góc / lật gương / xóa)
+- **Ghi chú đạo diễn nối trực tiếp vào Prompt**: nhấp đúp vùng trống hoặc nhấn `+ Ghi chú` để ghi yêu cầu ánh sáng, bố cục, cảm xúc — bật `↳ Prompt` để tự động chèn vào prompt và nối dây trực tiếp
+- **Dây dẫn Bézier & Nút Xem Trước Đầu Ra**: dây nối mượt mà dẫn toàn bộ ảnh tham chiếu và ghi chú tới khung xem trước theo đúng tỷ lệ ảnh; ảnh tạo xong tự ghim ngay trên bảng vẽ để so sánh nhiều phiên bản và nhấn «Dùng làm bản gốc»
+- **Công thức phối đồ & Xuất đa nền tảng**: lưu bộ nhân vật/trang phục/bối cảnh thành **Công thức** có tên (hỗ trợ **Giữ tư thế** chỉ đổi nhân vật & sao lưu JSON); **12 phong cách**, **9 góc máy**, **prompt phủ định**, **Chép PNG vào bộ nhớ tạm** và xuất **Midjourney / SD·NovelAI / JSON**
---
-### Studio sáng tạo · Bảng tham chiếu đánh số & Thử đồ ảo
+### So Sánh Song Song 2–4 Ảnh · Kiểm Tra Sắc Độ 3 Bậc (Notan) & Bóng Dáng
<p align="center">
- <img src="docs/studio-en.jpg" alt="Studio sáng tạo với bảng tham chiếu đánh số thứ tự gửi và nhãn góc chụp" width="900">
+ <img src="docs/compare-en.jpg" alt="Studio so sánh song song 4 ảnh với lưới bố cục, lật ngang, sắc độ 3 bậc và đổi góc trực tiếp" width="900">
</p>
+<p align="center">
+ <img src="docs/lightbox-en.jpg" alt="Trình xem lớn với so sánh kéo màn phác thảo và bản đồ độ sâu kèm lưới bố cục" width="900">
+</p>
+
+Mỗi tư thế đều có cặp **phác thảo nét vẽ** và **bản đồ độ sâu** trùng khớp từng góc chụp. Hỗ trợ lật thẻ tại chỗ, **so sánh song song 2–4 tư liệu** (từ thanh chọn hàng loạt, bảng nổi hoặc `⌘K`) và trình xem lớn cho họa sĩ:
+
+- **`Z` / Nhấp đúp ảnh**: phóng to 2× và kéo tự do để soi nếp vải, bàn tay và phối cảnh khớp
+- **`H` Lật ngang & `G` Lưới bố cục**: kiểm tra đối xứng, trọng tâm và lưới 1/3 / trục tâm đỏ (đồng bộ toàn bộ thẻ trong chế độ so sánh)
+- **`B` Đen trắng / Sắc độ 3 bậc (Notan) & Bảng màu tự động**: chuyển vòng Đen trắng → Sắc độ 3 bậc → Tắt, cùng trích xuất tự động 5 mã màu `#HEX` (nhấn để sao chép)
+- **`U` Kiểm tra bóng dáng (Silhouette)**: bộ lọc SVG thuần kiểm tra hình khối rõ nét (tương thích cả ảnh liên kết ngoài không lỗi CORS, tự đảo sắc cho bản đồ độ sâu)
+- **`V` So sánh kéo màn**: kéo rèm trực tiếp giữa bản phác thảo và bản đồ độ sâu cùng góc chụp
+
+---
+
<table>
<tr>
<td width="33.3%" valign="top">
@@ -65,35 +79,35 @@ Mỗi tư thế đều có cặp **phác thảo nét vẽ** và **bản đồ đ
<td width="33.3%" valign="top">
<img src="docs/dark-en.jpg" alt="Giao diện tối và không gian làm việc nổi"><br>
<b>Nền tối × Không gian làm việc nổi</b><br>
- <sub>Vừa duyệt vừa gom tư liệu không bị gián đoạn, chỉnh prompt và tạo ảnh ngay trong thanh nổi cuối màn hình.</sub>
+ <sub>Vừa duyệt vừa gom tư liệu, mở so sánh song song, chỉnh prompt và tạo ảnh ngay trong thanh nổi cuối màn hình.</sub>
</td>
<td width="33.3%" valign="top">
<img src="docs/mobile-en.jpg" alt="Duyệt và lật thẻ trên điện thoại"><br>
<b>Tối ưu cảm ứng trên di động</b><br>
- <sub>Lật tư thế, đổi góc chụp, chọn tư liệu, tạo ảnh và xem lại lịch sử gọn gàng ngay trên điện thoại.</sub>
+ <sub>Lật tư thế, đổi góc chụp, tạo ảnh và dùng bố cục studio gọn gàng không tràn viền ngay cả trên màn hình 320px.</sub>
</td>
</tr>
</table>
<table>
<tr>
- <td width="50%" valign="top">
- <b>Bảng đánh số khớp prompt · Xuất bảng PNG một chạm</b><br>
- Mỗi thẻ hiển thị thứ tự gửi (<code>1 / 2 / 3</code>) và góc chụp khớp với <code>image 1 / 2 / 3</code> trong prompt. Hỗ trợ «Đổi bộ khác», xóa nhanh có hoàn tác và <b>xuất bảng tham chiếu ghép PNG độ phân giải cao</b> cho Midjourney, Kling, PureRef hoặc chia sẻ nhóm.
- </td>
<td width="50%" valign="top">
<b>Luyện ký họa toàn màn hình (Gesture Studio)</b><br>
- Vào thẳng buổi luyện tập không xao nhãng từ danh sách đang lọc — hẹn giờ <code>30s / 60s / 2m / 5m</code>, số lượng <code>5 / 10 / 20 / Không giới hạn</code>, âm báo tùy chọn, lật ngang / lưới / đen trắng / đổi độ sâu và bảng tổng kết có thể nhấn xem lại.
+ Vào thẳng buổi luyện tập không xao nhãng từ danh sách đang lọc — hẹn giờ <code>30s / 60s / 2m / 5m</code>, số lượng <code>5 / 10 / 20 / Không giới hạn</code>, âm báo tùy chọn, lật ngang / lưới / sắc độ 3 bậc / bóng dáng / đổi độ sâu và bảng tổng kết có thể nhấn xem lại.
</td>
- </tr>
- <tr>
<td width="50%" valign="top">
<b>Lịch sử cục bộ & Truy vết ảnh tham chiếu</b><br>
Toàn bộ ảnh tạo ra được lưu trong IndexedDB của trình duyệt, hỗ trợ lọc theo chế độ (Thử đồ / Tạo ảnh), tìm prompt hoặc mô hình, xem lại dải ảnh tham chiếu đã dùng trong trình xem lớn, tải đơn lẻ hoặc xuất ZIP hàng loạt.
</td>
+ </tr>
+ <tr>
<td width="50%" valign="top">
<b>Bảng lệnh toàn cục (⌘K) & Bộ chọn nhanh</b><br>
- Nhấn <code>⌘K</code> / <code>Ctrl+K</code> ở bất kỳ đâu để nhảy nhanh tới 12 thư viện, tìm kiếm, mở luyện ký họa hay đổi giao diện; bộ chọn trong Studio có lọc danh mục, «Chỉ xem yêu thích» và kéo-thả tải ảnh nhân vật/trang phục.
+ Nhấn <code>⌘K</code> / <code>Ctrl+K</code> ở bất kỳ đâu để mở 12 thư viện, công cụ bảng vẽ vô hạn, Công thức, So sánh song song, Luyện ký họa hay đổi giao diện; bộ chọn có lọc danh mục, «Chỉ xem yêu thích» và kéo-thả tải ảnh.
+ </td>
+ <td width="50%" valign="top">
+ <b>Giao diện 5 ngôn ngữ × Riêng tư cục bộ</b><br>
+ Hỗ trợ chuyển đổi Tiếng Trung, Tiếng Anh, Tiếng Nhật, Tiếng Việt và Tiếng Thổ Nhĩ Kỳ (độc lập với ngôn ngữ prompt); yêu thích, công thức, bố cục bảng vẽ và API Key chỉ lưu trên trình duyệt của bạn.
</td>
</tr>
</table>
@@ -104,7 +118,7 @@ Mỗi tư thế đều có cặp **phác thảo nét vẽ** và **bản đồ đ
| Nhóm | Thư viện | Số lượng | Điểm nổi bật |
| :--- | :--- | :---: | :--- |
-| **Tư thế** | Tư thế · Tư thế độ sâu | `288` × 2 | Phác thảo và bản đồ độ sâu đi theo cặp đúng góc chụp, lật tại chỗ & kéo màn so sánh |
+| **Tư thế** | Tư thế · Tư thế độ sâu | `288` × 2 | Phác thảo và bản đồ độ sâu đi theo cặp đúng góc chụp, lật tại chỗ, so sánh song song & kéo màn |
| **Nhân vật** | Chân dung · Biểu cảm · Kiểu tóc | `1.499` / `95` / `122` | Chân dung hư cấu CC0, biểu cảm ICT-FaceKit phân cấp cường độ, nhiều biến thể màu tóc |
| **Trang phục** | Trang phục · Trang phục anime · Cổ phục | `1.407` / `1.760` / `57` | Lọc theo ô màu và món đồ, bao phủ trang phục đời thường, anime và trang phục cổ đại |
| **Bối cảnh & Vật dụng** | Bối cảnh · Ánh sáng · Đạo cụ · Nội thất | `64` / `50` / `32` / `41` | Đa góc nhìn, hoàn thiện không gian, nguồn sáng, đạo cụ cầm tay và bày trí |
@@ -115,8 +129,8 @@ Mỗi tư thế đều có cặp **phác thảo nét vẽ** và **bản đồ đ
| Cách dùng | Phù hợp khi | Cơ chế hoạt động |
| :--- | :--- | :--- |
-| **API Key đám mây** | Muốn dùng ngay các mô hình chỉnh sửa đa ảnh mạnh nhất | Hỗ trợ OpenAI, Gemini, Seedream hoặc bất kỳ relay tương thích OpenAI / Gemini / xAI nào. Gửi trực tiếp từ trình duyệt hoặc qua proxy của trang (relay tùy chỉnh hỗ trợ `http`/`https` và mọi cổng). |
-| **Engine cục bộ** | Ưu tiên riêng tư tuyệt đối, không tốn phí API | Kết nối trực tiếp **ComfyUI** hoặc **stable-diffusion.cpp** (`sd-server`) chạy trên máy của bạn — ảnh không rời khỏi thiết bị. Hỗ trợ workflow đơn ảnh dựng sẵn và workflow ComfyUI đa ảnh tùy chỉnh. [Hướng dẫn thiết lập →](docs/local-engines.md) |
+| **API Key đám mây** | Muốn dùng ngay các mô hình đa ảnh 2026 mới nhất | Hỗ trợ OpenAI (`gpt-image-2.5` / `1`), Gemini (`gemini-nano-banana-2.1` / `3.1`), Seedream `5.5 / 5.0` cùng **5 cài đặt sẵn trung chuyển** (xAI Grok, FLUX.2, Qwen-Image, Gemini Relay, Cổng cục bộ). Gửi trực tiếp hoặc qua proxy (`http`/`https`, mọi cổng). |
+| **Engine cục bộ** | Ưu tiên riêng tư tuyệt đối, không tốn phí API | Kết nối trực tiếp **ComfyUI** hoặc **stable-diffusion.cpp** (`sd-server`) trên máy bạn. Đi kèm mẫu workflow img2img, **ControlNet Depth** và **Qwen-Image-Edit 3 ảnh tham chiếu**. [Hướng dẫn thiết lập →](docs/local-engines.md) |
| **AI Agent (MCP)** | Giao cho Codex / Claude tự tìm ảnh tham chiếu | Kèm máy chủ MCP stdio chỉ đọc và Skill chọn ảnh để agent tự tra cứu 12 thư viện, chọn đúng góc chụp và lắp prompt kèm đường dẫn ảnh. [Tài liệu MCP →](mcp/README.md) |
```sh
@@ -142,7 +156,7 @@ npm start
Mở `http://127.0.0.1:8787/`. Duyệt thư viện, lưu yêu thích và sao chép prompt đều không cần tài khoản hay API Key; danh mục công khai được nạp ở lần mở đầu và hình ảnh tải theo nhu cầu.
- **Không tài khoản**: không đăng ký, không theo dõi phía máy chủ
-- **Lưu hoàn toàn trên máy**: yêu thích, cài đặt và API Key chỉ nằm trong `localStorage`; lịch sử tạo ảnh nằm trong IndexedDB
+- **Lưu hoàn toàn trên máy**: yêu thích, công thức, bố cục bảng vẽ, cài đặt và API Key chỉ nằm trong `localStorage`; lịch sử tạo ảnh nằm trong IndexedDB
- **Xóa sạch tức thì**: xóa dữ liệu trang web trên trình duyệt là dọn hết mọi trạng thái cục bộ
<details>
@@ -150,17 +164,17 @@ Mở `http://127.0.0.1:8787/`. Duyệt thư viện, lưu yêu thích và sao ch
| Phím | Chức năng |
| :---: | :--- |
-| `⌘K` / `Ctrl+K` | Mở bảng lệnh toàn cục (chuyển thư viện, tìm kiếm, luyện ký họa, cài đặt) |
+| `⌘K` / `Ctrl+K` | Mở bảng lệnh toàn cục (thư viện, bảng vẽ vô hạn, công thức, so sánh, ký họa, cài đặt) |
| `/` | Đưa con trỏ vào ô tìm kiếm |
| `R` | Chọn ngẫu nhiên một tư liệu |
| `T` | Chuyển giao diện sáng / tối (dùng được cả trong thư viện và trình xem lớn) |
| `L` | Đổi ngôn ngữ mô tả tư liệu (Trung / Anh) |
| `1` – `9` | Nhảy nhanh giữa các thư viện |
| `←` `→` / `↑` `↓` | Trình xem lớn: chuyển mục trước / sau, đổi góc chụp |
-| `Z` / `H` / `G` / `B` / `V` | Trình xem lớn: phóng 2× / lật ngang / lưới bố cục / sắc độ xám / so sánh phác thảo & độ sâu |
-| `Space` | Luyện ký họa: tạm dừng / tiếp tục đồng hồ |
+| `Z` / `H` / `G` / `B` / `U` / `V` | Trình xem / So sánh: phóng 2× / lật ngang / lưới / đen trắng & 3 bậc / bóng dáng / so sánh độ sâu |
+| `0` / `Space` + kéo | Bảng vẽ vô hạn: vừa khung nhìn / di chuyển bảng (`Space` tạm dừng/tiếp tục trong ký họa) |
| `F` / `A` / `C` / `S` | Trình xem lớn: yêu thích / thêm vào bộ / sao chép prompt / sao chép liên kết chia sẻ |
-| `Esc` | Đóng trình xem lớn, luyện ký họa, bảng lệnh hoặc hộp thoại |
+| `Esc` | Đóng trình xem lớn, so sánh, công thức, ký họa, bảng lệnh hoặc thoát chế độ tập trung |
</details>
@@ -168,17 +182,17 @@ Mở `http://127.0.0.1:8787/`. Duyệt thư viện, lưu yêu thích và sao ch
## Phát triển & Kiểm thử
-Kiến trúc thuần tĩnh: **JS thuần + kịch bản dựng Python + Cloudflare Pages** (không framework, không bundler). Giao diện hỗ trợ bốn ngôn ngữ: Tiếng Trung giản thể, Tiếng Anh, Tiếng Nhật và Tiếng Việt. Xem [AGENTS.md](AGENTS.md) để biết chi tiết dựng bản phát hành và triển khai.
+Kiến trúc thuần tĩnh: **JS thuần + kịch bản dựng Python + Cloudflare Pages** (không framework, không bundler). Giao diện hỗ trợ năm ngôn ngữ: Tiếng Trung giản thể, Tiếng Anh, Tiếng Nhật, Tiếng Việt và Tiếng Thổ Nhĩ Kỳ. Xem [AGENTS.md](AGENTS.md) để biết chi tiết dựng bản phát hành và triển khai.
```sh
-# Bộ kiểm thử hồi quy ngoại tuyến (không cần kho ảnh gốc)
+# Bộ kiểm thử hồi quy ngoại tuyến (14 bộ — không cần kho ảnh gốc)
npm run test:offline
# Bộ kiểm thử toàn trang (chạy cùng bản xem trước cục bộ hoặc staging)
npm test
```
-Phiên bản hiện tại **v1.4.0** (2026-11-25) · [Xem toàn bộ nhật ký thay đổi](CHANGELOG.md)
+Phiên bản hiện tại **v1.5.0** (2026-11-28) · [Xem toàn bộ nhật ký thay đổi](CHANGELOG.md)
---
diff --git a/docs/comfyui/depth-controlnet-api.json b/docs/comfyui/depth-controlnet-api.json
new file mode 100644
index 0000000..160a03e
--- /dev/null
+++ b/docs/comfyui/depth-controlnet-api.json
@@ -0,0 +1,12 @@
+{
+ "1": {"class_type":"CheckpointLoaderSimple","inputs":{"ckpt_name":"YOUR_SDXL_OR_SD15_CHECKPOINT.safetensors"}},
+ "2": {"class_type":"ControlNetLoader","inputs":{"control_net_name":"YOUR_DEPTH_CONTROLNET.safetensors"}},
+ "3": {"class_type":"LoadImage","_meta":{"title":"PoseWear Image 1"},"inputs":{"image":"depth_pose.jpg"}},
+ "4": {"class_type":"CLIPTextEncode","_meta":{"title":"PoseWear Prompt"},"inputs":{"text":"","clip":["1",1]}},
+ "5": {"class_type":"CLIPTextEncode","inputs":{"text":"malformed hands, extra fingers, distorted anatomy, blurry, watermark, text, low quality","clip":["1",1]}},
+ "6": {"class_type":"ControlNetApplyAdvanced","inputs":{"strength":0.85,"start_percent":0.0,"end_percent":0.85,"positive":["4",0],"negative":["5",0],"control_net":["2",0],"image":["3",0],"vae":["1",2]}},
+ "7": {"class_type":"EmptyLatentImage","_meta":{"title":"PoseWear Size"},"inputs":{"width":1024,"height":1536,"batch_size":1}},
+ "8": {"class_type":"KSampler","_meta":{"title":"PoseWear Seed"},"inputs":{"seed":1,"steps":24,"cfg":6.5,"sampler_name":"dpmpp_2m","scheduler":"karras","denoise":1.0,"model":["1",0],"positive":["6",0],"negative":["6",1],"latent_image":["7",0]}},
+ "9": {"class_type":"VAEDecode","inputs":{"samples":["8",0],"vae":["1",2]}},
+ "10": {"class_type":"SaveImage","_meta":{"title":"PoseWear Output"},"inputs":{"filename_prefix":"PoseWear_Depth","images":["9",0]}}
+}
diff --git a/docs/comfyui/multi-ref-qwen-edit-api.json b/docs/comfyui/multi-ref-qwen-edit-api.json
new file mode 100644
index 0000000..07792e5
--- /dev/null
+++ b/docs/comfyui/multi-ref-qwen-edit-api.json
@@ -0,0 +1,15 @@
+{
+ "1": {"class_type":"UNETLoader","inputs":{"unet_name":"qwen_image_edit_2509_fp8_e4m3fn.safetensors","weight_dtype":"default"}},
+ "2": {"class_type":"CLIPLoader","inputs":{"clip_name":"qwen_2.5_vl_7b_fp8_scaled.safetensors","type":"qwen_image","device":"default"}},
+ "3": {"class_type":"VAELoader","inputs":{"vae_name":"qwen_image_vae.safetensors"}},
+ "4": {"class_type":"ModelSamplingAuraFlow","inputs":{"shift":3.0,"model":["1",0]}},
+ "5": {"class_type":"LoadImage","_meta":{"title":"PoseWear Image 1"},"inputs":{"image":"person.jpg"}},
+ "6": {"class_type":"LoadImage","_meta":{"title":"PoseWear Image 2"},"inputs":{"image":"garment.jpg"}},
+ "7": {"class_type":"LoadImage","_meta":{"title":"PoseWear Image 3"},"inputs":{"image":"pose.jpg"}},
+ "8": {"class_type":"TextEncodeQwenImageEditPlus","_meta":{"title":"PoseWear Prompt"},"inputs":{"prompt":"","clip":["2",0],"vae":["3",0],"image1":["5",0],"image2":["6",0],"image3":["7",0]}},
+ "9": {"class_type":"TextEncodeQwenImageEditPlus","inputs":{"prompt":"","clip":["2",0],"vae":["3",0],"image1":["5",0],"image2":["6",0],"image3":["7",0]}},
+ "10": {"class_type":"EmptySD3LatentImage","_meta":{"title":"PoseWear Size"},"inputs":{"width":1024,"height":1536,"batch_size":1}},
+ "11": {"class_type":"KSampler","_meta":{"title":"PoseWear Seed"},"inputs":{"seed":1,"steps":20,"cfg":4.0,"sampler_name":"euler","scheduler":"simple","denoise":1.0,"model":["4",0],"positive":["8",0],"negative":["9",0],"latent_image":["10",0]}},
+ "12": {"class_type":"VAEDecode","inputs":{"samples":["11",0],"vae":["3",0]}},
+ "13": {"class_type":"SaveImage","_meta":{"title":"PoseWear Output"},"inputs":{"filename_prefix":"PoseWear_MultiRef","images":["12",0]}}
+}
diff --git a/docs/compare-en.jpg b/docs/compare-en.jpg
new file mode 100644
index 0000000..4c9f554
Binary files /dev/null and b/docs/compare-en.jpg differ
diff --git a/docs/compare-ja.jpg b/docs/compare-ja.jpg
new file mode 100644
index 0000000..14827ed
Binary files /dev/null and b/docs/compare-ja.jpg differ
diff --git a/docs/compare.jpg b/docs/compare.jpg
new file mode 100644
index 0000000..ab56ece
Binary files /dev/null and b/docs/compare.jpg differ
diff --git a/docs/local-engines.md b/docs/local-engines.md
index 398993e..c241094 100644
--- a/docs/local-engines.md
+++ b/docs/local-engines.md
@@ -10,9 +10,17 @@
自带工作流加载你在界面上选定的 checkpoint,使用一张参考图。画幅选「自动」会沿用参考图比例,手动选比例会居中裁切到对应画幅。[查看工作流](comfyui/img2img-api.json)
-### 自定义多参考图工作流
+### 附带与自定义多参考图工作流
-若要同时使用人物、服装与姿势,请在 ComfyUI 中连接自己的多图工作流,按下表设置节点标题,导出为 API 格式的 JSON,再重新启动 PoseWear。
+仓库在 `docs/comfyui/` 下提供了三份可直接修改模型文件名后使用的 API 模板:
+
+| 模板文件 | 参考图数量 | 适用场景 |
+| --- | --- | --- |
+| [`img2img-api.json`](comfyui/img2img-api.json) | 1 张 | 默认图生图预设(支持自动或指定画幅)。 |
+| [`depth-controlnet-api.json`](comfyui/depth-controlnet-api.json) | 1 张 | 搭配衣姿**深度姿势库**使用 ControlNet Depth 控图,核显或中小显存也更稳。 |
+| [`multi-ref-qwen-edit-api.json`](comfyui/multi-ref-qwen-edit-api.json) | 3 张 | 人物 + 服装 + 姿势三图联动,基于 ComfyUI 原生 `TextEncodeQwenImageEditPlus`(Qwen-Image-Edit 2509 / 2511)。 |
+
+若要使用上述模板或自己的多图工作流,请替换模板中的模型文件名(或按下表在 ComfyUI 中设置节点标题并导出 API JSON),再重新启动 PoseWear:
```sh
POSEWEAR_LOCAL_ENGINE=comfyui \
@@ -22,7 +30,7 @@ npm start
| 节点标题 | 工作台如何使用 |
| --- | --- |
-| `PoseWear Prompt` | 把最终提示词写入该节点的 `text` 输入。 |
+| `PoseWear Prompt` | 把最终提示词写入该节点的 `text`(如 `CLIPTextEncode`)或 `prompt`(如 `TextEncodeQwenImageEditPlus`)输入。 |
| `PoseWear Image 1`、`PoseWear Image 2` … | 按顺序绑定到 `LoadImage` 节点。输入顺序为人物、服装、姿势、表情、其他素材。节点数量须匹配本次生成实际传入的图片数量。 |
| `PoseWear Output` | 从这个输出节点读取一张生成图片。 |
| `PoseWear Size`(可选) | 选择指定画幅时写入 `width` 和 `height`。自动画幅使用工作流本身的尺寸设置。 |
diff --git a/docs/studio-en.jpg b/docs/studio-en.jpg
index 606cf82..486b038 100644
Binary files a/docs/studio-en.jpg and b/docs/studio-en.jpg differ
diff --git a/docs/studio-ja.jpg b/docs/studio-ja.jpg
index f657b8d..626b234 100644
Binary files a/docs/studio-ja.jpg and b/docs/studio-ja.jpg differ
diff --git a/docs/studio.jpg b/docs/studio.jpg
index a1a45a5..aceb53d 100644
Binary files a/docs/studio.jpg and b/docs/studio.jpg differ
diff --git a/post.py b/post.py
index ea7f4b5..1f8f004 100644
--- a/post.py
+++ b/post.py
@@ -20,10 +20,13 @@ CLIENT_FILES = [
'app.js',
'sketch.js',
'command-palette.js',
+ 'compare.js',
'zip.js',
'extras.js',
'image-providers.js',
'board-export.js',
+ 'recipes.js',
+ 'canvas.js',
'studio.js',
'history.js',
]
diff --git a/scripts/local-engine.mjs b/scripts/local-engine.mjs
index b134c25..65f3491 100644
--- a/scripts/local-engine.mjs
+++ b/scripts/local-engine.mjs
@@ -20,13 +20,18 @@ async function upstream(engine, path, signal, init = {}) {
if (!res.ok) throw Error('Local engine HTTP '+res.status+' · '+(await res.text()).slice(0,600));
return res;
}
+function promptField(node) {
+ if (typeof node.inputs?.text === 'string') return 'text';
+ if (typeof node.inputs?.prompt === 'string') return 'prompt';
+ return null;
+}
function workflowSlots(graph, count) {
const nodes = Object.entries(graph);
const prompts = nodes.filter(([,n]) => n._meta?.title === 'PoseWear Prompt').map(([,n]) => n);
const images = nodes.filter(([,n]) => /^PoseWear Image \d+$/.test(n._meta?.title))
.map(([,n]) => ({node:n,index:Number(n._meta.title.split(' ').at(-1))})).sort((a,b)=>a.index-b.index);
const outputs = nodes.filter(([,n])=>n._meta?.title==='PoseWear Output');
- if (!prompts.length || prompts.some(n=>typeof n.inputs?.text!=='string') || outputs.length!==1)
+ if (!prompts.length || prompts.some(n=>!promptField(n)) || outputs.length!==1)
throw Error('The workflow needs a text node named PoseWear Prompt and one image output named PoseWear Output.');
if (images.length!==count || images.some((it,i)=>it.index!==i+1 || it.node.class_type!=='LoadImage'))
throw Error(`Workflow expects ${images.length} numbered LoadImage reference(s); selection has ${count}.`);
@@ -36,7 +41,7 @@ async function comfyImage(engine, form, signal) {
const graph = JSON.parse(await readFile(engine.workflow,'utf8'));
const refs = form.getAll('image[]'), slots = workflowSlots(graph,refs.length);
if (engine.preset) graph['1'].inputs.ckpt_name = form.get('checkpoint');
- for (const node of slots.prompts) node.inputs.text=form.get('prompt');
+ for (const node of slots.prompts) node.inputs[promptField(node)]=form.get('prompt');
if (form.has('size')) {
const [width,height]=form.get('size').split('x').map(Number);
if (engine.preset) {
diff --git a/src/app.js b/src/app.js
index 8740ce4..6271085 100644
--- a/src/app.js
+++ b/src/app.js
@@ -797,6 +797,7 @@
if (!trayOpen) return;
$('#tgEmpty').hidden = n > 0;
+ if ($('#trayCmp')) $('#trayCmp').hidden = n < 2;
$('#trayClear').hidden = !n;
$('#trayComboBox').hidden = !n;
$('#trayN').textContent = n ? String(n) : '';
@@ -883,6 +884,7 @@
},
});
};
+ if ($('#trayCmp')) $('#trayCmp').onclick = () => window.PoseWearCompare?.open(visibleSelection());
$('#trayClear').onclick = () => {
const prev = st.sel;
st.sel = [];
@@ -1654,7 +1656,7 @@
let lbVariant = null;
let lbVisitedPair = false;
const previewItem = () => lbVariant || st.list[li];
- const lbV = { zoom: 1, x: 0, y: 0, flip: false, grid: 0, gray: false, cmp: false };
+ const lbV = { zoom: 1, x: 0, y: 0, flip: false, grid: 0, gray: 0, sil: false, cmp: false };
function lbApplyView() {
const stage = $('#lbStage');
@@ -1666,7 +1668,9 @@
const zoomed = lbV.zoom > 1;
stage.classList.toggle('zoomed', zoomed);
stage.classList.toggle('flipped', lbV.flip);
- stage.classList.toggle('gray', lbV.gray);
+ stage.classList.toggle('gray', lbV.gray > 0);
+ stage.classList.toggle('notan', lbV.gray === 2);
+ stage.classList.toggle('sil', lbV.sil);
stage.classList.toggle('comparing', lbV.cmp);
stage.style.setProperty('--lb-tx', zoomed ? lbV.x + 'px' : '0px');
stage.style.setProperty('--lb-ty', zoomed ? lbV.y + 'px' : '0px');
@@ -1691,8 +1695,11 @@
setBtn('zoom', zoomed);
setBtn('flip', lbV.flip);
setBtn('grid', lbV.grid > 0);
- setBtn('gray', lbV.gray);
+ setBtn('gray', lbV.gray > 0);
+ setBtn('sil', lbV.sil);
setBtn('cmp', lbV.cmp);
+ const grayLabel = tools.querySelector('[data-lt="gray"] span');
+ if (grayLabel) grayLabel.textContent = lbV.gray === 2 ? '明度块面' : '灰度';
}
}
@@ -1702,7 +1709,8 @@
lbV.y = 0;
lbV.flip = false;
lbV.grid = 0;
- lbV.gray = false;
+ lbV.gray = 0;
+ lbV.sil = false;
lbV.cmp = false;
const stage = $('#lbStage');
const rng = $('#lbPairRange');
@@ -1726,7 +1734,7 @@
const mono = it && (it.type === 'pose' || it.type === 'depth');
if (grayBtn) grayBtn.hidden = !!mono;
if (mono && lbV.gray) {
- lbV.gray = false;
+ lbV.gray = 0;
lbApplyView();
}
if (cmpBtn) cmpBtn.hidden = !mate;
@@ -1761,7 +1769,11 @@
lbV.grid = (lbV.grid + 1) % 3;
} else if (action === 'gray') {
if (it.type === 'pose' || it.type === 'depth') return;
- lbV.gray = !lbV.gray;
+ lbV.sil = false;
+ lbV.gray = (lbV.gray + 1) % 3;
+ } else if (action === 'sil') {
+ lbV.sil = !lbV.sil;
+ if (lbV.sil) lbV.gray = 0;
} else if (action === 'cmp') {
const mate = poseCounterpart(it);
if (!mate) return;
@@ -2020,7 +2032,7 @@
`<div class="mact"><button data-x="fav" class="${isFav ? 'on' : ''}" aria-label="${isFav ? '取消收藏' : '收藏'}">${isFav ? '♥' : '♡'}</button><button data-x="share">分享</button>${isDepth ? '' : `<button data-x="try" class="pri">${tryLabel(it)}</button>`}</div>` +
`<div class="acts"><button data-x="fav">${isFav ? '♥ 已收藏' : '♡ 收藏'}</button><button data-x="sel" class="${isSel ? '' : 'pri'}">${isSel ? '✓ 已在组合中' : '+ 加入组合'}</button>${isDepth ? '' : `<button data-x="try">${tryLabel(it)}</button>`}<button data-x="share">分享链接</button>${downloadActs}</div>` +
`<div id="lbSim"></div>` +
- `<p class="mu lb-keys"><kbd>←</kbd><kbd>→</kbd>切换 ${hasAng ? '<kbd>↑</kbd><kbd>↓</kbd>角度 ' : ''}<kbd>Z</kbd>缩放 <kbd>H</kbd>镜像 <kbd>G</kbd>参考线 ${isPose || isDepth ? '<kbd>V</kbd>对比 ' : '<kbd>B</kbd>灰度 '}<kbd>F</kbd>收藏 <kbd>A</kbd>组合 <kbd>C</kbd>复制 <kbd>S</kbd>分享</p>` +
+ `<p class="mu lb-keys"><kbd>←</kbd><kbd>→</kbd>切换 ${hasAng ? '<kbd>↑</kbd><kbd>↓</kbd>角度 ' : ''}<kbd>Z</kbd>缩放 <kbd>H</kbd>镜像 <kbd>G</kbd>参考线 ${isPose || isDepth ? '<kbd>V</kbd>对比 ' : '<kbd>B</kbd>明度 '}<kbd>U</kbd>剪影 <kbd>F</kbd>收藏 <kbd>A</kbd>组合 <kbd>C</kbd>复制 <kbd>S</kbd>分享</p>` +
sourceCredit;
if (isPose || isDepth) drawPosePair(it, $('#lbPair'));
@@ -2106,11 +2118,12 @@
}
if (window.PoseWearCommandPalette?.handleKey(e)) return;
if (window.PoseWearSketch?.handleKey(e)) return;
+ if (window.PoseWearCompare?.handleKey(e)) return;
if (e.ctrlKey || e.metaKey || e.altKey || e.target.closest?.('.shell-menu[open]')) return;
const ae = document.activeElement;
const inInput = ae && /^(INPUT|SELECT|TEXTAREA)$/.test(ae.tagName);
- if (!$('#cfg').hidden || !$('#pk').hidden) return;
+ if (!$('#cfg').hidden || !$('#pk').hidden || !$('#recipeBox')?.hidden) return;
const modal = $('#ageBox:not([hidden]),#privBox:not([hidden]),#helpBox:not([hidden]),#tgView:not([hidden])');
if (modal) {
@@ -2167,6 +2180,7 @@
else if (k === 'h') lbToggleTool('flip');
else if (k === 'g') lbToggleTool('grid');
else if (k === 'b') lbToggleTool('gray');
+ else if (k === 'u') lbToggleTool('sil');
else if (k === 'v') lbToggleTool('cmp');
else if (k === 't') window.PoseWearTheme.toggle();
else if (k === 'f') toggleFav(it.k);
@@ -2338,6 +2352,8 @@
sketchClose: () => window.PoseWearSketch?.close(),
cmdOpen: () => window.PoseWearCommandPalette?.open(),
cmdClose: () => window.PoseWearCommandPalette?.close(),
+ compareOpen: items => window.PoseWearCompare?.open(items),
+ compareClose: () => window.PoseWearCompare?.close(),
openItem: (type, id) => setTab(type, id),
applySearch,
isTrayOpen: () => trayOpen,
diff --git a/src/canvas.js b/src/canvas.js
new file mode 100644
index 0000000..a3d30c0
--- /dev/null
+++ b/src/canvas.js
@@ -0,0 +1,998 @@
+'use strict';
+(() => {
+ // Infinite Spatial Canvas Studio (#wbStage -> window.PoseWearCanvas).
+ // Turns the center reference board into a pannable, zoomable spatial desk with
+ // draggable/resizable reference cards, live-prompt art-direction sticky notes,
+ // semantic Bezier flow wires, spatial output hub, pinned generation results, and Zen Focus mode.
+ const C = window.PoseWearCatalog;
+ if (!C) return;
+ const { $, $$, esc, readLS: LS, writeLS: SV } = C;
+
+ const STORAGE_KEY = 'wbCanvas';
+ const MIN_SCALE = 0.35;
+ const MAX_SCALE = 2.4;
+ const MIN_CARD_W = 132;
+ const MAX_CARD_W = 340;
+ const DEFAULT_CARD_W = 166;
+ const HUB_W = 216;
+ const NOTE_W = 168;
+
+ let api = null; // Wired from studio.js via init(studioApi)
+ let refsList = []; // [{ id, slot, slotIdx, type, material, ref, item, label, src, angle, roleLabel }]
+ let resultsList = []; // [{ index, url, prov, model, label, hasBefore }]
+ let isSample = true;
+ let compactMode = false;
+ let zTop = 10;
+ let wireRaf = 0;
+ let suppressClickUntil = 0;
+ let spaceHeld = false;
+ let zenMode = false;
+ let lastRefSig = '';
+ let userCamera = false;
+
+ const saved = LS(STORAGE_KEY) || {};
+ const state = {
+ tx: Number.isFinite(saved.tx) ? saved.tx : 0,
+ ty: Number.isFinite(saved.ty) ? saved.ty : 0,
+ scale: Number.isFinite(saved.scale) ? clamp(saved.scale, MIN_SCALE, MAX_SCALE) : 1,
+ showWires: saved.showWires !== false,
+ nodes: saved.nodes && typeof saved.nodes === 'object' ? { ...saved.nodes } : {},
+ hub: saved.hub && Number.isFinite(saved.hub.x) && Number.isFinite(saved.hub.y) ? { ...saved.hub } : null,
+ notes: Array.isArray(saved.notes)
+ ? saved.notes
+ .filter(n => n && typeof n.id === 'string')
+ .slice(0, 16)
+ .map(n => ({
+ id: n.id,
+ text: typeof n.text === 'string' ? n.text : '',
+ x: Number.isFinite(n.x) ? n.x : 168,
+ y: Number.isFinite(n.y) ? n.y : 196,
+ linked: n.linked !== false,
+ }))
+ : [],
+ };
+
+ function clamp(v, lo, hi) {
+ return Math.min(hi, Math.max(lo, v));
+ }
+
+ function snap(v) {
+ return Math.round(v / 8) * 8;
+ }
+
+ let saveTimer = null;
+ function persist() {
+ clearTimeout(saveTimer);
+ saveTimer = setTimeout(() => {
+ SV(STORAGE_KEY, {
+ tx: Math.round(state.tx),
+ ty: Math.round(state.ty),
+ scale: Math.round(state.scale * 1000) / 1000,
+ showWires: state.showWires,
+ nodes: state.nodes,
+ hub: state.hub,
+ notes: state.notes,
+ });
+ }, 180);
+ }
+
+ function vpMetrics() {
+ const vp = $('#wbCanvasVp');
+ if (!vp) return { w: 720, h: 640 };
+ const r = vp.getBoundingClientRect();
+ return { w: r.width || 720, h: r.height || 640 };
+ }
+
+ function isCompactViewport() {
+ const { w } = vpMetrics();
+ return window.innerWidth <= 560 || (w > 0 && w < 460);
+ }
+
+ function applyCamera() {
+ const world = $('#wbCanvasWorld');
+ const stage = $('#wbStage');
+ const pct = $('#wbZoomPct');
+ if (pct) pct.textContent = Math.round(state.scale * 100) + '%';
+ if (!world || !stage) return;
+
+ if (compactMode) {
+ world.style.transform = '';
+ stage.style.removeProperty('--cv-x');
+ stage.style.removeProperty('--cv-y');
+ stage.style.removeProperty('--cv-step');
+ return;
+ }
+
+ const { w, h } = vpMetrics();
+ const ox = w / 2 + state.tx;
+ const oy = h / 2 + state.ty;
+ world.style.transform = `translate3d(${ox}px, ${oy}px, 0) scale(${state.scale})`;
+
+ const step = Math.max(10, Math.min(44, 18 * state.scale));
+ stage.style.setProperty('--cv-x', `${ox % step}px`);
+ stage.style.setProperty('--cv-y', `${oy % step}px`);
+ stage.style.setProperty('--cv-step', `${step}px`);
+ }
+
+ function defaultRefPos(idx, total, sample) {
+ if (sample) {
+ const spread = total <= 1 ? 0 : 210;
+ const start = -((total - 1) * spread) / 2;
+ return { x: start + idx * spread, y: -26, w: 186 };
+ }
+ if (total === 1) return { x: -164, y: -8, w: 182 };
+ if (total === 2) return { x: -244 + idx * 176, y: idx === 0 ? -18 : 18, w: 162 };
+ if (total === 3) {
+ const slots = [
+ { x: -254, y: -124, w: 156 },
+ { x: -78, y: -124, w: 156 },
+ { x: -254, y: 128, w: 156 },
+ ];
+ return slots[idx];
+ }
+ const cols = total >= 7 ? 3 : 2;
+ const col = idx % cols;
+ const row = Math.floor(idx / cols);
+ const rows = Math.ceil(total / cols);
+ const colStep = 176;
+ const rowStep = 256;
+ const yStart = -((rows - 1) * rowStep) / 2;
+ return { x: -94 - (cols - 1 - col) * colStep, y: yStart + row * rowStep, w: 152 };
+ }
+
+ function defaultHubPos(total) {
+ if (total <= 1) return { x: 162, y: -6 };
+ if (total <= 3) return { x: 176, y: -4 };
+ return { x: 188, y: -6 };
+ }
+
+ function defaultNotePos(idx) {
+ const hub = state.hub || defaultHubPos(refsList.length);
+ if (idx === 0 && refsList.length === 3) return { x: -78, y: 128 };
+ if (idx === 0 && refsList.length === 1) return { x: -164, y: 184 };
+ return {
+ x: hub.x + (idx % 2) * 224,
+ y: hub.y + 258 + Math.floor(idx / 2) * 144,
+ };
+ }
+
+ function collides(ax, ay, aw, bx, by, bw) {
+ const ah = Math.round(aw * 1.48);
+ const bh = Math.round(bw * 1.48);
+ return Math.abs(ax - bx) < (aw + bw) / 2 + 14 && Math.abs(ay - by) < (ah + bh) / 2 + 14;
+ }
+
+ function placeWithoutOverlap(x, y, w, placed) {
+ let cx = x;
+ let cy = y;
+ for (let tries = 0; tries < 24; tries++) {
+ if (!placed.some(p => collides(cx, cy, w, p.x, p.y, p.w))) return { x: cx, y: cy };
+ cy += 256;
+ if (tries % 4 === 3) {
+ cy = y;
+ cx -= 176;
+ }
+ }
+ return { x: cx, y: cy };
+ }
+
+ function ensurePositions(forceReset = false) {
+ const refSig = isSample ? 'sample:' + refsList.length : refsList.map(r => r.id).join('|');
+ const listChanged = forceReset || refSig !== lastRefSig;
+ lastRefSig = refSig;
+
+ if (forceReset) {
+ state.nodes = {};
+ state.hub = null;
+ }
+ const activeIds = new Set(refsList.map(r => r.id));
+ for (const id of Object.keys(state.nodes)) {
+ if (!activeIds.has(id) && !isSample) delete state.nodes[id];
+ }
+
+ if (!isSample) {
+ const placed = [];
+ refsList.forEach(entry => {
+ const cur = state.nodes[entry.id];
+ if (cur && cur.pinned) placed.push({ x: cur.x, y: cur.y, w: cur.w || DEFAULT_CARD_W });
+ });
+ refsList.forEach((entry, idx) => {
+ const cur = state.nodes[entry.id];
+ if (!cur || (!cur.pinned && listChanged)) {
+ const def = defaultRefPos(idx, refsList.length, false);
+ const pos = placeWithoutOverlap(def.x, def.y, def.w, placed);
+ state.nodes[entry.id] = {
+ x: pos.x,
+ y: pos.y,
+ w: def.w,
+ flip: cur ? !!cur.flip : false,
+ pinned: false,
+ z: cur?.z || ++zTop,
+ };
+ placed.push({ x: pos.x, y: pos.y, w: def.w });
+ } else if (!cur.pinned) {
+ placed.push({ x: cur.x, y: cur.y, w: cur.w || DEFAULT_CARD_W });
+ }
+ });
+ }
+
+ if (!state.hub || (!state.hub.pinned && listChanged)) {
+ const defHub = defaultHubPos(refsList.length);
+ state.hub = { x: defHub.x, y: defHub.y, pinned: false };
+ }
+ if (forceReset) {
+ state.notes.forEach((n, i) => {
+ const p = defaultNotePos(i);
+ n.x = p.x;
+ n.y = p.y;
+ });
+ }
+ return listChanged;
+ }
+
+ function ratioDims(ar) {
+ const map = {
+ auto: [3, 4],
+ '2:3': [2, 3],
+ '3:4': [3, 4],
+ '9:16': [9, 16],
+ '1:1': [1, 1],
+ '4:3': [4, 3],
+ '16:9': [16, 9],
+ };
+ const [rw, rh] = map[ar] || [3, 4];
+ const maxW = HUB_W - 24;
+ const maxH = 196;
+ const scale = Math.min(maxW / rw, maxH / rh);
+ return { w: Math.round(rw * scale), h: Math.round(rh * scale) };
+ }
+
+ function cardNodeEl(id) {
+ return $(`#wbBoardCards .board-card[data-nid="${CSS.escape(id)}"]`);
+ }
+
+ function scheduleWires() {
+ if (wireRaf) return;
+ wireRaf = requestAnimationFrame(() => {
+ wireRaf = 0;
+ drawWires();
+ });
+ }
+
+ function drawWires() {
+ const svg = $('#wbCanvasWires');
+ if (!svg) return;
+ if (compactMode || !state.showWires || (isSample && !state.notes.length)) {
+ svg.innerHTML = '';
+ return;
+ }
+ const hubEl = $('#wbCanvasOutputs .cv-hub');
+ if (!hubEl) {
+ svg.innerHTML = '';
+ return;
+ }
+
+ const hubPos = state.hub || defaultHubPos(refsList.length);
+ const hubW = hubEl.offsetWidth || HUB_W;
+ const hubH = hubEl.offsetHeight || 280;
+ const targetX = hubPos.x - hubW / 2;
+ const targetY = hubPos.y;
+ const paths = [];
+ const busy = !!(api && api.isBusy());
+
+ const makeCurve = (sx, sy, tx, ty, cls) => {
+ const dx = Math.max(54, Math.abs(tx - sx) * 0.48);
+ const d = `M ${sx} ${sy} C ${sx + dx} ${sy}, ${tx - dx} ${ty}, ${tx} ${ty}`;
+ return `<path class="cv-wire ${cls}${busy ? ' pulse' : ''}" d="${d}"/><circle class="cv-port ${cls}" cx="${sx}" cy="${sy}" r="3.5"/>`;
+ };
+
+ refsList.forEach(entry => {
+ const node = state.nodes[entry.id];
+ const el = cardNodeEl(entry.id);
+ if (!node || !el) return;
+ const w = el.offsetWidth || node.w || DEFAULT_CARD_W;
+ const sx = node.x + w / 2;
+ const sy = node.y;
+ paths.push(makeCurve(sx, sy, targetX, targetY, 'ref-wire'));
+ });
+
+ state.notes.forEach(note => {
+ if (!note.linked || !note.text.trim()) return;
+ const el = $(`#wbCanvasNotes .cv-note[data-note-id="${CSS.escape(note.id)}"]`);
+ const w = el ? el.offsetWidth : NOTE_W;
+ const h = el ? el.offsetHeight : 120;
+ if (note.x + w / 2 < targetX + 16) {
+ // Left of hub: clean horizontal Bezier right into hub's left input port
+ paths.push(makeCurve(note.x + w / 2, note.y, targetX, targetY, 'note-wire'));
+ } else {
+ // Below/around hub: route vertically from note's top edge into hub's bottom center
+ const sx = note.x;
+ const sy = note.y - h / 2;
+ const tx = hubPos.x;
+ const ty = hubPos.y + hubH / 2;
+ const dy = Math.max(36, Math.abs(sy - ty) * 0.5);
+ const d = `M ${sx} ${sy} C ${sx} ${sy - dy}, ${tx} ${ty + dy}, ${tx} ${ty}`;
+ paths.push(`<path class="cv-wire note-wire${busy ? ' pulse' : ''}" d="${d}"/><circle class="cv-port note-wire" cx="${sx}" cy="${sy}" r="3.5"/>`);
+ }
+ });
+
+ // Connect pinned historical result iterations to the hub
+ resultsList.slice(1, 5).forEach((_, i) => {
+ const outEl = $(`#wbCanvasOutputs .cv-out-node[data-out-pos="${i + 1}"]`);
+ if (!outEl) return;
+ const ox = Number(outEl.dataset.wx || 0);
+ const oy = Number(outEl.dataset.wy || 0);
+ const ow = outEl.offsetWidth || 176;
+ const sx = hubPos.x + hubW / 2;
+ const tx = ox - ow / 2;
+ const dx = Math.max(40, Math.abs(tx - sx) * 0.45);
+ paths.push(`<path class="cv-wire out-wire" d="M ${sx} ${targetY} C ${sx + dx} ${targetY}, ${tx - dx} ${oy}, ${tx} ${oy}"/>`);
+ });
+
+ if (paths.length) {
+ paths.push(`<circle class="cv-port hub-port${busy ? ' pulse' : ''}" cx="${targetX}" cy="${targetY}" r="4.5"/>`);
+ }
+ svg.innerHTML = paths.join('');
+ }
+
+ function renderCards() {
+ const cards = $('#wbBoardCards');
+ if (!cards) return;
+ cards.classList.toggle('sample', isSample);
+ cards.classList.toggle('many', refsList.length > 3);
+
+ cards.innerHTML = refsList
+ .map((entry, idx) => {
+ const pos = isSample ? defaultRefPos(idx, refsList.length, true) : state.nodes[entry.id] || defaultRefPos(idx, refsList.length, false);
+ const idxBadge = isSample ? '' : `<i class="board-idx" aria-hidden="true">${idx + 1}</i>`;
+ const angBadge = entry.angle ? `<em class="board-ang">${esc(entry.angle)}</em>` : '';
+ const flipped = !isSample && !!pos.flip;
+ const canAngle = !isSample && entry.item?.angles && entry.item.angles.length > 1;
+ const cardActions = isSample
+ ? ''
+ : `<div class="cv-card-bar">` +
+ (canAngle ? `<button type="button" data-cv-card="ang" title="切换视角" aria-label="切换视角">↻</button>` : '') +
+ `<button type="button" data-cv-card="flip" class="${flipped ? 'on' : ''}" title="画布镜像预览" aria-label="镜像">⇄</button>` +
+ `<button type="button" data-cv-card="pick" title="替换素材" aria-label="替换">换</button>` +
+ `<button type="button" data-cv-card="rm" title="移除" aria-label="移除">×</button>` +
+ `</div><span class="cv-rsz" data-cv-rsz title="拖拽调整卡片大小" aria-hidden="true"></span>`;
+
+ const styleAttr = compactMode
+ ? ''
+ : ` style="left:${pos.x}px;top:${pos.y}px;width:${pos.w || DEFAULT_CARD_W}px;z-index:${pos.z || idx + 1}"`;
+
+ return (
+ `<div class="board-card${flipped ? ' cv-flip' : ''}" role="button" tabindex="0"` +
+ ` data-nid="${esc(entry.id)}" data-pick="${esc(entry.material)}" data-type="${esc(entry.material)}"` +
+ ` data-slot="${esc(entry.slot || '')}" data-si="${entry.slotIdx ?? 0}"` +
+ `${entry.item ? ` data-pk-key="${esc(entry.item.k)}"` : ''}` +
+ ` title="${esc(entry.label)}"${styleAttr}>` +
+ `${idxBadge}${cardActions}` +
+ `<div class="cv-card-media"><img src="${esc(entry.src)}" alt="${esc(entry.label)}"${entry.item?.ref ? ` referrerpolicy="${esc(entry.item.ref)}"` : ''} draggable="false">${angBadge}</div>` +
+ `<span>${esc(entry.roleLabel)}</span>` +
+ `</div>`
+ );
+ })
+ .join('');
+ }
+
+ function renderNotes() {
+ const box = $('#wbCanvasNotes');
+ if (!box) return;
+ if (!state.notes.length) {
+ box.innerHTML = '';
+ return;
+ }
+ box.innerHTML = state.notes
+ .map(note => {
+ const styleAttr = compactMode ? '' : ` style="left:${note.x}px;top:${note.y}px;width:${NOTE_W}px"`;
+ return (
+ `<article class="cv-note${note.linked ? ' linked' : ''}" data-note-id="${esc(note.id)}"${styleAttr}>` +
+ `<header class="cv-note-head" data-note-drag>` +
+ `<i class="cv-pin" aria-hidden="true"></i>` +
+ `<button type="button" class="cv-note-link${note.linked ? ' on' : ''}" data-note-act="link" aria-pressed="${note.linked}" title="将便签内容自动注入生图提示词">${note.linked ? '↳ 提示词' : '仅备注'}</button>` +
+ `<button type="button" class="cv-note-rm" data-note-act="rm" aria-label="删除便签" title="删除便签">×</button>` +
+ `</header>` +
+ `<textarea rows="3" placeholder="写下光影、构图或情绪备注…" aria-label="画布便签">${esc(note.text)}</textarea>` +
+ `</article>`
+ );
+ })
+ .join('');
+ }
+
+ function renderOutputs() {
+ const box = $('#wbCanvasOutputs');
+ if (!box) return;
+ if (isSample && !state.notes.length && !resultsList.length) {
+ box.innerHTML = '';
+ return;
+ }
+ const meta = api ? api.getMeta() : { ar: 'auto', styleLabel: '', shotLabel: '', jobs: 1, canGo: false, busy: false };
+ const hubPos = state.hub || defaultHubPos(refsList.length);
+ const dims = ratioDims(meta.ar);
+ const latest = resultsList[0] || null;
+ const styleAttr = compactMode ? '' : ` style="left:${hubPos.x}px;top:${hubPos.y}px;width:${HUB_W}px"`;
+
+ const tags = [meta.styleLabel, meta.shotLabel, meta.ar !== 'auto' ? meta.ar : ''].filter(Boolean);
+ const previewInner = latest
+ ? `<img src="${esc(latest.url)}" alt="最新生成结果" draggable="false">`
+ : `<div class="cv-hub-wire" style="width:${dims.w}px;height:${dims.h}px"><span>${meta.ar === 'auto' ? '3:4' : esc(meta.ar)}</span><small>${refsList.length} 项输入 · ${meta.jobs} 张</small></div>`;
+
+ const hubActions = latest
+ ? `<div class="cv-hub-acts">` +
+ `<button type="button" class="sm ghost" data-out-act="view" data-out-i="${latest.index}">对比</button>` +
+ `<button type="button" class="sm ghost" data-out-act="use" data-out-i="${latest.index}">当原图</button>` +
+ `<button type="button" class="sm pri" data-hub-go${meta.canGo && !meta.busy ? '' : ' disabled'}>${meta.busy ? '生成中…' : '再生成'}</button>` +
+ `</div>`
+ : `<div class="cv-hub-acts">` +
+ `<button type="button" class="sm pri cv-hub-go" data-hub-go${meta.canGo && !meta.busy ? '' : ' disabled'}>${meta.busy ? '生成中…' : '从画布生成'}</button>` +
+ `</div>`;
+
+ const hubHtml =
+ `<section class="cv-hub${latest ? ' has-img' : ''}" data-hub-drag aria-label="生成输出节点"${styleAttr}>` +
+ `<header class="cv-hub-head">` +
+ `<i class="cv-hub-dot${meta.busy ? ' busy' : ''}" aria-hidden="true"></i>` +
+ `<b>${latest ? '最新成品' : '输出预览'}</b>` +
+ `<span class="cv-hub-n">${esc(meta.ar === 'auto' ? '自动' : meta.ar)}</span>` +
+ `</header>` +
+ `<div class="cv-hub-body">${previewInner}</div>` +
+ (tags.length ? `<div class="cv-hub-tags">${tags.map(t => `<span>${esc(t)}</span>`).join('')}</div>` : '') +
+ `${hubActions}</section>`;
+
+ // Pin previous iterations neatly to the right of the hub on desktop infinite canvas
+ const extraOutputs = resultsList
+ .slice(1, 5)
+ .map((res, idx) => {
+ const wx = hubPos.x + HUB_W + 34 + Math.floor(idx / 2) * 196;
+ const wy = hubPos.y + (idx % 2 === 0 ? -110 : 122);
+ const posStyle = compactMode ? '' : ` style="left:${wx}px;top:${wy}px;width:176px"`;
+ return (
+ `<article class="cv-out-node" data-out-pos="${idx + 1}" data-wx="${wx}" data-wy="${wy}"${posStyle}>` +
+ `<img src="${esc(res.url)}" alt="生成结果 ${res.index + 1}" draggable="false">` +
+ `<div class="cv-out-bar">` +
+ `<small>#${res.index + 1}</small>` +
+ `<button type="button" class="sm ghost" data-out-act="view" data-out-i="${res.index}">对比</button>` +
+ `<button type="button" class="sm ghost" data-out-act="use" data-out-i="${res.index}">当原图</button>` +
+ `</div></article>`
+ );
+ })
+ .join('');
+
+ box.innerHTML = hubHtml + extraOutputs;
+
+ const zenInfo = $('#wbZenInfo');
+ if (zenInfo) zenInfo.textContent = `${refsList.length} 项参考 · ${meta.styleLabel || '默认'}${meta.ar !== 'auto' ? ' · ' + meta.ar : ''}`;
+ const zenGo = $('#wbZenGo');
+ if (zenGo) {
+ zenGo.disabled = !meta.canGo || meta.busy;
+ zenGo.textContent = meta.busy ? '生成中…' : '生成';
+ }
+ }
+
+ function updateHud() {
+ const ph0 = $('#wbPh0');
+ if (ph0) ph0.dataset.layout = compactMode ? 'compact' : 'spatial';
+ const tools = $('#wbCanvasTools');
+ const zoomBar = $('#wbCanvasZoom');
+ const hideTools = compactMode && isSample && !state.notes.length;
+ if (tools) tools.hidden = hideTools;
+ if (zoomBar) zoomBar.hidden = compactMode;
+ const wireBtn = $('#wbCanvasTools [data-cv-act="wires"]');
+ if (wireBtn) {
+ wireBtn.classList.toggle('on', state.showWires);
+ wireBtn.setAttribute('aria-pressed', String(state.showWires));
+ }
+ const zenBtn = $('#wbCanvasZoom [data-cv-act="zen"]');
+ if (zenBtn) {
+ zenBtn.classList.toggle('on', zenMode);
+ zenBtn.setAttribute('aria-pressed', String(zenMode));
+ }
+ const zenBar = $('#wbZenBar');
+ if (zenBar) zenBar.hidden = !zenMode || compactMode;
+ }
+
+ function fitToView(animate = true) {
+ if (compactMode) return;
+ const boxes = [];
+ refsList.forEach((entry, idx) => {
+ const pos = isSample ? defaultRefPos(idx, refsList.length, true) : state.nodes[entry.id];
+ if (!pos) return;
+ const w = pos.w || DEFAULT_CARD_W;
+ const h = Math.round(w * 1.48);
+ boxes.push([pos.x - w / 2, pos.y - h / 2, pos.x + w / 2, pos.y + h / 2]);
+ });
+ if (!isSample && state.hub) {
+ boxes.push([state.hub.x - HUB_W / 2, state.hub.y - 150, state.hub.x + HUB_W / 2, state.hub.y + 150]);
+ }
+ state.notes.forEach(n => {
+ boxes.push([n.x - NOTE_W / 2, n.y - 68, n.x + NOTE_W / 2, n.y + 68]);
+ });
+ if (!boxes.length) {
+ state.tx = 0;
+ state.ty = 0;
+ state.scale = 1;
+ } else {
+ const minX = Math.min(...boxes.map(b => b[0]));
+ const minY = Math.min(...boxes.map(b => b[1]));
+ const maxX = Math.max(...boxes.map(b => b[2]));
+ const maxY = Math.max(...boxes.map(b => b[3]));
+ const bw = Math.max(180, maxX - minX);
+ const bh = Math.max(180, maxY - minY);
+ const { w, h } = vpMetrics();
+ const padX = 76;
+ const padY = 96;
+ const nextScale = clamp(Math.min((w - padX) / bw, (h - padY) / bh, 1.05), MIN_SCALE, 1.25);
+ const cx = (minX + maxX) / 2;
+ const cy = (minY + maxY) / 2;
+ state.scale = Math.round(nextScale * 100) / 100;
+ state.tx = Math.round(-cx * state.scale);
+ state.ty = Math.round(-cy * state.scale);
+ }
+ const world = $('#wbCanvasWorld');
+ if (animate && world && !matchMedia('(prefers-reduced-motion: reduce)').matches) {
+ world.classList.add('anim');
+ setTimeout(() => world.classList.remove('anim'), 260);
+ }
+ applyCamera();
+ persist();
+ }
+
+ function zoomBy(factor, anchorX, anchorY) {
+ if (compactMode) return;
+ const { w, h } = vpMetrics();
+ const prev = state.scale;
+ const next = clamp(Math.round(prev * factor * 100) / 100, MIN_SCALE, MAX_SCALE);
+ if (next === prev) return;
+ const ax = anchorX ?? w / 2;
+ const ay = anchorY ?? h / 2;
+ const wx = (ax - w / 2 - state.tx) / prev;
+ const wy = (ay - h / 2 - state.ty) / prev;
+ state.scale = next;
+ state.tx = ax - w / 2 - wx * next;
+ state.ty = ay - h / 2 - wy * next;
+ userCamera = true;
+ applyCamera();
+ persist();
+ }
+
+ function addNote(worldX, worldY) {
+ const idx = state.notes.length;
+ const def = defaultNotePos(idx);
+ const note = {
+ id: 'n_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 5),
+ text: '',
+ x: Number.isFinite(worldX) ? snap(worldX) : snap(def.x),
+ y: Number.isFinite(worldY) ? snap(worldY) : snap(def.y),
+ linked: true,
+ };
+ state.notes.push(note);
+ if (state.notes.length > 16) state.notes.shift();
+ renderNotes();
+ renderOutputs();
+ updateHud();
+ scheduleWires();
+ persist();
+ const ta = $(`#wbCanvasNotes .cv-note[data-note-id="${CSS.escape(note.id)}"] textarea`);
+ ta?.focus({ preventScroll: true });
+ return note;
+ }
+
+ function setZen(on) {
+ zenMode = !compactMode && !!on;
+ $('#studio')?.classList.toggle('zen', zenMode);
+ updateHud();
+ requestAnimationFrame(() => {
+ applyCamera();
+ fitToView(true);
+ });
+ }
+
+ function sync(payload) {
+ refsList = payload.refs || [];
+ resultsList = payload.results || [];
+ isSample = !!payload.sample;
+ compactMode = isCompactViewport();
+ if (compactMode && zenMode) setZen(false);
+ const listChanged = ensurePositions(false);
+ renderCards();
+ renderNotes();
+ renderOutputs();
+ updateHud();
+ if (listChanged && !compactMode && !userCamera && !isSample && refsList.length > 0) {
+ const { w, h } = vpMetrics();
+ const needsFit = refsList.some(entry => {
+ const p = state.nodes[entry.id];
+ if (!p) return false;
+ const hw = (p.w || DEFAULT_CARD_W) / 2;
+ const hh = Math.round(hw * 1.48);
+ const sx1 = w / 2 + state.tx + (p.x - hw) * state.scale;
+ const sx2 = w / 2 + state.tx + (p.x + hw) * state.scale;
+ const sy1 = h / 2 + state.ty + (p.y - hh) * state.scale;
+ const sy2 = h / 2 + state.ty + (p.y + hh) * state.scale;
+ return sx1 < 16 || sx2 > w - 16 || sy1 < 44 || sy2 > h - 44;
+ });
+ if (needsFit) fitToView(false);
+ else applyCamera();
+ } else {
+ applyCamera();
+ }
+ scheduleWires();
+ }
+
+ function linkedNotesText() {
+ return state.notes
+ .filter(n => n.linked && n.text.trim())
+ .map(n => n.text.trim())
+ .join('\n');
+ }
+
+ function tidy() {
+ userCamera = false;
+ ensurePositions(true);
+ renderCards();
+ renderNotes();
+ renderOutputs();
+ scheduleWires();
+ fitToView(true);
+ persist();
+ }
+
+ function clearLayout() {
+ state.nodes = {};
+ state.hub = null;
+ state.tx = 0;
+ state.ty = 0;
+ state.scale = 1;
+ lastRefSig = '';
+ userCamera = false;
+ persist();
+ }
+
+ // ---------- Pointer Interactions (Pan / Drag Node / Resize / Drag Hub / Drag Note) ----------
+ function bindEvents() {
+ const vp = $('#wbCanvasVp');
+ const ph0 = $('#wbPh0');
+ if (!vp || !ph0) return;
+
+ let drag = null;
+
+ vp.addEventListener('pointerdown', e => {
+ if (compactMode || e.button === 2) return;
+ if (e.target.closest('button, textarea, input, select, a')) return;
+
+ // Resize card handle
+ const rsz = e.target.closest('[data-cv-rsz]');
+ if (rsz) {
+ const card = rsz.closest('.board-card');
+ const id = card?.dataset.nid;
+ const node = id && state.nodes[id];
+ if (!node) return;
+ e.preventDefault();
+ e.stopPropagation();
+ node.z = ++zTop;
+ card.style.zIndex = String(node.z);
+ drag = { kind: 'resize', pointerId: e.pointerId, id, card, sx: e.clientX, startW: node.w || DEFAULT_CARD_W, moved: false };
+ return;
+ }
+
+ // Drag Sticky Note by header
+ const noteHead = e.target.closest('[data-note-drag]');
+ if (noteHead) {
+ const noteEl = noteHead.closest('.cv-note');
+ const note = state.notes.find(n => n.id === noteEl?.dataset.noteId);
+ if (!note) return;
+ e.preventDefault();
+ drag = { kind: 'note', pointerId: e.pointerId, note, el: noteEl, sx: e.clientX, sy: e.clientY, ox: note.x, oy: note.y, moved: false };
+ return;
+ }
+
+ // Drag Output Hub
+ const hubHead = e.target.closest('.cv-hub-head');
+ if (hubHead && state.hub) {
+ const hubEl = hubHead.closest('.cv-hub');
+ e.preventDefault();
+ drag = { kind: 'hub', pointerId: e.pointerId, el: hubEl, sx: e.clientX, sy: e.clientY, ox: state.hub.x, oy: state.hub.y, moved: false };
+ return;
+ }
+
+ // Drag Spatial Reference Card (unless Space held -> pan canvas)
+ const card = !spaceHeld && !isSample ? e.target.closest('.board-card') : null;
+ if (card) {
+ const id = card.dataset.nid;
+ const node = id && state.nodes[id];
+ if (!node) return;
+ node.z = ++zTop;
+ card.style.zIndex = String(node.z);
+ drag = { kind: 'card', pointerId: e.pointerId, id, card, sx: e.clientX, sy: e.clientY, ox: node.x, oy: node.y, moved: false };
+ return;
+ }
+
+ // Pan empty canvas
+ if (e.button === 0 || e.button === 1) {
+ drag = { kind: 'pan', pointerId: e.pointerId, sx: e.clientX, sy: e.clientY, ox: state.tx, oy: state.ty, moved: false };
+ }
+ });
+
+ const onPointerMove = e => {
+ if (!drag) return;
+ const dx = e.clientX - drag.sx;
+ const dy = e.clientY - drag.sy;
+ if (!drag.moved) {
+ if (Math.hypot(dx, dy) < 5) return;
+ drag.moved = true;
+ if (drag.kind === 'pan') vp.classList.add('panning');
+ try { vp.setPointerCapture(drag.pointerId); } catch {}
+ }
+
+ if (drag.kind === 'pan') {
+ state.tx = drag.ox + dx;
+ state.ty = drag.oy + dy;
+ userCamera = true;
+ applyCamera();
+ } else if (drag.kind === 'card') {
+ const node = state.nodes[drag.id];
+ if (!node) return;
+ drag.card.classList.add('dragging');
+ node.x = snap(drag.ox + dx / state.scale);
+ node.y = snap(drag.oy + dy / state.scale);
+ node.pinned = true;
+ drag.card.style.left = node.x + 'px';
+ drag.card.style.top = node.y + 'px';
+ scheduleWires();
+ } else if (drag.kind === 'resize') {
+ const node = state.nodes[drag.id];
+ if (!node) return;
+ node.w = clamp(snap(drag.startW + dx / state.scale), MIN_CARD_W, MAX_CARD_W);
+ node.pinned = true;
+ drag.card.style.width = node.w + 'px';
+ scheduleWires();
+ } else if (drag.kind === 'note') {
+ drag.el.classList.add('dragging');
+ drag.note.x = snap(drag.ox + dx / state.scale);
+ drag.note.y = snap(drag.oy + dy / state.scale);
+ drag.el.style.left = drag.note.x + 'px';
+ drag.el.style.top = drag.note.y + 'px';
+ scheduleWires();
+ } else if (drag.kind === 'hub' && state.hub) {
+ drag.el.classList.add('dragging');
+ state.hub.x = snap(drag.ox + dx / state.scale);
+ state.hub.y = snap(drag.oy + dy / state.scale);
+ state.hub.pinned = true;
+ drag.el.style.left = state.hub.x + 'px';
+ drag.el.style.top = state.hub.y + 'px';
+ scheduleWires();
+ }
+ };
+
+ const endDrag = e => {
+ if (!drag) return;
+ if (drag.moved) {
+ suppressClickUntil = performance.now() + 180;
+ persist();
+ try { vp.releasePointerCapture(drag.pointerId); } catch {}
+ }
+ drag.card?.classList.remove('dragging');
+ drag.el?.classList.remove('dragging');
+ vp.classList.remove('panning');
+ drag = null;
+ };
+ window.addEventListener('pointermove', onPointerMove);
+ window.addEventListener('pointerup', endDrag);
+ window.addEventListener('pointercancel', endDrag);
+
+ // Keyboard activation for role="button" spatial reference cards
+ vp.addEventListener('keydown', e => {
+ if ((e.key === 'Enter' || e.key === ' ') && e.target.classList?.contains('board-card')) {
+ e.preventDefault();
+ e.target.click();
+ }
+ });
+
+ // Prevent click from triggering picker right after dragging a card
+ vp.addEventListener('click', e => {
+ if (performance.now() < suppressClickUntil && e.target.closest('.board-card')) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ }, true);
+
+ // Double-click empty canvas to drop an Art-Direction Sticky Note right there
+ vp.addEventListener('dblclick', e => {
+ if (compactMode || e.target.closest('.board-card, .cv-note, .cv-hub, .cv-out-node, button, textarea')) return;
+ const r = vp.getBoundingClientRect();
+ const wx = (e.clientX - r.left - r.width / 2 - state.tx) / state.scale;
+ const wy = (e.clientY - r.top - r.height / 2 - state.ty) / state.scale;
+ addNote(wx, wy);
+ });
+
+ // Cursor-centered smooth wheel zoom
+ vp.addEventListener('wheel', e => {
+ if (compactMode) return;
+ if (e.target.closest('textarea')) return;
+ e.preventDefault();
+ const r = vp.getBoundingClientRect();
+ const factor = e.deltaY < 0 ? 1.1 : 1 / 1.1;
+ zoomBy(factor, e.clientX - r.left, e.clientY - r.top);
+ }, { passive: false });
+
+ // Delegate actions inside #wbPh0
+ ph0.addEventListener('click', e => {
+ const hudAct = e.target.closest('[data-cv-act]')?.dataset.cvAct;
+ if (hudAct) {
+ if (hudAct === 'note') addNote();
+ else if (hudAct === 'tidy') tidy();
+ else if (hudAct === 'fit') {
+ userCamera = false;
+ fitToView(true);
+ }
+ else if (hudAct === 'zin') zoomBy(1.18);
+ else if (hudAct === 'zout') zoomBy(1 / 1.18);
+ else if (hudAct === 'zreset') {
+ userCamera = false;
+ state.scale = 1;
+ state.tx = 0;
+ state.ty = 0;
+ applyCamera();
+ persist();
+ } else if (hudAct === 'wires') {
+ state.showWires = !state.showWires;
+ updateHud();
+ drawWires();
+ persist();
+ } else if (hudAct === 'zen') {
+ setZen(!zenMode);
+ }
+ return;
+ }
+
+ const cardActBtn = e.target.closest('[data-cv-card]');
+ if (cardActBtn) {
+ e.preventDefault();
+ e.stopPropagation();
+ const card = cardActBtn.closest('.board-card');
+ const id = card?.dataset.nid;
+ const act = cardActBtn.dataset.cvCard;
+ const slot = card?.dataset.slot;
+ const si = Number(card?.dataset.si || 0);
+ if (act === 'flip' && id && state.nodes[id]) {
+ state.nodes[id].flip = !state.nodes[id].flip;
+ card.classList.toggle('cv-flip', state.nodes[id].flip);
+ cardActBtn.classList.toggle('on', state.nodes[id].flip);
+ persist();
+ } else if (act === 'pick') {
+ api?.openPicker(card.dataset.pick, card);
+ } else if (act === 'ang') {
+ api?.cycleAngle(slot, si);
+ } else if (act === 'rm') {
+ api?.removeRef(slot, si);
+ }
+ return;
+ }
+
+ const noteActBtn = e.target.closest('[data-note-act]');
+ if (noteActBtn) {
+ const noteEl = noteActBtn.closest('.cv-note');
+ const idx = state.notes.findIndex(n => n.id === noteEl?.dataset.noteId);
+ if (idx < 0) return;
+ const act = noteActBtn.dataset.noteAct;
+ if (act === 'rm') {
+ state.notes.splice(idx, 1);
+ renderNotes();
+ renderOutputs();
+ updateHud();
+ scheduleWires();
+ persist();
+ api?.onNotesChange();
+ } else if (act === 'link') {
+ state.notes[idx].linked = !state.notes[idx].linked;
+ renderNotes();
+ scheduleWires();
+ persist();
+ api?.onNotesChange();
+ }
+ return;
+ }
+
+ if (e.target.closest('[data-hub-go]') || e.target.id === 'wbZenGo') {
+ api?.generate();
+ return;
+ }
+
+ const outActBtn = e.target.closest('[data-out-act]');
+ if (outActBtn) {
+ const act = outActBtn.dataset.outAct;
+ const i = Number(outActBtn.dataset.outI || 0);
+ if (act === 'view') api?.viewResult(i);
+ else if (act === 'use') api?.useResultAsPerson(i);
+ }
+ });
+
+ // Live sticky-note editing -> instant prompt injection
+ ph0.addEventListener('input', e => {
+ const ta = e.target.closest('.cv-note textarea');
+ if (!ta) return;
+ const noteEl = ta.closest('.cv-note');
+ const note = state.notes.find(n => n.id === noteEl?.dataset.noteId);
+ if (!note) return;
+ note.text = ta.value;
+ scheduleWires();
+ persist();
+ if (note.linked) api?.onNotesChange();
+ });
+
+ // Keyboard shortcuts when Studio is active and not typing
+ addEventListener('keydown', e => {
+ if (!document.body.classList.contains('studio')) return;
+ const ae = document.activeElement;
+ const typing = ae && /^(INPUT|TEXTAREA|SELECT)$/.test(ae.tagName);
+ if (e.key === 'Escape' && zenMode && $('#pk')?.hidden && $('#cfg')?.hidden && $('#recipeBox')?.hidden) {
+ e.preventDefault();
+ setZen(false);
+ return;
+ }
+ if (typing || e.ctrlKey || e.metaKey || e.altKey) return;
+ if (e.code === 'Space') {
+ spaceHeld = true;
+ vp.classList.add('space');
+ } else if (e.key === '0') {
+ fitToView(true);
+ }
+ });
+ addEventListener('keyup', e => {
+ if (e.code === 'Space') {
+ spaceHeld = false;
+ vp.classList.remove('space');
+ }
+ });
+
+ // Re-sync compact mode & camera on window resize
+ let resizeRaf = 0;
+ addEventListener('resize', () => {
+ if (resizeRaf || !document.body.classList.contains('studio')) return;
+ resizeRaf = requestAnimationFrame(() => {
+ resizeRaf = 0;
+ const nextCompact = isCompactViewport();
+ if (nextCompact !== compactMode) {
+ compactMode = nextCompact;
+ if (compactMode && zenMode) setZen(false);
+ renderCards();
+ renderNotes();
+ renderOutputs();
+ updateHud();
+ }
+ applyCamera();
+ scheduleWires();
+ });
+ });
+ }
+
+ function init(studioApi) {
+ api = studioApi;
+ bindEvents();
+ compactMode = isCompactViewport();
+ updateHud();
+ applyCamera();
+ }
+
+ window.PoseWearCanvas = {
+ init,
+ sync,
+ tidy,
+ fitToView,
+ addNote,
+ setZen,
+ isZen: () => zenMode,
+ linkedNotesText,
+ clearLayout,
+ getState: () => ({
+ tx: state.tx,
+ ty: state.ty,
+ scale: state.scale,
+ showWires: state.showWires,
+ notes: state.notes.map(n => ({ ...n })),
+ nodes: { ...state.nodes },
+ zen: zenMode,
+ compact: compactMode,
+ }),
+ };
+})();
diff --git a/src/command-palette.js b/src/command-palette.js
index 16d9772..201a722 100644
--- a/src/command-palette.js
+++ b/src/command-palette.js
@@ -63,13 +63,79 @@
},
];
+ if (app.st.tab === 'studio' && window.PoseWearCanvas) {
+ list.splice(1, 0,
+ {
+ g: '快捷操作',
+ id: 'act:cvnote',
+ label: '在无限画布添加便签',
+ kw: 'canvas sticky note prompt 便签 无限画布 メモ ノート',
+ run: () => window.PoseWearCanvas.addNote(),
+ },
+ {
+ g: '快捷操作',
+ id: 'act:cvtidy',
+ label: '整理无限画布并适配视野',
+ kw: 'canvas tidy arrange fit 整理 适配 画布 整列',
+ hint: '0',
+ run: () => window.PoseWearCanvas.tidy(),
+ },
+ {
+ g: '快捷操作',
+ id: 'act:cvzen',
+ label: window.PoseWearCanvas.isZen() ? '退出专注画布' : '进入全屏专注画布',
+ kw: 'canvas zen focus fullscreen 专注 全屏 画布 集中',
+ run: () => window.PoseWearCanvas.setZen(!window.PoseWearCanvas.isZen()),
+ }
+ );
+ }
+
if (app.st.tab === 'studio' && !$('#wbExportBoard')?.hidden) {
+ list.splice(1, 0,
+ {
+ g: '快捷操作',
+ id: 'act:copyboard',
+ label: '复制参考画板拼图到剪贴板',
+ kw: 'copy board moodboard png clipboard 复制 拼图 剪贴板 コピー',
+ run: () => $('#wbCopyBoard')?.click(),
+ },
+ {
+ g: '快捷操作',
+ id: 'act:export',
+ label: '导出参考画板拼图 PNG',
+ kw: 'export board moodboard png 导出 拼图 書き出し',
+ run: () => $('#wbExportBoard')?.click(),
+ }
+ );
+ }
+
+ if (window.PoseWearRecipes) {
+ const rCount = window.PoseWearRecipes.count();
+ list.splice(1, 0, {
+ g: '快捷操作',
+ id: 'act:recipes',
+ label: '造型方案与角色档案',
+ kw: 'recipes boards character preset save 方案 角色 档案 预设 プリセット',
+ hint: rCount ? String(rCount) : '',
+ run: async () => {
+ if (app.st.tab !== 'studio') {
+ app.setTab('studio');
+ await new Promise(r => setTimeout(r, 80));
+ }
+ window.PoseWearRecipes.open();
+ },
+ });
+ }
+
+ const selCount = (app.st.sel || []).filter(k => app.ok(app.ITEMS[k])).length;
+ if (selCount >= 2 && window.PoseWearCompare) {
list.splice(1, 0, {
g: '快捷操作',
- id: 'act:export',
- label: '导出参考画板拼图 PNG',
- kw: 'export board moodboard png 导出 拼图 書き出し',
- run: () => $('#wbExportBoard')?.click(),
+ id: 'act:compare',
+ label: '同屏对比已选素材',
+ kw: 'compare side by side 对比 同屏 比较 比較',
+ hint: `${Math.min(4, selCount)} / 4`,
+ run: () => app.compareOpen?.(app.st.sel),
});
}
diff --git a/src/compare.js b/src/compare.js
new file mode 100644
index 0000000..f199401
--- /dev/null
+++ b/src/compare.js
@@ -0,0 +1,289 @@
+'use strict';
+(() => {
+ // Side-by-side Reference Compare Studio (#cmpModal).
+ // Compares 2-4 references simultaneously with synced mirror, composition grids,
+ // grayscale / 3-tone Notan value blocks, silhouette check, and pose/depth flip.
+ const C = window.PoseWearCatalog;
+ if (!C) return;
+ const { $, esc, TL } = C;
+
+ const state = {
+ open: false,
+ entries: [], // { originKey, item, ai }
+ flip: false,
+ grid: 0,
+ gray: 0, // 0=off, 1=grayscale, 2=notan-3
+ sil: false,
+ pair: false,
+ prevFocus: null,
+ };
+
+ let app = null;
+
+ function activeItem(entry) {
+ const base = app.ITEMS[entry.originKey] || entry.item;
+ if (!base) return null;
+ if (state.pair) {
+ const mate = app.poseCounterpart(base, entry.ai);
+ if (mate) return { item: mate.item, ai: mate.angle };
+ }
+ return { item: base, ai: entry.ai };
+ }
+
+ function hasPairable() {
+ return state.entries.some(entry => {
+ const base = app.ITEMS[entry.originKey];
+ return base && app.poseCounterpart(base, entry.ai);
+ });
+ }
+
+ function renderTools() {
+ const modal = $('#cmpModal');
+ if (!modal) return;
+ const setBtn = (key, on) => {
+ const btn = modal.querySelector(`[data-ct="${key}"]`);
+ if (!btn) return;
+ btn.classList.toggle('on', !!on);
+ btn.setAttribute('aria-pressed', String(!!on));
+ };
+ setBtn('flip', state.flip);
+ setBtn('grid', state.grid > 0);
+ setBtn('gray', state.gray > 0);
+ setBtn('sil', state.sil);
+ setBtn('pair', state.pair);
+
+ const grayLabel = modal.querySelector('[data-ct="gray"] span');
+ if (grayLabel) grayLabel.textContent = state.gray === 2 ? '明度块面' : '灰度';
+
+ const pairBtn = modal.querySelector('[data-ct="pair"]');
+ if (pairBtn) pairBtn.hidden = !hasPairable();
+
+ const gridMode = ['', 'thirds', 'cross'][state.grid] || '';
+ for (const stage of modal.querySelectorAll('.cmp-stage')) {
+ stage.classList.toggle('flipped', state.flip);
+ stage.classList.toggle('gray', state.gray > 0);
+ stage.classList.toggle('notan', state.gray === 2);
+ stage.classList.toggle('sil', state.sil);
+ const gridEl = stage.querySelector('.lb-grid');
+ if (gridEl) gridEl.dataset.mode = gridMode;
+ }
+ }
+
+ function renderCards() {
+ const grid = $('#cmpGrid');
+ const count = $('#cmpCount');
+ if (!grid) return;
+ grid.dataset.n = String(state.entries.length);
+ if (count) count.textContent = `${state.entries.length} / 4`;
+
+ grid.innerHTML = state.entries
+ .map((entry, idx) => {
+ const resolved = activeItem(entry);
+ if (!resolved) return '';
+ const { item, ai } = resolved;
+ const view = item.angles?.[ai];
+ const src = view ? (view.i || view.t) : (item.m || item.i || item.t);
+ const label = app.title(item);
+ const isFav = app.st.fav.has(item.k);
+ const isSel = app.st.sel.includes(item.k);
+ const angles = item.angles
+ ? `<div class="cmp-angs" role="group" aria-label="拍摄角度">${item.angles
+ .map(
+ (a, i) =>
+ `<button type="button" class="${i === ai ? 'on' : ''}" data-cai="${i}" aria-pressed="${i === ai}">${esc(a.zh)}</button>`
+ )
+ .join('')}</div>`
+ : '';
+ const meta = view
+ ? `<span>${esc(TL(item))}</span> · <span>${esc(view.zh)}</span>`
+ : `<span>${esc(TL(item))}</span>${item.cat ? ` · <span>${esc(item.cat)}</span>` : ''}`;
+
+ return (
+ `<article class="cmp-card" data-ci="${idx}" data-type="${item.type}">` +
+ `<div class="cmp-ph" data-img-type="${item.type}">` +
+ `<div class="cmp-stage"><img src="${esc(src)}" alt="${esc(label)}"${item.ref ? ` referrerpolicy="${esc(item.ref)}"` : ''} draggable="false"><div class="lb-grid" aria-hidden="true"></div></div>` +
+ `<span class="cmp-idx">${idx + 1}</span>` +
+ `<button type="button" class="cmp-rm" data-ca="rm" title="移出对比" aria-label="移出对比">×</button>` +
+ `${angles}` +
+ `</div>` +
+ `<div class="cmp-info">` +
+ `<h4 title="${esc(label)}">${esc(label)}</h4>` +
+ `<small>${meta}</small>` +
+ `<div class="cmp-act">` +
+ `<button type="button" class="sm ${isFav ? 'on' : ''}" data-ca="fav" aria-pressed="${isFav}" title="${isFav ? '取消收藏' : '收藏'}">${isFav ? '♥' : '♡'}</button>` +
+ `<button type="button" class="sm ${isSel ? 'on' : ''}" data-ca="sel" aria-pressed="${isSel}" title="${isSel ? '移出组合' : '加入组合'}">${isSel ? '✓' : '+'}</button>` +
+ `<button type="button" class="sm ghost" data-ca="copy">复制</button>` +
+ `<button type="button" class="sm ghost" data-ca="open">大图</button>` +
+ `</div></div></article>`
+ );
+ })
+ .join('');
+
+ renderTools();
+ }
+
+ function preloadCounterparts() {
+ const missing = new Set();
+ for (const entry of state.entries) {
+ const base = app.ITEMS[entry.originKey];
+ const pairType = base && app.counterpartType(base);
+ if (pairType && !app.DATA[pairType]) missing.add(pairType);
+ }
+ if (missing.size) {
+ Promise.all([...missing].map(t => app.load(t)))
+ .then(() => {
+ if (state.open) renderTools();
+ })
+ .catch(() => {});
+ }
+ }
+
+ function open(input) {
+ if (!app) return;
+ const rawItems = (Array.isArray(input) ? input : [])
+ .map(x => (typeof x === 'string' ? app.ITEMS[x] : x))
+ .filter(it => app.ok(it));
+ const unique = [];
+ const seen = new Set();
+ for (const it of rawItems) {
+ if (seen.has(it.k)) continue;
+ seen.add(it.k);
+ unique.push(it);
+ }
+ if (unique.length < 2) {
+ app.toast('请至少选择 2 项素材进行对比');
+ return;
+ }
+ const capped = unique.slice(0, 4);
+ if (unique.length > 4) app.toast('同屏对比最多支持 4 项,已展示前 4 项');
+
+ if (window.PoseWearCommandPalette?.isOpen()) window.PoseWearCommandPalette.close();
+ if (window.PoseWearSketch?.isOpen()) window.PoseWearSketch.close();
+
+ state.prevFocus = document.activeElement;
+ state.entries = capped.map(it => ({ originKey: it.k, item: it, ai: it.ai ?? 0 }));
+ state.flip = false;
+ state.grid = 0;
+ state.gray = 0;
+ state.sil = false;
+ state.pair = false;
+ state.open = true;
+
+ const modal = $('#cmpModal');
+ modal.hidden = false;
+ document.body.style.overflow = 'hidden';
+ renderCards();
+ preloadCounterparts();
+ $('#cmpClose')?.focus({ preventScroll: true });
+ }
+
+ function close() {
+ if (!state.open) return;
+ state.open = false;
+ const modal = $('#cmpModal');
+ if (modal) modal.hidden = true;
+ $('#cmpGrid')?.replaceChildren();
+ document.body.style.overflow = '';
+ if (state.prevFocus?.isConnected) state.prevFocus.focus({ preventScroll: true });
+ state.prevFocus = null;
+ }
+
+ function toggleTool(action) {
+ if (!state.open) return;
+ if (action === 'flip') {
+ state.flip = !state.flip;
+ } else if (action === 'grid') {
+ state.grid = (state.grid + 1) % 3;
+ } else if (action === 'gray') {
+ state.sil = false;
+ state.gray = (state.gray + 1) % 3;
+ } else if (action === 'sil') {
+ state.sil = !state.sil;
+ if (state.sil) state.gray = 0;
+ } else if (action === 'pair') {
+ if (!hasPairable()) return;
+ state.pair = !state.pair;
+ renderCards();
+ return;
+ }
+ renderTools();
+ }
+
+ function handleKey(e) {
+ if (!state.open) return false;
+ const k = (e.key || '').toLowerCase();
+ if (e.key === 'Escape') { e.preventDefault(); close(); }
+ else if (k === 'h') toggleTool('flip');
+ else if (k === 'g') toggleTool('grid');
+ else if (k === 'b') toggleTool('gray');
+ else if (k === 'u') toggleTool('sil');
+ else if (k === 'v') toggleTool('pair');
+ else if (e.key === 'Tab') app.trapTab(e, $('#cmpModal'));
+ return true;
+ }
+
+ function init(appApi) {
+ app = appApi;
+ const modal = $('#cmpModal');
+ if (!modal) return;
+ $('#cmpClose')?.addEventListener('click', close);
+ modal.addEventListener('click', e => {
+ if (e.target === modal) return close();
+ const toolBtn = e.target.closest('[data-ct]');
+ if (toolBtn) return toggleTool(toolBtn.dataset.ct);
+
+ const card = e.target.closest('.cmp-card');
+ if (!card) return;
+ const idx = Number(card.dataset.ci);
+ const entry = state.entries[idx];
+ if (!entry) return;
+ const resolved = activeItem(entry);
+ if (!resolved) return;
+
+ const angBtn = e.target.closest('[data-cai]');
+ if (angBtn) {
+ const nextAi = Number(angBtn.dataset.cai);
+ if (state.pair) {
+ const base = app.ITEMS[entry.originKey];
+ const chosenZh = resolved.item.angles?.[nextAi]?.zh;
+ const baseIdx = base?.angles?.findIndex(a => a.zh === chosenZh);
+ if (baseIdx >= 0) entry.ai = baseIdx;
+ } else {
+ entry.ai = nextAi;
+ }
+ renderCards();
+ return;
+ }
+
+ const act = e.target.closest('[data-ca]')?.dataset.ca;
+ if (!act) return;
+ if (act === 'rm') {
+ state.entries.splice(idx, 1);
+ if (state.entries.length < 2) close();
+ else renderCards();
+ } else if (act === 'fav') {
+ app.toggleFav(resolved.item.k);
+ renderCards();
+ } else if (act === 'sel') {
+ app.toggleSel(resolved.item.k);
+ renderCards();
+ } else if (act === 'copy') {
+ const copyItem = { ...resolved.item, ai: resolved.ai };
+ app.copyBrief(app.prompt(copyItem, app.st.lang), [copyItem], app.st.lang, '提示词');
+ } else if (act === 'open') {
+ const target = resolved.item;
+ close();
+ app.openItem(target.type, target.id);
+ }
+ });
+ }
+
+ window.PoseWearCompare = {
+ init,
+ open,
+ close,
+ isOpen: () => state.open,
+ handleKey,
+ };
+ if (window.APP) init(window.APP);
+})();
diff --git a/src/extras.js b/src/extras.js
index d6cb79b..5a2633d 100644
--- a/src/extras.js
+++ b/src/extras.js
@@ -147,6 +147,7 @@
batchBar.innerHTML =
'<b id="bbN">已选 0</b>' +
'<button data-b="all">全选</button>' +
+ '<button data-b="cmp">对比</button>' +
'<button data-b="fav">收藏</button>' +
'<button data-b="unfav">取消收藏</button>' +
'<button data-b="zip">打包下载</button>' +
@@ -172,7 +173,7 @@
function updateBatchBar() {
$('#bbN').textContent = '已选 ' + selectedKeys.size;
batchBar.querySelectorAll('[data-b]:not([data-b=x]):not([data-b=all])').forEach(b => {
- b.disabled = !selectedKeys.size;
+ b.disabled = b.dataset.b === 'cmp' ? selectedKeys.size < 2 : !selectedKeys.size;
});
}
@@ -185,6 +186,10 @@
const mode = target.dataset.b;
if (mode === 'x') return setBatchMode(false);
+ if (mode === 'cmp') {
+ window.PoseWearCompare?.open(items);
+ return;
+ }
if (mode === 'all') {
A.st.list.forEach(it => selectedKeys.add(A.cardFace(it).k));
$$('#grid .card').forEach(c => c.classList.add('picked'));
diff --git a/src/i18n.js b/src/i18n.js
index 76e96bc..887c888 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -776,6 +776,125 @@
"手持日用": ["Everyday handheld items","手持ちの日用品","Vật dụng cầm tay hằng ngày","Günlük el eşyaları"],
"民族器物": ["Traditional objects","伝統の道具","Vật dụng truyền thống","Geleneksel nesneler"],
"历史奇幻": ["Historical fantasy","歴史・ファンタジー","Kỳ ảo lịch sử","Tarihsel fantastik"],
+ "新增多图同屏对比、三阶明度块面与剪影检查、工作台造型方案、拼图直拷剪贴板、12 种画风/镜头预设与最新生图模型。": ["New: side-by-side compare, 3-tone Notan & silhouette check, saved studio recipes, clipboard board PNG, 12 styles & camera shots, and latest image models.","新機能:最大4枚同画面比較、3階調ノータン&シルエット確認、レシピ保存、ボードPNG直接コピー、12画風・カメラプリセット、最新生成モデル対応。","Mới: so sánh song song tối đa 4 ảnh, kiểm tra sắc độ 3 bậc & bóng dáng, lưu công thức phối đồ, sao chép bảng ảnh PNG, 12 phong cách & góc máy, cùng các mô hình tạo ảnh mới nhất.","Yeni: yan yana karşılaştırma, 3 ton Notan ve silüet kontrolü, kayıtlı stüdyo tarifleri, panoya PNG kopyalama, 12 stil ve kamera açısı, en yeni görsel modelleri."],
+ "灰度 / 三阶明度(B)": ["Grayscale / 3-tone Notan (B)","グレースケール/3階調明度(B)","Đen trắng / Sắc độ 3 bậc (B)","Gri ton / 3 ton Notan (B)"],
+ "明度块面": ["Notan 3-tone","明度ブロック","Sắc độ 3 bậc","3 ton Notan"],
+ "明度": ["Value","明度","Sắc độ","Değer"],
+ "剪影": ["Silhouette","シルエット","Bóng dáng","Silüet"],
+ "剪影轮廓检查(U)": ["Silhouette check (U)","シルエット輪郭確認(U)","Kiểm tra bóng dáng (U)","Silüet kontrolü (U)"],
+ "大图:灰度 / 三阶明度": ["Preview: grayscale / 3-tone Notan","プレビュー:グレースケール/3階調明度","Xem trước: đen trắng / sắc độ 3 bậc","Önizleme: gri ton / 3 ton Notan"],
+ "大图:剪影轮廓检查": ["Preview: silhouette check","プレビュー:シルエット確認","Xem trước: kiểm tra bóng dáng","Önizleme: silüet kontrolü"],
+ "同屏对比": ["Side-by-side compare","並べて比較","So sánh song song","Yan yana karşılaştır"],
+ "同屏对比已选素材": ["Compare selected side by side","選択中の素材を並べて比較","So sánh song song tư liệu đã chọn","Seçilenleri yan yana karşılaştır"],
+ "同步查看工具": ["Synced view tools","同期表示ツール","Công cụ xem đồng bộ","Senkron görünüm araçları"],
+ "同步镜像翻转(H)": ["Sync horizontal flip (H)","一括左右反転(H)","Lật ngang đồng bộ (H)","Eşzamanlı yatay çevir (H)"],
+ "同步构图参考线(G)": ["Sync composition grid (G)","一括構図ガイド(G)","Lưới bố cục đồng bộ (G)","Eşzamanlı kompozisyon ızgarası (G)"],
+ "同步灰度 / 三阶明度(B)": ["Sync grayscale / 3-tone Notan (B)","一括グレースケール/3階調明度(B)","Đồng bộ đen trắng / sắc độ 3 bậc (B)","Eşzamanlı gri ton / 3 ton Notan (B)"],
+ "同步剪影检查(U)": ["Sync silhouette check (U)","一括シルエット確認(U)","Kiểm tra bóng dáng đồng bộ (U)","Eşzamanlı silüet kontrolü (U)"],
+ "同步切换线稿与深度图(V)": ["Sync line art / depth toggle (V)","一括で線画・深度を切替(V)","Chuyển đồng bộ phác thảo & độ sâu (V)","Eşzamanlı çizgi / derinlik geçişi (V)"],
+ "移出对比": ["Remove from compare","比較から外す","Bỏ khỏi so sánh","Karşılaştırmadan çıkar"],
+ "大图": ["Preview","拡大","Xem lớn","Önizle"],
+ "请至少选择 2 项素材进行对比": ["Select at least 2 items to compare","比較するには2件以上選択してください","Hãy chọn ít nhất 2 mục để so sánh","Karşılaştırmak için en az 2 öğe seçin"],
+ "同屏对比最多支持 4 项,已展示前 4 项": ["Compare supports up to 4 items; showing the first 4","同画面比較は最大4件までです。先頭4件を表示しています","So sánh song song tối đa 4 mục; đang hiển thị 4 mục đầu","Karşılaştırma en fazla 4 öğe destekler; ilk 4 gösteriliyor"],
+ "方案": ["Recipes","レシピ","Công thức","Tarifler"],
+ "造型方案": ["Studio recipes","スタイルレシピ","Công thức phối đồ","Stüdyo tarifleri"],
+ "已保存的造型方案与角色档案": ["Saved studio recipes & character profiles","保存済みのスタイルレシピ・キャラ設定","Công thức phối đồ & hồ sơ nhân vật đã lưu","Kayıtlı stüdyo tarifleri ve karakter profilleri"],
+ "造型方案与角色档案": ["Studio recipes & character profiles","スタイルレシピ・キャラ設定","Công thức phối đồ & hồ sơ nhân vật","Stüdyo tarifleri ve karakter profilleri"],
+ "给当前搭配命名…": ["Name this recipe…","このレシピに名前を付ける…","Đặt tên công thức này…","Bu tarife bir ad ver…"],
+ "方案名称": ["Recipe name","レシピ名","Tên công thức","Tarif adı"],
+ "保存当前": ["Save current","現在を保存","Lưu hiện tại","Mevcutu kaydet"],
+ "提示:本地上传的照片仅在本次会话保留,方案会保存图库参考与提示词设置。": ["Note: local uploads stay for this session only. Recipes save library references and prompt settings.","注意:ローカルアップロード画像は今回限りです。レシピには素材集の参考とプロンプト設定が保存されます。","Lưu ý: ảnh tải lên cục bộ chỉ giữ trong phiên này. Công thức lưu ảnh thư viện và cài đặt prompt.","Not: yerel yüklemeler yalnızca bu oturumda kalır. Tarifler kitaplık referanslarını ve istem ayarlarını kaydeder."],
+ "还没有保存的造型方案": ["No saved recipes yet","保存済みのレシピはまだありません","Chưa có công thức nào được lưu","Henüz kayıtlı tarif yok"],
+ "将常用的人物、服装、场景与风格保存为方案,随时一键切换或保留姿势换角。": ["Save recurring subjects, outfits, scenes, and styles as recipes to reload anytime or swap characters while keeping your current pose.","よく使う人物・衣装・背景・画風をレシピ保存。いつでもワンクリック切替やポーズ維持のキャラ差し替えができます。","Lưu nhân vật, trang phục, bối cảnh và phong cách hay dùng thành công thức để tải lại hoặc đổi nhân vật mà giữ nguyên tư thế.","Sık kullanılan karakter, kıyafet, sahne ve stilleri tarif olarak kaydedin; dilediğinizde yükleyin veya mevcut pozu koruyarak karakter değiştirin."],
+ "导出方案": ["Export JSON","JSON 書き出し","Xuất JSON","JSON dışa aktar"],
+ "我的造型方案": ["My studio recipe","マイレシピ","Công thức của tôi","Stüdyo tarifim"],
+ "保留当前姿势": ["Keep pose","ポーズ維持","Giữ tư thế","Pozu koru"],
+ "保留当前工作台姿势,只换角色与服饰": ["Keep current studio poses and swap character & outfit","現在のポーズを保ったままキャラと衣装だけ差し替え","Giữ tư thế hiện tại, chỉ thay nhân vật và trang phục","Mevcut stüdyo pozlarını koru, yalnızca karakter ve kıyafeti değiştir"],
+ "纯提示词": ["Prompt only","プロンプトのみ","Chỉ prompt","Yalnızca istem"],
+ "载入": ["Load","読込","Tải","Yükle"],
+ "请先选择参考素材或输入提示词": ["Pick references or enter a prompt first","先に参考素材を選ぶかプロンプトを入力してください","Hãy chọn tư liệu tham chiếu hoặc nhập prompt trước","Önce referans seçin veya bir istem girin"],
+ "已保存方案(本地上传图仅限本次会话)": ["Recipe saved (local uploads stay for this session only)","レシピを保存しました(ローカル画像は今回限り)","Đã lưu công thức (ảnh cục bộ chỉ giữ trong phiên này)","Tarif kaydedildi (yerel yüklemeler yalnızca bu oturum içindir)"],
+ "已保存造型方案": ["Recipe saved","レシピを保存しました","Đã lưu công thức","Tarif kaydedildi"],
+ "已套用方案并保留当前姿势": ["Recipe applied while keeping current poses","現在のポーズを保ったままレシピを適用しました","Đã áp dụng công thức và giữ nguyên tư thế hiện tại","Mevcut pozlar korunarak tarif uygulandı"],
+ "已删除方案": ["Recipe deleted","レシピを削除しました","Đã xóa công thức","Tarif silindi"],
+ "还没有已保存的方案": ["No saved recipes to export","書き出せるレシピがありません","Chưa có công thức nào để xuất","Dışa aktarılacak kayıtlı tarif yok"],
+ "复制参考拼图到剪贴板": ["Copy reference board PNG to clipboard","リファレンスボード PNG をクリップボードにコピー","Sao chép bảng tham chiếu PNG vào bộ nhớ tạm","Referans panosu PNG görselini panoya kopyala"],
+ "复制拼图": ["Copy PNG","PNG コピー","Chép PNG","PNG kopyala"],
+ "复制参考画板拼图到剪贴板": ["Copy reference board PNG to clipboard","リファレンスボード PNG をクリップボードにコピー","Sao chép bảng tham chiếu PNG vào bộ nhớ tạm","Referans panosu PNG görselini panoya kopyala"],
+ "参考拼图已复制到剪贴板": ["Board PNG copied to clipboard","リファレンスボード PNG をコピーしました","Đã sao chép ảnh bảng tham chiếu vào bộ nhớ tạm","Referans panosu PNG panoya kopyalandı"],
+ "参考拼图已复制到剪贴板(外链图已标出)": ["Board PNG copied (external links labeled)","リファレンスボード PNG をコピーしました(外部リンク表記あり)","Đã sao chép ảnh bảng tham chiếu (đã ghi chú ảnh liên kết ngoài)","Referans panosu PNG kopyalandı (harici bağlantılar etiketlendi)"],
+ "当前浏览器不支持复制图片,请点击「导出拼图」保存": ["Image clipboard copy is unavailable here; use Export PNG instead","このブラウザでは画像コピーに未対応です。「PNG 保存」をご利用ください","Trình duyệt không hỗ trợ sao chép ảnh; hãy dùng Xuất PNG","Bu tarayıcı görsel kopyalamayı desteklemiyor; PNG dışa aktar'ı kullanın"],
+ "杂志画报": ["Magazine","雑誌グラビア","Tạp chí","Dergi"],
+ "游戏原画": ["Concept art","ゲーム原画","Concept art","Konsept sanat"],
+ "角色三视图": ["Turnaround","三面図","Bảng 3 góc nhìn","Üç görünüm"],
+ "黑白漫画": ["Manga ink","モノクロ漫画","Manga đen trắng","Manga mürekkep"],
+ "3D 手办": ["3D figurine","3D フィギュア","Mô hình 3D","3B figür"],
+ "霓虹夜色": ["Neon night","ネオン夜景","Đêm neon","Neon gece"],
+ "镜头": ["Shot","カメラ","Góc máy","Çekim"],
+ "面部特写": ["Close-up","クローズアップ","Cận mặt","Yakın çekim"],
+ "半身肖像": ["Half body","バストアップ","Bán thân","Yarım boy"],
+ "七分身": ["Cowboy shot","ニーショット","Khung 3/4","Kovboy çekimi"],
+ "全身构图": ["Full body","全身","Toàn thân","Tam boy"],
+ "85mm 虚化": ["85mm bokeh","85mm ポートレート","85mm xóa phông","85mm portre"],
+ "35mm 纪实": ["35mm street","35mm スナップ","35mm tài liệu","35mm belgesel"],
+ "低机位仰拍": ["Low angle","ローアングル","Góc thấp hất lên","Alçak açı"],
+ "高机位俯拍": ["High angle","ハイアングル","Góc cao chụp xuống","Yüksek açı"],
+ "更多格式": ["Formats","形式別","Định dạng","Biçimler"],
+ "导出到其他生图工具的提示词格式": ["Copy prompt formatted for other image generators","他ツール向けのプロンプト形式でコピー","Sao chép prompt theo định dạng công cụ tạo ảnh khác","Diğer görsel araçları için biçimlendirilmiş istem kopyala"],
+ "Midjourney 格式": ["Midjourney format","Midjourney 形式","Định dạng Midjourney","Midjourney biçimi"],
+ "SD / NovelAI 标签": ["SD / NovelAI tags","SD / NovelAI タグ","Thẻ SD / NovelAI","SD / NovelAI etiketleri"],
+ "结构化 JSON": ["Structured JSON","構造化 JSON","JSON có cấu trúc","Yapılandırılmış JSON"],
+ "负向提示词 / 避坑词": ["Negative prompt / avoid","ネガティブプロンプト/除外要素","Prompt phủ định / cần tránh","Negatif istem / kaçınılacaklar"],
+ "填入常用": ["Fill defaults","定番を入力","Điền mặc định","Varsayılanı doldur"],
+ "不想出现的元素(可选),例如:畸形手指、水印、文字、模糊…": ["Elements to avoid (optional), e.g., malformed hands, watermark, text, blurry…","避けたい要素(任意)。例:崩れた指、透かし、文字、ぼやけ…","Yếu tố muốn tránh (tùy chọn), ví dụ: bàn tay lỗi, hình mờ, chữ, mờ…","Kaçınılacak öğeler (isteğe bağlı), ör. bozuk eller, filigran, metin, bulanıklık…"],
+ "已填入常用避坑词": ["Default negative prompt filled","定番のネガティブプロンプトを入力しました","Đã điền prompt phủ định mặc định","Varsayılan negatif istem dolduruldu"],
+ "5.5 / 5.0 · 火山方舟": ["5.5 / 5.0 · Volcano Ark","5.5 / 5.0 · Volcano Ark","5.5 / 5.0 · Volcano Ark","5.5 / 5.0 · Volcano Ark"],
+ "images/generations · JSON 多图(多数中转 / FLUX.2 / Qwen)": ["images/generations · JSON multi-image (relays / FLUX.2 / Qwen)","images/generations · JSON 複数画像(中継 / FLUX.2 / Qwen)","images/generations · JSON nhiều ảnh (trung chuyển / FLUX.2 / Qwen)","images/generations · JSON çoklu görsel (aktarıcılar / FLUX.2 / Qwen)"],
+ "快捷预设": ["Quick presets","クイックプリセット","Cài đặt nhanh","Hızlı ön ayarlar"],
+ "FLUX.2 中转": ["FLUX.2 Relay","FLUX.2 中継","FLUX.2 Trung chuyển","FLUX.2 Aktarıcı"],
+ "Qwen-Image 编辑": ["Qwen-Image Edit","Qwen-Image 編集","Qwen-Image Chỉnh sửa","Qwen-Image Düzenleme"],
+ "Gemini 中转": ["Gemini Relay","Gemini 中継","Gemini Trung chuyển","Gemini Aktarıcı"],
+ "本机网关": ["Local Gateway","ローカルゲートウェイ","Cổng cục bộ","Yerel Ağ Geçidi"],
+ "v1.5.0:工作台升级无限空间画布(拖拽缩放、可注入提示词的便签与语义连线),新增多图同屏对比、三阶明度与剪影检查、造型方案与最新生图模型。": ["v1.5.0: Upgraded Studio to an Infinite Spatial Canvas (drag, zoom, prompt-linked sticky notes & semantic wires), plus Side-by-Side Compare, 3-tone Notan & Silhouette check, Studio Recipes, and latest image models.","v1.5.0:スタジオを無限キャンバス化(ドラッグ・ズーム・プロンプト連動付箋・セマンティック配線)。最大4枚比較、3階調明度&シルエット確認、レシピ保存、最新モデル対応も追加。","v1.5.0: Nâng cấp Studio thành Bảng vẽ Không gian Vô hạn (kéo thả, thu phóng, ghi chú nối prompt & dây dẫn ngữ nghĩa), thêm So sánh song song, kiểm tra sắc độ 3 bậc & bóng dáng, Công thức phối đồ và mô hình mới nhất.","v1.5.0: Stüdyo Sonsuz Uzamsal Tuvale yükseltildi (sürükleme, yakınlaştırma, istem bağlantılı yapışkan notlar ve semantik kablolar); Yan Yana Karşılaştırma, 3 ton Notan ve silüet kontrolü, Stüdyo Tarifleri ve en yeni modeller eklendi."],
+ "画布工具": ["Canvas tools","キャンバスツール","Công cụ bảng vẽ","Tuval araçları"],
+ "画布缩放与视图": ["Canvas zoom and view","キャンバスズームと表示","Thu phóng & góc nhìn","Tuval yakınlaştırma ve görünüm"],
+ "在画布添加导演便签(双击空白处也可添加)": ["Add an art-direction sticky note (or double-click canvas)","アートディレクション付箋を追加(空白ダブルクリックでも追加)","Thêm ghi chú đạo diễn (hoặc nhấp đúp vùng trống)","Sanat yönetimi notu ekle (veya boş tuvale çift tıkla)"],
+ "+ 便签": ["+ Note","+ 付箋","+ Ghi chú","+ Not"],
+ "一键整理画布排版": ["Auto-arrange canvas layout","キャンバスを自動整列","Tự động sắp xếp bố cục","Tuval düzenini otomatik hizala"],
+ "整理": ["Tidy","整列","Sắp xếp","Düzenle"],
+ "适配画布视野(0)": ["Fit canvas to view (0)","全体を表示(0)","Vừa khung nhìn (0)","Görünüme sığdır (0)"],
+ "适配": ["Fit","全体","Vừa khung","Sığdır"],
+ "显示或隐藏语义连线": ["Toggle semantic flow wires","セマンティック配線の表示切替","Bật/tắt dây dẫn ngữ nghĩa","Semantik akış kablolarını aç/kapat"],
+ "连线": ["Wires","配線","Dây nối","Kablolar"],
+ "缩小": ["Zoom out","縮小","Thu nhỏ","Uzaklaştır"],
+ "放大": ["Zoom in","拡大","Phóng to","Yakınlaştır"],
+ "重置为 100%": ["Reset to 100%","100% にリセット","Đặt lại 100%","%100'e sıfırla"],
+ "全屏专注画布": ["Zen focus canvas","集中フルキャンバス","Chế độ tập trung toàn màn hình","Odak tam ekran tuval"],
+ "专注": ["Focus","集中","Tập trung","Odak"],
+ "退出专注": ["Exit focus","集中を終了","Thoát tập trung","Odaktan çık"],
+ "切换视角": ["Switch angle","アングル切替","Đổi góc máy","Açı değiştir"],
+ "画布镜像预览": ["Mirror preview on canvas","キャンバス上で反転プレビュー","Lật gương xem trước trên bảng","Tuvalde ayna önizleme"],
+ "替换素材": ["Replace reference","素材を差し替え","Thay tư liệu","Referansı değiştir"],
+ "替换": ["Replace","差替","Thay","Değiştir"],
+ "换": ["Swap","替","Đổi","Değ"],
+ "拖拽调整卡片大小": ["Drag to resize card","ドラッグしてサイズ変更","Kéo để đổi kích thước thẻ","Kartı boyutlandırmak için sürükle"],
+ "将便签内容自动注入生图提示词": ["Auto-inject sticky note into image prompt","付箋の内容を生成プロンプトへ自動反映","Tự động chèn nội dung ghi chú vào prompt","Not içeriğini görsel istemine otomatik ekle"],
+ "↳ 提示词": ["↳ Prompt","↳ プロンプト","↳ Prompt","↳ İstem"],
+ "仅备注": ["Note only","メモのみ","Chỉ ghi chú","Yalnızca not"],
+ "删除便签": ["Delete note","付箋を削除","Xóa ghi chú","Notu sil"],
+ "画布便签": ["Canvas sticky note","キャンバス付箋","Ghi chú bảng vẽ","Tuval yapışkan notu"],
+ "写下光影、构图或情绪备注…": ["Write lighting, framing, or mood notes…","光・構図・雰囲気のメモを入力…","Viết ghi chú ánh sáng, bố cục hoặc cảm xúc…","Işık, kadraj veya atmosfer notları yaz…"],
+ "生成输出节点": ["Output preview node","出力プレビューノード","Nút xem trước đầu ra","Çıktı önizleme düğümü"],
+ "最新成品": ["Latest output","最新の生成結果","Kết quả mới nhất","Son çıktı"],
+ "输出预览": ["Output frame","出力プレビュー","Khung đầu ra","Çıktı çerçevesi"],
+ "最新生成结果": ["Latest generated result","最新の生成画像","Kết quả tạo mới nhất","Son oluşturulan görsel"],
+ "从画布生成": ["Generate","キャンバスから生成","Tạo từ bảng","Tuvalden üret"],
+ "再生成": ["Regenerate","再生成","Tạo lại","Yeniden üret"],
+ "默认": ["Default","標準","Mặc định","Varsayılan"],
+ "在无限画布添加便签": ["Add sticky note on infinite canvas","無限キャンバスに付箋を追加","Thêm ghi chú trên bảng vẽ vô hạn","Sonsuz tuvale yapışkan not ekle"],
+ "整理无限画布并适配视野": ["Tidy infinite canvas & fit view","無限キャンバスを整列して全体表示","Sắp xếp bảng vẽ vô hạn & vừa khung","Sonsuz tuvali düzenle ve görünüme sığdır"],
+ "进入全屏专注画布": ["Enter Zen focus canvas","集中フルキャンバスに入る","Vào chế độ tập trung toàn bảng vẽ","Odak tam ekran tuvale gir"],
+ "退出专注画布": ["Exit Zen focus canvas","集中フルキャンバスを終了","Thoát chế độ tập trung bảng vẽ","Odak tam ekran tuvalden çık"],
};
const formats = [
@@ -817,13 +936,24 @@
[/^已完成 (\d+) 张参考练习(每张 (\d+) (秒|分钟))$/, (m,t,loc) => loc==='en' ? 'Completed '+m[1]+' references ('+m[2]+(m[3]==='分钟'?' min':' s')+' each)' : loc==='vi' ? 'Đã hoàn thành '+m[1]+' ảnh tham chiếu ('+m[2]+(m[3]==='分钟'?' phút':' giây')+' mỗi ảnh)' : loc==='tr' ? m[1]+' referans tamamlandı (her biri '+m[2]+(m[3]==='分钟'?' dk':' sn')+')' : m[1]+'枚の練習が完了しました(1枚 '+m[2]+(m[3]==='分钟'?'分':'秒')+')'],
[/^搜索「(.+)」$/, (m,t,loc) => loc==='en' ? 'Search "'+m[1]+'"' : loc==='vi' ? 'Tìm "'+m[1]+'"' : loc==='tr' ? '"'+m[1]+'" ara' : '「'+m[1]+'」を検索'],
[/^复制 (#[0-9A-F]{6})$/, (m,t,loc) => loc==='en' ? 'Copy '+m[1] : loc==='vi' ? 'Sao chép '+m[1] : loc==='tr' ? m[1]+' kopyala' : m[1]+' をコピー'],
+ [/^已载入方案「(.+)」$/, (m,t,loc) => loc==='en' ? 'Loaded recipe "'+m[1]+'"' : loc==='vi' ? 'Đã tải công thức "'+m[1]+'"' : loc==='tr' ? '"'+m[1]+'" tarifi yüklendi' : 'レシピ「'+m[1]+'」を読み込みました'],
+ [/^(\d+) 项参考$/, (m,t,loc) => loc==='en' ? m[1]+' refs' : loc==='vi' ? m[1]+' tham chiếu' : loc==='tr' ? m[1]+' referans' : '参考 '+m[1]+'件'],
+ [/^(\d+) 项输入 · (\d+) 张$/, (m,t,loc) => loc==='en' ? m[1]+' refs · '+m[2]+' img' : loc==='vi' ? m[1]+' đầu vào · '+m[2]+' ảnh' : loc==='tr' ? m[1]+' girdi · '+m[2]+' görsel' : '入力 '+m[1]+'件 · '+m[2]+'枚'],
+ [/^(\d+) 项参考 · (.+)$/, (m,t,loc) => {
+ const rest = m[2].split(' · ').map(t).join(' · ');
+ return (loc==='en' ? m[1]+' refs' : loc==='vi' ? m[1]+' tham chiếu' : loc==='tr' ? m[1]+' referans' : '参考 '+m[1]+'件') + ' · ' + rest;
+ }],
+ [/^已导出 (\d+) 个方案$/, (m,t,loc) => loc==='en' ? 'Exported '+m[1]+' recipes' : loc==='vi' ? 'Đã xuất '+m[1]+' công thức' : loc==='tr' ? m[1]+' tarif dışa aktarıldı' : m[1]+'件のレシピを書き出しました'],
+ [/^已导入 (\d+) 个方案$/, (m,t,loc) => loc==='en' ? 'Imported '+m[1]+' recipes' : loc==='vi' ? 'Đã nhập '+m[1]+' công thức' : loc==='tr' ? m[1]+' tarif içe aktarıldı' : m[1]+'件のレシピを読み込みました'],
+ [/^已应用 (.+) 预设,请填入 API Key$/, (m,t,loc) => loc==='en' ? 'Applied '+t(m[1])+' preset. Enter your API key.' : loc==='vi' ? 'Đã áp dụng cài đặt sẵn '+t(m[1])+'. Hãy nhập API Key.' : loc==='tr' ? t(m[1])+' ön ayarı uygulandı. API anahtarınızı girin.' : t(m[1])+' のプリセットを適用しました。API キーを入力してください。'],
+ [/^已应用 (.+) 预设,请填入你的中转 Base URL 与 API Key$/, (m,t,loc) => loc==='en' ? 'Applied '+t(m[1])+' preset. Enter your relay Base URL and API key.' : loc==='vi' ? 'Đã áp dụng cài đặt sẵn '+t(m[1])+'. Hãy nhập Base URL trung chuyển và API Key.' : loc==='tr' ? t(m[1])+' ön ayarı uygulandı. Aktarma Base URL ve API anahtarınızı girin.' : t(m[1])+' のプリセットを適用しました。中継 Base URL と API キーを入力してください。'],
];
const textState = new WeakMap();
const attributeState = new WeakMap();
const attributes = ['aria-label','placeholder','title','alt'];
// Gallery titles, prompts, search history and filenames are data, even when they match a UI label.
- const preserve = 'script,style,pre,textarea,[translate=no],[contenteditable=true],.pbox p,.card h3,.card .sub,.hinfo,.pick b,#pkG span,#lbSim a,#lbSim b,#lbSide h2,#skName,#trayText,.sgc [data-q],.seoc a[href*="/tag/"]';
+ const preserve = 'script,style,pre,textarea,[translate=no],[contenteditable=true],.pbox p,.card h3,.card .sub,.hinfo,.pick b,#pkG span,#lbSim a,#lbSim b,#lbSide h2,#skName,#trayText,.sgc [data-q],.seoc a[href*="/tag/"],.cmp-card h4,.recipe-name';
let locale = 'zh';
try {
const saved = localStorage.getItem('pwUiLocale');
@@ -859,7 +989,7 @@
for (const attr of attributes) {
// Reference images can have filenames and user-authored labels as their alternative text.
if (attr === 'alt' && !['wbAfter','wbBefore','tgViewImg'].includes(el.id)) continue;
- if (attr === 'title' && el.matches('.card h3,#pkG button,.pick b')) continue;
+ if (attr === 'title' && el.matches('.card h3,#pkG button,.pick b,.cmp-card h4,.recipe-name')) continue;
if (attr === 'aria-label' && el.matches('.card .phk')) continue;
const current = el.getAttribute(attr);
if (current === null) continue;
diff --git a/src/image-providers.js b/src/image-providers.js
index 29a2203..6bdf17e 100644
--- a/src/image-providers.js
+++ b/src/image-providers.js
@@ -5,22 +5,30 @@ window.PoseWearImageProviders = (() => {
const providers = {
openai: {
name: 'OpenAI', base: 'https://api.openai.com/v1', model: 'gpt-image-1',
- models: ['gpt-image-1', 'gpt-image-1-mini', 'gpt-image-2', 'dall-e-2']
+ models: ['gpt-image-2.5-sunburst', 'gpt-image-2.5-flare', 'gpt-image-2', 'gpt-image-1.5', 'gpt-image-1', 'gpt-image-1-mini', 'dall-e-2']
},
gemini: {
name: 'Gemini', base: 'https://generativelanguage.googleapis.com/v1beta', model: 'gemini-2.5-flash-image',
- models: ['gemini-2.5-flash-image', 'gemini-3-pro-image-preview', 'gemini-3.1-flash-image']
+ models: ['gemini-nano-banana-2.1', 'gemini-3.1-flash-image', 'gemini-3-pro-image', 'gemini-3.1-flash-lite-image', 'gemini-2.5-flash-image', 'gemini-3-pro-image-preview']
},
seedream: {
name: '豆包 Seedream', base: 'https://ark.cn-beijing.volces.com/api/v3', model: 'doubao-seedream-5-5-261028',
- models: ['doubao-seedream-5-5-261028', 'doubao-seedream-5-0-flash-260915', 'doubao-seedream-4-5-251128', 'doubao-seedream-4-0-250828']
+ models: ['doubao-seedream-5-5-261028', 'doubao-seedream-5-0-pro-260628', 'doubao-seedream-5-0-flash-260915', 'doubao-seedream-4-5-251128', 'doubao-seedream-4-0-250828']
},
custom: {
name: '自定义中转', base: '', model: 'gpt-image-1',
- models: ['gpt-image-1', 'gpt-image-2', 'grok-imagine-image-2.0', 'gemini-2.5-flash-image', 'flux-kontext-pro', 'qwen-image-edit', 'doubao-seedream-4-0-250828']
+ models: ['gpt-image-2.5-sunburst', 'gemini-nano-banana-2.1', 'flux-2-pro', 'flux-2-max', 'qwen-image-2.1', 'qwen-image-edit', 'grok-imagine-image-2.0', 'doubao-seedream-5-5-261028', 'gpt-image-2', 'flux-kontext-pro']
}
};
+ const relayPresets = [
+ { id: 'xai', label: 'xAI Grok', base: 'https://api.x.ai', proto: 'xai', model: 'grok-imagine-image-2.0', proxy: true },
+ { id: 'flux', label: 'FLUX.2 中转', base: '', proto: 'json', model: 'flux-2-pro', proxy: false },
+ { id: 'qwen', label: 'Qwen-Image 编辑', base: '', proto: 'json', model: 'qwen-image-2.1', proxy: false },
+ { id: 'gem', label: 'Gemini 中转', base: '', proto: 'gemini', model: 'gemini-nano-banana-2.1', proxy: false },
+ { id: 'localgw', label: '本机网关', base: 'http://127.0.0.1:8000/v1', proto: 'edits', model: 'gpt-image-1', proxy: false },
+ ];
+
const officialHost = /^(api\.openai\.com|generativelanguage\.googleapis\.com|ark\.[a-z0-9-]+\.(volces|bytepluses)\.com)$/;
const imageSizes = { '2:3': '1024x1536', '3:4': '1024x1536', '9:16': '1024x1536', '1:1': '1024x1024', '4:3': '1536x1024', '16:9': '1536x1024' };
const seedreamSizes = { auto: '1728x2304', '2:3': '1664x2496', '3:4': '1728x2304', '9:16': '1440x2560', '1:1': '2048x2048', '4:3': '2304x1728', '16:9': '2560x1440' };
@@ -290,5 +298,5 @@ window.PoseWearImageProviders = (() => {
}
}
- return { providers, generateImage, testConnection, nice };
+ return { providers, relayPresets, generateImage, testConnection, nice };
})();
diff --git a/src/index.html b/src/index.html
index c4b0332..ac79f2b 100644
--- a/src/index.html
+++ b/src/index.html
@@ -23,6 +23,34 @@
<script>try{document.documentElement.dataset.lang=JSON.parse(localStorage.lang||'"zh"');}catch(e){}</script>
</head>
<body>
+ <svg class="vh" aria-hidden="true" focusable="false">
+ <defs>
+ <filter id="pwNotan3" color-interpolation-filters="sRGB">
+ <feColorMatrix type="saturate" values="0"/>
+ <feComponentTransfer>
+ <feFuncR type="discrete" tableValues="0.09 0.48 0.93"/>
+ <feFuncG type="discrete" tableValues="0.09 0.48 0.93"/>
+ <feFuncB type="discrete" tableValues="0.09 0.48 0.93"/>
+ </feComponentTransfer>
+ </filter>
+ <filter id="pwSil" color-interpolation-filters="sRGB">
+ <feColorMatrix type="saturate" values="0"/>
+ <feComponentTransfer>
+ <feFuncR type="discrete" tableValues="0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.96"/>
+ <feFuncG type="discrete" tableValues="0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.96"/>
+ <feFuncB type="discrete" tableValues="0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.96"/>
+ </feComponentTransfer>
+ </filter>
+ <filter id="pwSilDepth" color-interpolation-filters="sRGB">
+ <feColorMatrix type="saturate" values="0"/>
+ <feComponentTransfer>
+ <feFuncR type="discrete" tableValues="0.08 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94"/>
+ <feFuncG type="discrete" tableValues="0.08 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94"/>
+ <feFuncB type="discrete" tableValues="0.08 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94"/>
+ </feComponentTransfer>
+ </filter>
+ </defs>
+ </svg>
<a class="skip" href="#grid">跳到内容</a>
<header class="top" id="top">
@@ -191,7 +219,7 @@
</article>
<article id="releaseNotice">
<strong>图库更新</strong>
- <p>新增速写定时练习、大图灰度与实拍取色板、画板导出拼图 PNG 及 ⌘K 命令面板。</p>
+ <p>v1.5.0:工作台升级无限空间画布(拖拽缩放、可注入提示词的便签与语义连线),新增多图同屏对比、三阶明度与剪影检查、造型方案与最新生图模型。</p>
</article>
<button id="help" class="notice-help" type="button">快捷键</button>
</section>
@@ -260,6 +288,7 @@
<header class="studio-head">
<h1 id="stT" tabindex="-1">创作工作台</h1>
<div class="studio-head-act">
+ <button id="wbRecipesBtn" class="sm ghost" type="button" title="已保存的造型方案与角色档案">方案<i id="wbRecipeN" hidden></i></button>
<button id="wbClearAll" class="sm ghost" type="button" hidden>清空素材</button>
<div class="seg modes" role="group" aria-label="工作模式">
<button data-mode="tryon">试穿</button>
@@ -340,17 +369,45 @@
<button type="button" data-cv="board" aria-pressed="false">参考画板</button>
<button type="button" data-cv="result" class="on" aria-pressed="true">生成结果</button>
</div>
- <button id="wbExportBoard" class="sm ghost" type="button" hidden title="导出参考拼图 PNG">导出拼图</button>
+ <div class="board-export-acts">
+ <button id="wbCopyBoard" class="sm ghost" type="button" hidden title="复制参考拼图到剪贴板">复制拼图</button>
+ <button id="wbExportBoard" class="sm ghost" type="button" hidden title="导出参考拼图 PNG">导出拼图</button>
+ </div>
<span id="wbCanvasRatio"></span>
</header>
<div class="stage" id="wbStage">
<div class="reference-board" id="wbPh0">
- <div class="board-cards" id="wbBoardCards"></div>
+ <div class="cv-viewport" id="wbCanvasVp">
+ <div class="cv-world" id="wbCanvasWorld">
+ <svg class="cv-wires" id="wbCanvasWires" aria-hidden="true"></svg>
+ <div class="board-cards" id="wbBoardCards"></div>
+ <div class="cv-notes" id="wbCanvasNotes"></div>
+ <div class="cv-outputs" id="wbCanvasOutputs"></div>
+ </div>
+ </div>
<div class="board-actions" id="wbBoardActions" hidden>
<button id="wbShuffle" type="button" class="board-use board-shuffle">换一组</button>
<button id="wbExample" type="button" class="board-use">使用这组参考</button>
</div>
+ <div class="cv-hud cv-hud-tl" id="wbCanvasTools" role="toolbar" aria-label="画布工具">
+ <button type="button" data-cv-act="note" title="在画布添加导演便签(双击空白处也可添加)">+ 便签</button>
+ <button type="button" data-cv-act="tidy" title="一键整理画布排版">整理</button>
+ <button type="button" data-cv-act="fit" title="适配画布视野(0)">适配</button>
+ <button type="button" data-cv-act="wires" class="on" aria-pressed="true" title="显示或隐藏语义连线">连线</button>
+ </div>
+ <div class="cv-hud cv-hud-br" id="wbCanvasZoom" role="toolbar" aria-label="画布缩放与视图">
+ <button type="button" data-cv-act="zout" aria-label="缩小" title="缩小">−</button>
+ <button type="button" data-cv-act="zreset" id="wbZoomPct" title="重置为 100%">100%</button>
+ <button type="button" data-cv-act="zin" aria-label="放大" title="放大">+</button>
+ <span class="cv-sep" aria-hidden="true"></span>
+ <button type="button" data-cv-act="zen" aria-pressed="false" title="全屏专注画布">专注</button>
+ </div>
+ <div class="cv-zen-bar" id="wbZenBar" hidden>
+ <button type="button" class="sm ghost" data-cv-act="zen">退出专注</button>
+ <span class="cv-zen-info" id="wbZenInfo"></span>
+ <button type="button" class="pri sm" id="wbZenGo">生成</button>
+ </div>
</div>
<div class="cmp" id="wbCmp" hidden>
@@ -418,6 +475,19 @@
</select>
</label>
</div>
+ <label class="lab shot-lab">镜头
+ <select id="wbShot">
+ <option value="auto">自动</option>
+ <option value="closeup">面部特写</option>
+ <option value="half">半身肖像</option>
+ <option value="cowboy">七分身</option>
+ <option value="full">全身构图</option>
+ <option value="lens85">85mm 虚化</option>
+ <option value="lens35">35mm 纪实</option>
+ <option value="low">低机位仰拍</option>
+ <option value="high">高机位俯拍</option>
+ </select>
+ </label>
</div>
</div>
@@ -431,6 +501,14 @@
</div>
<span class="sp"></span>
<button class="sm ghost" id="wbCopyP" type="button">复制</button>
+ <details class="fmt-menu" id="wbFmtMenu">
+ <summary class="sm ghost" title="导出到其他生图工具的提示词格式">更多格式</summary>
+ <div class="fmt-pop" role="menu">
+ <button type="button" data-fmt="mj" role="menuitem">Midjourney 格式</button>
+ <button type="button" data-fmt="sd" role="menuitem">SD / NovelAI 标签</button>
+ <button type="button" data-fmt="json" role="menuitem">结构化 JSON</button>
+ </div>
+ </details>
<button class="sm ghost" id="wbReP" type="button">重置</button>
</div>
</section>
@@ -447,6 +525,11 @@
<span><b>减少误拦截</b><small>用更中性的描述发送,减少正常穿搭被误判,不改变服装和姿势</small></span>
</label>
<textarea id="wbExtra" rows="2" placeholder="补充要求(可选),例如:海边日落、半身构图、手拿咖啡…"></textarea>
+ <div class="neg-head">
+ <label for="wbNeg">负向提示词 / 避坑词</label>
+ <button type="button" class="sm ghost" id="wbNegFill">填入常用</button>
+ </div>
+ <textarea id="wbNeg" rows="2" placeholder="不想出现的元素(可选),例如:畸形手指、水印、文字、模糊…"></textarea>
</div>
</details>
@@ -506,10 +589,15 @@
<div class="cfg-b">
<div class="grp">服务商</div>
<div class="prov" role="radiogroup" aria-label="服务商">
- <label><input type="radio" name="prov" value="openai"><span><i class="lg" style="background:#111">O</i><b>OpenAI</b><small>gpt-image-1 · edits</small></span></label>
- <label><input type="radio" name="prov" value="gemini"><span><i class="lg" style="background:#4f7cff">G</i><b>Gemini</b><small>Nano Banana</small></span></label>
- <label><input type="radio" name="prov" value="seedream"><span><i class="lg" style="background:#ff6a00">豆</i><b>豆包 Seedream</b><small>火山方舟 · 国内直连</small></span></label>
- <label><input type="radio" name="prov" value="custom"><span><i class="lg" style="background:#7a7a7a">中</i><b>自定义中转</b><small>OpenAI 兼容</small></span></label>
+ <label><input type="radio" name="prov" value="openai"><span><i class="lg" style="background:#111">O</i><b>OpenAI</b><small>GPT Image 2.5 / 1</small></span></label>
+ <label><input type="radio" name="prov" value="gemini"><span><i class="lg" style="background:#4f7cff">G</i><b>Gemini</b><small>Nano Banana 2.1 / Pro</small></span></label>
+ <label><input type="radio" name="prov" value="seedream"><span><i class="lg" style="background:#ff6a00">豆</i><b>豆包 Seedream</b><small>5.5 / 5.0 · 火山方舟</small></span></label>
+ <label><input type="radio" name="prov" value="custom"><span><i class="lg" style="background:#7a7a7a">中</i><b>自定义中转</b><small>FLUX.2 / Qwen / xAI</small></span></label>
+ </div>
+
+ <div class="cf-presets-w" id="cfPresetsW" hidden>
+ <div class="lab0">快捷预设</div>
+ <div class="chips" id="cfPresets"></div>
</div>
<details class="fine" id="cfLocalSetup">
@@ -533,7 +621,7 @@
<label class="fld" id="cfProtoW">接口协议
<select id="cfProto">
<option value="edits">images/edits · multipart(OpenAI 官方格式)</option>
- <option value="json">images/generations · JSON 多图(多数中转 / gpt-image-2)</option>
+ <option value="json">images/generations · JSON 多图(多数中转 / FLUX.2 / Qwen)</option>
<option value="xai">xAI · images/edits JSON(Grok Imagine)</option>
<option value="gemini">Gemini · models/:generateContent(Nano Banana 等)</option>
</select>
@@ -586,6 +674,7 @@
<div class="dock-heading">
<h3>参考素材</h3>
<small class="tg-empty" id="tgEmpty" hidden>尚未选材</small>
+ <button id="trayCmp" class="sm ghost" type="button" hidden title="同屏对比已选素材">对比</button>
<button id="trayClear" class="sm ghost">清空</button>
</div>
<div class="tray-items" id="trayItems"></div>
@@ -728,9 +817,12 @@
<button type="button" data-lt="grid" aria-pressed="false" title="构图参考线(G)">
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M9.5 4v16M14.5 4v16M4 9.5h16M4 14.5h16"/></svg><span>参考线</span>
</button>
- <button type="button" data-lt="gray" aria-pressed="false" title="灰度明度检查(B)">
+ <button type="button" data-lt="gray" aria-pressed="false" title="灰度 / 三阶明度(B)">
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8"/><path d="M12 4a8 8 0 0 1 0 16Z" fill="currentColor" stroke="none"/></svg><span>灰度</span>
</button>
+ <button type="button" data-lt="sil" aria-pressed="false" title="剪影轮廓检查(U)">
+ <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="2.5" fill="currentColor" stroke="none"/><path d="M8.5 20v-6l-2 1-1-2 4.5-3h4l4.5 3-1 2-2-1v6z" fill="currentColor" stroke="none"/></svg><span>剪影</span>
+ </button>
<button type="button" data-lt="cmp" aria-pressed="false" title="线稿与深度图对比(V)" hidden>
<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="14" rx="2"/><path d="M12 3v18M8 10l-2 2 2 2m8-4 2 2-2 2"/></svg><span>透视对比</span>
</button>
@@ -760,7 +852,8 @@
<dt><kbd>Z</kbd></dt><dd>大图:缩放细节</dd>
<dt><kbd>H</kbd></dt><dd>大图:镜像翻转</dd>
<dt><kbd>G</kbd></dt><dd>大图:构图参考线</dd>
- <dt><kbd>B</kbd></dt><dd>大图:灰度明度检查</dd>
+ <dt><kbd>B</kbd></dt><dd>大图:灰度 / 三阶明度</dd>
+ <dt><kbd>U</kbd></dt><dd>大图:剪影轮廓检查</dd>
<dt><kbd>V</kbd></dt><dd>大图:线稿与深度图对比</dd>
<dt><kbd>F</kbd></dt><dd>大图:收藏</dd>
<dt><kbd>A</kbd></dt><dd>大图:加入 / 移出组合</dd>
@@ -908,13 +1001,64 @@
<div class="sk-tools" role="toolbar" aria-label="速写辅助工具">
<button type="button" data-skt="flip" aria-pressed="false" title="镜像翻转(H)">镜像</button>
<button type="button" data-skt="grid" aria-pressed="false" title="构图参考线(G)">参考线</button>
- <button type="button" data-skt="gray" aria-pressed="false" title="灰度明度检查(B)">灰度</button>
+ <button type="button" data-skt="gray" aria-pressed="false" title="灰度 / 三阶明度(B)">灰度</button>
+ <button type="button" data-skt="sil" aria-pressed="false" title="剪影轮廓检查(U)">剪影</button>
<button type="button" data-skt="pair" aria-pressed="false" title="切换线稿与深度图(V)" hidden>深度图</button>
<button type="button" data-skt="fav" aria-pressed="false" title="收藏当前(F)">♡ 收藏</button>
</div>
</footer>
</div>
+ <!-- Side-by-Side Reference Compare Studio -->
+ <div id="cmpModal" hidden role="dialog" aria-modal="true" aria-label="同屏对比">
+ <div class="cmp-box">
+ <header class="cmp-head">
+ <div class="cmp-title">
+ <b>同屏对比</b>
+ <span id="cmpCount">2 / 4</span>
+ </div>
+ <div class="cmp-tools" role="toolbar" aria-label="同步查看工具">
+ <button type="button" data-ct="flip" aria-pressed="false" title="同步镜像翻转(H)"><span>镜像</span></button>
+ <button type="button" data-ct="grid" aria-pressed="false" title="同步构图参考线(G)"><span>参考线</span></button>
+ <button type="button" data-ct="gray" aria-pressed="false" title="同步灰度 / 三阶明度(B)"><span>灰度</span></button>
+ <button type="button" data-ct="sil" aria-pressed="false" title="同步剪影检查(U)"><span>剪影</span></button>
+ <button type="button" data-ct="pair" aria-pressed="false" title="同步切换线稿与深度图(V)" hidden><span>深度图</span></button>
+ </div>
+ <button type="button" id="cmpClose" class="icon" title="关闭(Esc)" aria-label="关闭">✕</button>
+ </header>
+ <div class="cmp-grid" id="cmpGrid"></div>
+ </div>
+ </div>
+
+ <!-- Saved Character & Scene Recipes Dialog -->
+ <div id="recipeBox" hidden role="dialog" aria-modal="true" aria-labelledby="rcpT">
+ <div class="rcp-box">
+ <div class="pk-h">
+ <b id="rcpT">造型方案</b>
+ <span id="rcpCount" class="mu"></span>
+ <span class="sp"></span>
+ <button class="icon" id="rcpX" aria-label="关闭">✕</button>
+ </div>
+ <div class="rcp-save">
+ <input id="rcpName" type="text" maxlength="48" placeholder="给当前搭配命名…" autocomplete="off" aria-label="方案名称">
+ <button type="button" id="rcpSave" class="pri sm">保存当前</button>
+ </div>
+ <p class="fine rcp-note" id="rcpLocalNote" hidden>提示:本地上传的照片仅在本次会话保留,方案会保存图库参考与提示词设置。</p>
+ <div class="rcp-body">
+ <div id="rcpList" class="rcp-list"></div>
+ <div id="rcpEmpty" class="rcp-empty" hidden>
+ <p>还没有保存的造型方案</p>
+ <small>将常用的人物、服装、场景与风格保存为方案,随时一键切换或保留姿势换角。</small>
+ </div>
+ </div>
+ <div class="cfg-f">
+ <button type="button" class="ghost sm" id="rcpExp">导出方案</button>
+ <button type="button" class="ghost sm" id="rcpImp">导入</button>
+ <input type="file" id="rcpImpF" accept=".json" hidden>
+ </div>
+ </div>
+ </div>
+
<!-- Global Command Palette -->
<div id="cmdPal" hidden role="dialog" aria-modal="true" aria-label="命令面板">
<div class="cmd-box">
@@ -939,10 +1083,13 @@
<script src="app.js" defer></script>
<script src="sketch.js" defer></script>
<script src="command-palette.js" defer></script>
+ <script src="compare.js" defer></script>
<script src="zip.js" defer></script>
<script src="extras.js" defer></script>
<script src="image-providers.js" defer></script>
<script src="board-export.js" defer></script>
+ <script src="recipes.js" defer></script>
+ <script src="canvas.js" defer></script>
<script src="studio.js" defer></script>
<script src="history.js" defer></script>
</body>
diff --git a/src/recipes.js b/src/recipes.js
new file mode 100644
index 0000000..1a1e1bf
--- /dev/null
+++ b/src/recipes.js
@@ -0,0 +1,323 @@
+'use strict';
+(() => {
+ // Named Character & Scene Recipes (造型方案 / 角色档案) stored in localStorage['wbRecipes'].
+ // Lets artists save, load, keep-pose-swap, and JSON-backup reusable character/outfit/scene sets.
+ const C = window.PoseWearCatalog;
+ if (!C) return;
+ const { $, esc, readLS: LS, writeLS: SV } = C;
+
+ const KEY = 'wbRecipes';
+ const MAX_RECIPES = 60;
+ let studioApi = null;
+ let prevFocus = null;
+ let recipes = [];
+
+ function loadStore() {
+ const raw = LS(KEY);
+ recipes = Array.isArray(raw) ? raw.filter(r => r && typeof r.id === 'string' && typeof r.name === 'string') : [];
+ }
+
+ function saveStore() {
+ SV(KEY, recipes.slice(0, MAX_RECIPES));
+ updateBadge();
+ }
+
+ function updateBadge() {
+ const badge = $('#wbRecipeN');
+ if (!badge) return;
+ badge.hidden = !recipes.length;
+ badge.textContent = recipes.length ? String(recipes.length) : '';
+ }
+
+ function allKeysOf(refs) {
+ if (!refs) return [];
+ const list = [
+ ...(refs.r || []),
+ ...(refs.g || []),
+ ...(refs.p || []),
+ ...(refs.e || []),
+ ...(refs.x || []),
+ ];
+ return list.map(entry => (Array.isArray(entry) ? entry[0] : entry)).filter(k => typeof k === 'string');
+ }
+
+ function refCount(refs) {
+ return allKeysOf(refs).length;
+ }
+
+ function refEntries(refs) {
+ if (!refs) return [];
+ const out = [];
+ for (const key of refs.r || []) out.push({ k: key });
+ for (const g of refs.g || []) out.push(Array.isArray(g) ? { k: g[0], ai: g[1] } : { k: g });
+ for (const p of refs.p || []) out.push(Array.isArray(p) ? { k: p[0], ai: p[1] } : { k: p });
+ for (const e of refs.e || []) out.push(Array.isArray(e) ? { k: e[0], ai: e[1] } : { k: e });
+ for (const x of refs.x || []) out.push(Array.isArray(x) ? { k: x[0], ai: x[1] } : { k: x });
+ return out;
+ }
+
+ function suggestName(snap) {
+ const A = window.APP;
+ if (!A) return '我的造型方案';
+ const entries = refEntries(snap.refs);
+ const names = [];
+ for (const ref of entries) {
+ const it = A.ITEMS[ref.k];
+ if (!it) continue;
+ const t = A.title(it);
+ if (t && !names.includes(t)) names.push(t);
+ if (names.length >= 2) break;
+ }
+ return names.length ? names.join(' · ') : '我的造型方案';
+ }
+
+ function renderList() {
+ const listEl = $('#rcpList');
+ const emptyEl = $('#rcpEmpty');
+ const countEl = $('#rcpCount');
+ if (!listEl) return;
+ const A = window.APP;
+ if (countEl) countEl.textContent = recipes.length ? `${recipes.length} / ${MAX_RECIPES}` : '';
+
+ if (!recipes.length) {
+ listEl.innerHTML = '';
+ if (emptyEl) emptyEl.hidden = false;
+ return;
+ }
+ if (emptyEl) emptyEl.hidden = true;
+
+ const hasCurrentPose = !!(studioApi && studioApi.hasPoses());
+
+ listEl.innerHTML = recipes
+ .map(r => {
+ const entries = refEntries(r.refs);
+ const thumbs = entries
+ .slice(0, 4)
+ .map(ref => {
+ const it = A?.ITEMS[ref.k];
+ if (!it) return '';
+ const src = it.angles ? A.ath(it.angles[ref.ai ?? it.ai]?.t || it.angles[0].t) : A.thumb(it);
+ return `<img src="${esc(src)}" alt=""${it.ref ? ` referrerpolicy="${esc(it.ref)}"` : ''}>`;
+ })
+ .filter(Boolean)
+ .join('');
+ const count = refCount(r.refs);
+ const dt = new Date(r.t || Date.now());
+ const stamp = `${dt.getMonth() + 1}/${dt.getDate()} ${String(dt.getHours()).padStart(2, '0')}:${String(dt.getMinutes()).padStart(2, '0')}`;
+ const hasChar = (r.refs?.r?.length || 0) + (r.refs?.g?.length || 0) + (r.refs?.e?.length || 0) + (r.refs?.x?.length || 0) > 0;
+ const keepPoseBtn = hasCurrentPose && hasChar
+ ? `<button type="button" class="sm ghost" data-rcp-keep="${esc(r.id)}" title="保留当前工作台姿势,只换角色与服饰">保留当前姿势</button>`
+ : '';
+ return (
+ `<article class="rcp-item" data-rcp="${esc(r.id)}">` +
+ `<div class="rcp-thumbs">${thumbs || '<span class="rcp-ph">Aa</span>'}</div>` +
+ `<div class="rcp-meta">` +
+ `<b class="recipe-name" title="${esc(r.name)}">${esc(r.name)}</b>` +
+ `<small>${count ? `${count} 项参考` : '纯提示词'}${r.ar && r.ar !== 'auto' ? ' · ' + esc(r.ar) : ''} · ${esc(stamp)}</small>` +
+ `</div>` +
+ `<div class="rcp-act">` +
+ `<button type="button" class="sm pri" data-rcp-load="${esc(r.id)}">载入</button>` +
+ `${keepPoseBtn}` +
+ `<button type="button" class="sm ghost rcp-del" data-rcp-del="${esc(r.id)}" aria-label="删除" title="删除">×</button>` +
+ `</div></article>`
+ );
+ })
+ .join('');
+ }
+
+ async function open(opener = document.activeElement) {
+ const box = $('#recipeBox');
+ if (!box || !studioApi) return;
+ loadStore();
+ prevFocus = opener;
+ const snap = studioApi.snapshot();
+ const input = $('#rcpName');
+ if (input) {
+ input.value = '';
+ input.placeholder = suggestName(snap);
+ }
+ const localNote = $('#rcpLocalNote');
+ if (localNote) localNote.hidden = !snap.hasLocalUploads;
+
+ const saveBtn = $('#rcpSave');
+ if (saveBtn) saveBtn.disabled = !refCount(snap.refs) && !snap.prompt && !snap.extra;
+
+ box.hidden = false;
+ document.body.style.overflow = 'hidden';
+ renderList();
+
+ const keys = [...new Set(recipes.flatMap(r => allKeysOf(r.refs)))];
+ if (keys.length && window.APP?.needKeys) {
+ window.APP.needKeys(keys)
+ .then(() => {
+ if (!box.hidden) renderList();
+ })
+ .catch(() => {});
+ }
+ input?.focus({ preventScroll: true });
+ }
+
+ function close() {
+ const box = $('#recipeBox');
+ if (!box || box.hidden) return;
+ box.hidden = true;
+ document.body.style.overflow = '';
+ if (prevFocus?.isConnected) prevFocus.focus({ preventScroll: true });
+ prevFocus = null;
+ }
+
+ function saveCurrent() {
+ if (!studioApi) return;
+ const snap = studioApi.snapshot();
+ if (!refCount(snap.refs) && !snap.prompt && !snap.extra) {
+ window.APP?.toast('请先选择参考素材或输入提示词');
+ return;
+ }
+ const input = $('#rcpName');
+ const name = (input?.value || '').trim() || suggestName(snap);
+ const entry = {
+ id: 'r_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 6),
+ name: name.slice(0, 48),
+ t: Date.now(),
+ mode: snap.mode,
+ style: snap.style,
+ shot: snap.shot,
+ ar: snap.ar,
+ pl: snap.pl,
+ extra: snap.extra,
+ neg: snap.neg,
+ prompt: snap.prompt,
+ refs: snap.refs,
+ };
+ recipes.unshift(entry);
+ if (recipes.length > MAX_RECIPES) recipes.length = MAX_RECIPES;
+ saveStore();
+ if (input) input.value = '';
+ renderList();
+ window.APP?.toast(snap.hasLocalUploads ? '已保存方案(本地上传图仅限本次会话)' : '已保存造型方案');
+ }
+
+ async function applyRecipe(id, keepCurrentPose = false) {
+ const target = recipes.find(r => r.id === id);
+ if (!target || !studioApi) return;
+ close();
+ await studioApi.applyRecipe(target, { keepCurrentPose });
+ window.APP?.toast(keepCurrentPose ? '已套用方案并保留当前姿势' : `已载入方案「${target.name}」`);
+ }
+
+ function deleteRecipe(id) {
+ const idx = recipes.findIndex(r => r.id === id);
+ if (idx < 0) return;
+ const [removed] = recipes.splice(idx, 1);
+ saveStore();
+ renderList();
+ window.APP?.toast('已删除方案', () => {
+ recipes.splice(Math.min(idx, recipes.length), 0, removed);
+ saveStore();
+ if (!$('#recipeBox')?.hidden) renderList();
+ });
+ }
+
+ function exportJson() {
+ if (!recipes.length) return window.APP?.toast('还没有已保存的方案');
+ const blob = new Blob(
+ [JSON.stringify({ app: '衣姿 PoseWear', type: 'studio-recipes', exportedAt: new Date().toISOString(), recipes }, null, 2)],
+ { type: 'application/json' }
+ );
+ window.X?.dl?.(blob, `posewear-recipes-${new Date().toISOString().slice(0, 10)}.json`);
+ window.APP?.toast(`已导出 ${recipes.length} 个方案`);
+ }
+
+ async function importJson(file) {
+ if (!file) return;
+ try {
+ const parsed = JSON.parse(await file.text());
+ const incoming = Array.isArray(parsed.recipes) ? parsed.recipes : Array.isArray(parsed) ? parsed : null;
+ if (!incoming) throw Error('invalid');
+ const existingIds = new Set(recipes.map(r => r.id));
+ let added = 0;
+ for (const item of incoming) {
+ if (!item || typeof item.name !== 'string' || !item.refs || typeof item.refs !== 'object') continue;
+ const id = typeof item.id === 'string' && !existingIds.has(item.id)
+ ? item.id
+ : 'r_' + Date.now().toString(36) + '_' + Math.random().toString(36).slice(2, 6);
+ existingIds.add(id);
+ recipes.unshift({
+ id,
+ name: item.name.slice(0, 48),
+ t: Number(item.t) || Date.now(),
+ mode: item.mode === 'tryon' ? 'tryon' : 'gen',
+ style: typeof item.style === 'string' ? item.style : 'keep',
+ shot: typeof item.shot === 'string' ? item.shot : 'auto',
+ ar: typeof item.ar === 'string' ? item.ar : 'auto',
+ pl: item.pl === 'zh' ? 'zh' : 'en',
+ extra: typeof item.extra === 'string' ? item.extra : '',
+ neg: typeof item.neg === 'string' ? item.neg : '',
+ prompt: typeof item.prompt === 'string' ? item.prompt : null,
+ refs: {
+ r: Array.isArray(item.refs.r) ? item.refs.r : [],
+ g: Array.isArray(item.refs.g) ? item.refs.g : [],
+ p: Array.isArray(item.refs.p) ? item.refs.p : [],
+ e: Array.isArray(item.refs.e) ? item.refs.e : [],
+ x: Array.isArray(item.refs.x) ? item.refs.x : [],
+ },
+ });
+ added++;
+ }
+ if (recipes.length > MAX_RECIPES) recipes.length = MAX_RECIPES;
+ saveStore();
+ renderList();
+ const keys = [...new Set(recipes.flatMap(r => allKeysOf(r.refs)))];
+ if (keys.length && window.APP?.needKeys) window.APP.needKeys(keys).then(renderList).catch(() => {});
+ window.APP?.toast(`已导入 ${added} 个方案`);
+ } catch {
+ window.APP?.toast('导入失败:文件格式不正确');
+ }
+ }
+
+ function isOpen() {
+ const box = $('#recipeBox');
+ return !!(box && !box.hidden);
+ }
+
+ function init(api) {
+ studioApi = api;
+ loadStore();
+ updateBadge();
+
+ $('#wbRecipesBtn')?.addEventListener('click', e => open(e.currentTarget));
+ $('#rcpX')?.addEventListener('click', close);
+ $('#rcpSave')?.addEventListener('click', saveCurrent);
+ $('#rcpName')?.addEventListener('keydown', e => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ saveCurrent();
+ }
+ });
+ $('#rcpExp')?.addEventListener('click', exportJson);
+ $('#rcpImp')?.addEventListener('click', () => $('#rcpImpF')?.click());
+ $('#rcpImpF')?.addEventListener('change', async e => {
+ await importJson(e.target.files?.[0]);
+ e.target.value = '';
+ });
+
+ $('#recipeBox')?.addEventListener('click', e => {
+ if (e.target.id === 'recipeBox') return close();
+ const loadBtn = e.target.closest('[data-rcp-load]');
+ if (loadBtn) return applyRecipe(loadBtn.dataset.rcpLoad, false);
+ const keepBtn = e.target.closest('[data-rcp-keep]');
+ if (keepBtn) return applyRecipe(keepBtn.dataset.rcpKeep, true);
+ const delBtn = e.target.closest('[data-rcp-del]');
+ if (delBtn) return deleteRecipe(delBtn.dataset.rcpDel);
+ });
+ }
+
+ window.PoseWearRecipes = {
+ init,
+ open,
+ close,
+ isOpen,
+ count: () => recipes.length,
+ list: () => recipes.slice(),
+ };
+})();
diff --git a/src/sketch.js b/src/sketch.js
index 6bb9ad4..4503025 100644
--- a/src/sketch.js
+++ b/src/sketch.js
@@ -22,7 +22,8 @@
sound: false,
flip: false,
grid: 0,
- gray: false,
+ gray: 0,
+ sil: false,
pair: false,
timer: null,
actx: null,
@@ -68,7 +69,9 @@
const gridEl = $('#skGrid');
if (frame) {
frame.classList.toggle('flipped', state.flip);
- frame.classList.toggle('gray', state.gray);
+ frame.classList.toggle('gray', state.gray > 0);
+ frame.classList.toggle('notan', state.gray === 2);
+ frame.classList.toggle('sil', state.sil);
}
if (gridEl) gridEl.dataset.mode = ['', 'thirds', 'cross'][state.grid] || '';
@@ -80,7 +83,8 @@
};
setActive('flip', state.flip);
setActive('grid', state.grid > 0);
- setActive('gray', state.gray);
+ setActive('gray', state.gray > 0);
+ setActive('sil', state.sil);
setActive('pair', state.pair);
const favBtn = $('#sketch [data-skt="fav"]');
@@ -103,7 +107,15 @@
const grayBtn = $('#sketch [data-skt="gray"]');
const shown = state.pair && mate ? mate.item : it;
- if (grayBtn) grayBtn.hidden = !shown || shown.type === 'pose' || shown.type === 'depth';
+ if (grayBtn) {
+ const mono = !shown || shown.type === 'pose' || shown.type === 'depth';
+ grayBtn.hidden = mono;
+ if (mono && state.gray) {
+ state.gray = 0;
+ frame?.classList.remove('gray', 'notan');
+ }
+ grayBtn.textContent = state.gray === 2 ? '明度块面' : '灰度';
+ }
const soundBtn = $('#skSound');
if (soundBtn) {
@@ -230,7 +242,8 @@
state.seen = [];
state.flip = false;
state.grid = 0;
- state.gray = false;
+ state.gray = 0;
+ state.sil = false;
state.pair = false;
state.open = true;
state.paused = false;
@@ -267,6 +280,22 @@
state.prevFocus = null;
}
+ function toggleGray() {
+ const it = state.deck[state.i];
+ const mate = it && app.poseCounterpart(it);
+ const shown = state.pair && mate ? mate.item : it;
+ if (!shown || shown.type === 'pose' || shown.type === 'depth') return;
+ state.sil = false;
+ state.gray = (state.gray + 1) % 3;
+ renderTools();
+ }
+
+ function toggleSil() {
+ state.sil = !state.sil;
+ if (state.sil) state.gray = 0;
+ renderTools();
+ }
+
function handleKey(e) {
if (!state.open) return false;
const k = (e.key || '').toLowerCase();
@@ -276,7 +305,8 @@
else if (e.key === 'ArrowLeft') { e.preventDefault(); step(-1); }
else if (k === 'h') { state.flip = !state.flip; renderTools(); }
else if (k === 'g') { state.grid = (state.grid + 1) % 3; renderTools(); }
- else if (k === 'b') { state.gray = !state.gray; renderTools(); }
+ else if (k === 'b') toggleGray();
+ else if (k === 'u') toggleSil();
else if (k === 'v') {
const it = state.deck[state.i];
if (it && app.poseCounterpart(it)) {
@@ -351,7 +381,8 @@
const it = state.deck[state.i];
if (action === 'flip') state.flip = !state.flip;
else if (action === 'grid') state.grid = (state.grid + 1) % 3;
- else if (action === 'gray') state.gray = !state.gray;
+ else if (action === 'gray') return toggleGray();
+ else if (action === 'sil') return toggleSil();
else if (action === 'pair' && it && app.poseCounterpart(it)) {
state.pair = !state.pair;
showCard();
diff --git a/src/studio.js b/src/studio.js
index fdb7337..d031f1c 100644
--- a/src/studio.js
+++ b/src/studio.js
@@ -13,7 +13,7 @@
const toast = A.toast;
// ---------- Image Generation Providers ----------
- const { providers, generateImage, testConnection, nice } = window.PoseWearImageProviders;
+ const { providers, relayPresets = [], generateImage, testConnection, nice } = window.PoseWearImageProviders;
const PROV = { ...providers };
const localEngine = document.documentElement.dataset.localEngine;
const localPreset = document.documentElement.dataset.localPreset === '1';
@@ -63,8 +63,31 @@
['ecom', '电商白底', 'e-commerce product-model photo, pure white background, even lighting, full body', '电商模特图,纯白背景,均匀布光,全身构图'],
['film', '胶片氛围', '35mm film photograph, warm tones, subtle grain, golden hour light', '35mm 胶片摄影,暖色调,轻微颗粒,黄金时刻光线'],
['anime', '动漫插画', 'high-quality anime illustration, clean line art, soft cel shading', '高质量动漫插画,干净线稿,柔和赛璐璐上色'],
+ ['magazine', '杂志画报', 'high-fashion editorial magazine photography, crisp studio lighting, refined color grading', '时尚杂志画报摄影,精致布光,高级调色质感'],
+ ['concept', '游戏原画', '2.5D stylized game concept art illustration, painterly brushwork, dramatic rim light, rich detail', '2.5D 游戏原画立绘,厚涂笔触,戏剧性轮廓光,精致细节'],
+ ['sheet', '角色三视图', 'character reference turnaround sheet on clean neutral backdrop showing front, side, and back views with consistent proportions and outfit details', '角色设定集三视图,纯色干净背景,同一角色的正面、侧面与背面展示,比例与服饰细节完全一致'],
+ ['manga', '黑白漫画', 'Japanese monochrome manga illustration, crisp ink linework, halftone screentones, dramatic contrast', '日式黑白漫画插画,利落墨线,经典网点纸质感,高反差光影'],
+ ['figurine', '3D 手办', 'collectible matte vinyl designer figurine render, soft studio global illumination, clean miniature scale', '3D 潮玩手办渲染,柔和全局光照,细腻哑光质感'],
+ ['cyber', '霓虹夜色', 'cinematic night street scene, cyan and magenta neon reflections on wet pavement, moody atmospheric depth', '赛博霓虹夜景,湿润街道霓虹倒影,电影级冷暖反差氛围'],
];
+ const SHOTS = {
+ auto: ['', ''],
+ closeup: ['tight close-up portrait framing focused on face and expression', '面部特写构图,聚焦五官与神态'],
+ half: ['medium close-up waist-up portrait framing', '半身肖像构图,腰部以上取景'],
+ cowboy: ['cowboy shot framed from mid-thigh up', '七分身构图,大腿中部以上取景'],
+ full: ['full-body framing showing head to shoes with clean headroom', '全身构图,完整呈现头顶至鞋履'],
+ lens85: ['85mm portrait lens perspective with creamy shallow depth of field', '85mm 人像镜头透视,奶油般浅景深虚化'],
+ lens35: ['35mm wide documentary lens capturing subject and surrounding environment', '35mm 纪实广角镜头,兼顾人物与环境层次'],
+ low: ['low-angle hero shot looking slightly upward for dynamic presence', '低机位仰拍视角,增强人物气场与修长比例'],
+ high: ['high-angle shot looking down from above with clear spatial depth', '高机位俯拍视角,强化画面空间纵深'],
+ };
+
+ const DEFAULT_NEG = {
+ en: 'malformed hands, extra fingers, fused limbs, distorted anatomy, watermark, text, logo, blurry, low quality',
+ zh: '畸形手指、多余肢体、人体比例失真、水印、文字、边框、模糊、低画质',
+ };
+
const ANG_EN = {
正面: 'front view',
斜侧: 'three-quarter view',
@@ -88,6 +111,7 @@
char: LS('wbChar') || 'asia',
charTxt: LS('wbCharTxt') || '',
style: LS('wbStyle') || 'keep',
+ shot: LS('wbShot') || 'auto',
bm: LS('wbBm') || 'each',
pl: LS('wbPl') || 'en',
keepBg: LS('wbKeepBg') ?? true,
@@ -102,17 +126,20 @@
const g0 = LS('wbSel') || {};
const savedDraft = LS('wbDraft');
if (savedDraft) {
- $('#wbExtra').value = savedDraft.extra;
+ $('#wbExtra').value = savedDraft.extra || '';
+ if ($('#wbNeg')) $('#wbNeg').value = savedDraft.neg || '';
$('#wbN').value = savedDraft.count;
$('#wbAR').value = savedDraft.ratio;
W.dirty = savedDraft.prompt != null;
if (W.dirty) $('#wbPrompt').value = savedDraft.prompt;
}
+ if ($('#wbShot') && Object.hasOwn(SHOTS, W.shot)) $('#wbShot').value = W.shot;
function saveDraft() {
SV('wbDraft', {
prompt: W.dirty ? $('#wbPrompt').value : null,
extra: $('#wbExtra').value,
+ neg: $('#wbNeg')?.value || '',
count: $('#wbN').value,
ratio: $('#wbAR').value,
});
@@ -258,8 +285,13 @@
const np = groups.length;
const sheet = np > 1 && state.bm === 'sheet';
const style = STYLES.find(s => s[0] === state.style) || STYLES[0];
+ const shotEntry = SHOTS[state.shot || 'auto'] || SHOTS.auto;
+ const shotText = shotEntry[en ? 0 : 1];
const ch = CHARS.find(c => c[0] === state.char) || CHARS[0];
- const extra = state.extra ?? $('#wbExtra').value.trim();
+ const baseExtra = state.extra ?? $('#wbExtra').value.trim();
+ const noteExtra = state === W ? (window.PoseWearCanvas?.linkedNotesText?.() || '') : '';
+ const extra = [baseExtra, noteExtra].filter(Boolean).join('\n');
+ const neg = state.neg ?? ($('#wbNeg')?.value || '').trim();
const garmentItems = state.garments.map(g => g.kind === 'lib' && A.ITEMS[g.k]).filter(Boolean);
let seq = 0;
@@ -288,9 +320,11 @@
if (!(P || G || np || E)) {
if (state.mode === 'gen' && state.char === 'custom' && state.charTxt.trim()) materials.unshift(state.charTxt.trim());
- if (!materials.length) return extra;
+ if (!materials.length) return [extra, neg ? (en ? 'Avoid: ' + neg : '避免:' + neg) : ''].filter(Boolean).join('\n');
if (state.dirtyStyle) materials.push(style[en ? 2 : 3]);
+ if (shotText) materials.push(en ? `Camera: ${shotText}.` : `镜头:${shotText}。`);
if (extra) materials.push(extra);
+ if (neg) materials.push(en ? `Avoid: ${neg}` : `避免:${neg}`);
return materials.join('\n');
}
@@ -322,8 +356,10 @@
lines.push(`Expression: ${rE} shows the target expression (${exprItem.en}). Transfer the expression only.${P ? ' Preserve the facial features and identity from the person photo.' : ''}`);
}
lines.push(...materials);
+ if (shotText) lines.push(`Camera: ${shotText}.`);
lines.push(`Look: ${keepBackground ? 'keep the original background and lighting of the photo; ' : ''}${style[2]}.${G ? ' Natural fabric drape with realistic folds and shadows.' : ''} High detail. No text, no watermark, no borders.`);
if (extra) lines.push('Additional: ' + extra);
+ if (neg) lines.push('Avoid: ' + neg);
} else {
lines.push(
P
@@ -347,8 +383,10 @@
lines.push(`表情:${rE} 展示目标表情(${exprItem.zh})。只迁移神态。${P ? '保留人物照片中的五官、脸型和身份。' : ''}`);
}
lines.push(...materials);
+ if (shotText) lines.push(`镜头:${shotText}。`);
lines.push(`画面:${keepBackground ? '保留原照片的背景与光线;' : ''}${style[3]}。${G ? '衣物垂坠自然,褶皱阴影真实。' : ''}高细节。不要文字、水印或边框。`);
if (extra) lines.push('补充:' + extra);
+ if (neg) lines.push('避免:' + neg);
}
return lines.join('\n');
}
@@ -414,10 +452,19 @@
$('#wbOutAct').hidden = !showResult;
const sent = $('#wbSentD');
if (sent) sent.hidden = !showResult || !W.results[W.ri]?.prompt;
+ const hideBoardExport = showResult || !allSelectedCount();
const exportBtn = $('#wbExportBoard');
- if (exportBtn) exportBtn.hidden = showResult || !allSelectedCount();
+ if (exportBtn) exportBtn.hidden = hideBoardExport;
+ const copyBoardBtn = $('#wbCopyBoard');
+ if (copyBoardBtn) copyBoardBtn.hidden = hideBoardExport;
}
+ const ru = new Map();
+ const U = blob => {
+ if (!ru.has(blob)) ru.set(blob, URL.createObjectURL(blob));
+ return ru.get(blob);
+ };
+
function chosenBoardRefs() {
return [
...W.persons.map(ref => ['portrait', ref]),
@@ -428,6 +475,40 @@
];
}
+ function canvasBoardItems(example) {
+ const raw = example
+ ? exampleRefs.map((it, i) => ({ slot: 'sample', slotIdx: i, type: it.type, ref: libItem(it) }))
+ : [
+ ...W.persons.map((ref, i) => ({ slot: 'person', slotIdx: i, type: 'portrait', ref })),
+ ...W.garments.map((ref, i) => ({ slot: 'costume', slotIdx: i, type: 'costume', ref })),
+ ...W.poses.map((ref, i) => ({ slot: 'pose', slotIdx: i, type: 'pose', ref })),
+ ...W.exprs.map((ref, i) => ({ slot: 'expr', slotIdx: i, type: 'expr', ref })),
+ ...W.extraRefs.map((ref, i) => ({ slot: 'other', slotIdx: i, type: A.ITEMS[ref.k]?.type || 'other', ref })),
+ ];
+ const seen = new Map();
+ return raw.map(({ slot, slotIdx, type, ref }) => {
+ const item = A.ITEMS[ref.k];
+ const material = item?.type || type;
+ const baseId = `${slot}:${ref.k || ref.url || slotIdx}`;
+ const dup = seen.get(baseId) || 0;
+ seen.set(baseId, dup + 1);
+ const id = dup ? `${baseId}#${dup}` : baseId;
+ return {
+ id,
+ slot,
+ slotIdx,
+ type,
+ material,
+ ref,
+ item,
+ src: thumbnail(ref, item),
+ label: item ? A.title(item) : ref.name || boardLabels[type],
+ angle: !example && item?.angles?.[ref.ai ?? item.ai]?.zh,
+ roleLabel: boardLabels[material] || boardLabels[type] || '',
+ };
+ });
+ }
+
function paintBoard() {
const hasOut = W.results.length > 0;
const output = hasOut && W.view === 'result';
@@ -439,24 +520,31 @@
$('#wbCanvasRatio').textContent = !output && ratio !== 'auto' ? ratio : '';
if (output) return;
- const refs = example ? exampleRefs.map(it => [it.type, libItem(it)]) : chosen;
- const cards = $('#wbBoardCards');
- cards.classList.toggle('sample', example);
- cards.classList.toggle('many', refs.length > 3);
- cards.innerHTML = refs
- .map(([type, ref], idx) => {
- const item = A.ITEMS[ref.k];
- const source = thumbnail(ref, item);
- const material = item?.type || type;
- const label = item ? A.title(item) : ref.name || boardLabels[type];
- const angle = !example && item?.angles?.[ref.ai ?? item.ai]?.zh;
- const idxBadge = example ? '' : `<i class="board-idx" aria-hidden="true">${idx + 1}</i>`;
- const angBadge = angle ? `<em class="board-ang">${esc(angle)}</em>` : '';
- return `<button class="board-card" data-pick="${material}" data-type="${material}"${item ? ` data-pk-key="${esc(item.k)}"` : ''} title="${esc(label)}">${idxBadge}<img src="${esc(source)}" alt="${esc(label)}"${item?.ref ? ` referrerpolicy="${esc(item.ref)}"` : ''}>${angBadge}<span>${boardLabels[material]}</span></button>`;
- })
- .join('');
+ const entries = canvasBoardItems(example);
+ if (window.PoseWearCanvas) {
+ const results = W.results.map((r, index) => ({
+ index,
+ url: U(r.after),
+ prov: r.prov,
+ model: r.model,
+ label: r.label,
+ hasBefore: !!r.before,
+ }));
+ window.PoseWearCanvas.sync({ refs: entries, results, sample: example });
+ } else {
+ const cards = $('#wbBoardCards');
+ cards.classList.toggle('sample', example);
+ cards.classList.toggle('many', entries.length > 3);
+ cards.innerHTML = entries
+ .map((entry, idx) => {
+ const idxBadge = example ? '' : `<i class="board-idx" aria-hidden="true">${idx + 1}</i>`;
+ const angBadge = entry.angle ? `<em class="board-ang">${esc(entry.angle)}</em>` : '';
+ return `<button class="board-card" data-pick="${entry.material}" data-type="${entry.material}"${entry.item ? ` data-pk-key="${esc(entry.item.k)}"` : ''} title="${esc(entry.label)}">${idxBadge}<img src="${esc(entry.src)}" alt="${esc(entry.label)}"${entry.item?.ref ? ` referrerpolicy="${esc(entry.item.ref)}"` : ''}>${angBadge}<span>${entry.roleLabel}</span></button>`;
+ })
+ .join('');
+ }
- const showActions = example && refs.length > 0;
+ const showActions = example && entries.length > 0;
if ($('#wbBoardActions')) $('#wbBoardActions').hidden = !showActions;
$('#wbExample').hidden = !showActions;
if ($('#wbShuffle')) $('#wbShuffle').hidden = !showActions;
@@ -488,6 +576,31 @@
}
$('#wbExportBoard')?.addEventListener('click', () => exportBoardPng());
+ async function copyBoardPng() {
+ const chosen = chosenBoardRefs();
+ if (!chosen.length || !window.PoseWearBoardExport) return false;
+ const btn = $('#wbCopyBoard');
+ if (btn) btn.disabled = true;
+ try {
+ const { blob, extSkipped } = await window.PoseWearBoardExport.renderPng(chosen, {
+ app: A,
+ aspectRatio: $('#wbAR').value,
+ promptText: $('#wbPrompt')?.value || '',
+ });
+ if (!blob) throw Error('PNG render failed');
+ if (!navigator.clipboard?.write || typeof ClipboardItem === 'undefined') throw Error('clipboard');
+ await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);
+ toast(extSkipped ? '参考拼图已复制到剪贴板(外链图已标出)' : '参考拼图已复制到剪贴板');
+ return true;
+ } catch {
+ toast('当前浏览器不支持复制图片,请点击「导出拼图」保存');
+ return false;
+ } finally {
+ if (btn) btn.disabled = false;
+ }
+ }
+ $('#wbCopyBoard')?.addEventListener('click', () => copyBoardPng());
+
async function loadExample(randomize = false) {
if (!randomize && exampleRefs.length) return;
const types = ['portrait', 'costume', 'pose'];
@@ -505,9 +618,9 @@
paintBoard();
if (randomize && !matchMedia('(prefers-reduced-motion: reduce)').matches) {
$$('#wbBoardCards .board-card').forEach((card, i) =>
- card.animate([{ opacity: 0, transform: 'translateY(14px) scale(.94)' }, { opacity: 1 }], {
- duration: 360,
- delay: i * 55,
+ card.animate([{ opacity: 0, scale: 0.94 }, { opacity: 1, scale: 1 }], {
+ duration: 320,
+ delay: i * 50,
easing: 'cubic-bezier(.16,1,.3,1)',
})
);
@@ -541,6 +654,7 @@
W.extraRefs = [];
W.dirty = false;
W.view = 'board';
+ window.PoseWearCanvas?.clearLayout();
saveDraft();
render();
loadExample();
@@ -566,6 +680,7 @@
garment: exampleRefs.filter(it => it.type === 'costume'),
pose: exampleRefs.filter(it => it.type === 'pose'),
});
+ window.PoseWearCanvas?.fitToView(true);
} catch {
toast('素材未能载入,请重试');
} finally {
@@ -577,6 +692,7 @@
const ready =
allSelectedCount() ||
$('#wbExtra').value.trim() ||
+ (window.PoseWearCanvas?.linkedNotesText?.() || '') ||
(W.dirty && $('#wbPrompt').value.trim()) ||
(isGen() && W.char === 'custom' && W.charTxt.trim());
const need = ready ? [] : ['选择素材或输入提示词'];
@@ -781,6 +897,10 @@
} else if (e.target.id === 'wbN' || e.target.id === 'wbAR') {
saveDraft();
render();
+ } else if (e.target.id === 'wbShot') {
+ W.shot = Object.hasOwn(SHOTS, e.target.value) ? e.target.value : 'auto';
+ SV('wbShot', W.shot);
+ render();
} else if (e.target.id === 'wbKeepBg') {
W.keepBg = e.target.checked;
SV('wbKeepBg', W.keepBg);
@@ -798,8 +918,106 @@
};
$('#wbPrompt').oninput = () => { W.dirty = true; saveDraft(); updateStart(); };
$('#wbExtra').oninput = () => { reprompt(); saveDraft(); updateStart(); };
+ if ($('#wbNeg')) $('#wbNeg').oninput = () => { reprompt(); saveDraft(); updateStart(); };
+ if ($('#wbNegFill')) {
+ $('#wbNegFill').onclick = () => {
+ const box = $('#wbNeg');
+ if (!box) return;
+ box.value = DEFAULT_NEG[W.pl === 'zh' ? 'zh' : 'en'];
+ reprompt();
+ saveDraft();
+ updateStart();
+ toast('已填入常用避坑词');
+ };
+ }
$('#wbReP').onclick = () => { reprompt(true); saveDraft(); updateStart(); toast('已按当前选择重新生成提示词'); };
+ function resolvedStudioRefs(inputs = W, lang = W.pl) {
+ const publicSite = document.querySelector('link[rel=canonical]')?.href || location.origin + '/';
+ const selected = [
+ ...(inputs.persons || []),
+ ...(inputs.garments || []),
+ ...(inputs.poses || []),
+ ...(inputs.exprs || []),
+ ...(inputs.extraRefs || []),
+ ];
+ return selected.map((r, i) => {
+ const it = r.k ? A.ITEMS[r.k] : null;
+ if (!it) return { slot: i + 1, label: r.name || 'Local upload', url: null, item: null };
+ const ref = window.PoseWearReferences?.reference(it, r.ai ?? it.ai ?? 0, publicSite, lang, publicSite);
+ return { slot: i + 1, label: ref?.label || A.title(it), url: ref?.url || null, item: it, ai: r.ai ?? it.ai ?? 0 };
+ });
+ }
+
+ function formatPrompt(fmt) {
+ const ar = $('#wbAR').value;
+ const neg = ($('#wbNeg')?.value || '').trim();
+ const extra = ($('#wbExtra')?.value || '').trim();
+ const style = STYLES.find(s => s[0] === W.style) || STYLES[0];
+ const shotEntry = SHOTS[W.shot || 'auto'] || SHOTS.auto;
+ const ch = CHARS.find(c => c[0] === W.char) || CHARS[0];
+ const refs = resolvedStudioRefs(W, 'en');
+
+ if (fmt === 'json') {
+ return JSON.stringify(
+ {
+ app: 'PoseWear',
+ mode: W.mode,
+ aspectRatio: ar,
+ style: W.style,
+ shot: W.shot,
+ prompt: $('#wbPrompt').value.trim(),
+ negativePrompt: neg,
+ references: refs.map(({ slot, label, url }) => ({ slot, label, url })),
+ },
+ null,
+ 2
+ );
+ }
+
+ const parts = [];
+ if (W.persons.length) {
+ const pNames = W.persons.map(p => (p.k && A.ITEMS[p.k] ? A.prompt(A.ITEMS[p.k], 'en') : '')).filter(Boolean);
+ parts.push(pNames.length ? pNames.join(', ') : 'same person from reference photo');
+ } else {
+ parts.push((W.char === 'custom' ? W.charTxt : ch[2]) || ch[2] || 'adult model');
+ }
+ for (const g of W.garments) {
+ const it = g.k && A.ITEMS[g.k];
+ if (it) parts.push(it.en.replace(/^[^,]*outfit,\s*/i, ''));
+ }
+ for (const p of W.poses) {
+ const it = p.k && A.ITEMS[p.k];
+ if (it) parts.push(A.prompt({ ...it, ai: p.ai ?? it.ai }, 'en'));
+ }
+ for (const e of W.exprs) {
+ const it = e.k && A.ITEMS[e.k];
+ if (it) parts.push(it.en);
+ }
+ for (const x of W.extraRefs) {
+ const it = x.k && A.ITEMS[x.k];
+ if (it) parts.push(A.prompt({ ...it, ai: x.ai ?? it.ai }, 'en'));
+ }
+ if (shotEntry[0]) parts.push(shotEntry[0]);
+ if (style[2]) parts.push(style[2]);
+ if (extra) parts.push(extra);
+
+ const body = parts.map(s => String(s || '').trim().replace(/[.,;]+$/, '')).filter(Boolean).join(', ');
+
+ if (fmt === 'sd') {
+ const pos = ['masterpiece, best quality', body].filter(Boolean).join(', ');
+ const negLine = neg || DEFAULT_NEG.en;
+ return `${pos}\nNegative prompt: ${negLine}`;
+ }
+
+ // Midjourney format
+ const urls = refs.map(r => r.url).filter(Boolean);
+ const flags = [];
+ if (ar !== 'auto') flags.push(`--ar ${ar}`);
+ if (neg) flags.push(`--no ${neg.replace(/[,、;;]+/g, ', ')}`);
+ return [...urls, body || $('#wbPrompt').value.trim(), ...flags].filter(Boolean).join(' ');
+ }
+
function copyStudioBrief(text, inputs, lang) {
if (!$('#copyRefs').checked) return A.copy(text, '提示词');
const selected = [
@@ -819,6 +1037,21 @@
}
$('#wbCopyP').onclick = () => copyStudioBrief($('#wbPrompt').value, W, W.pl);
+ const fmtMenu = $('#wbFmtMenu');
+ if (fmtMenu) {
+ fmtMenu.addEventListener('click', e => {
+ const btn = e.target.closest('[data-fmt]');
+ if (!btn) return;
+ const fmt = btn.dataset.fmt;
+ fmtMenu.open = false;
+ const labels = { mj: 'Midjourney 格式', sd: 'SD / NovelAI 标签', json: '结构化 JSON' };
+ A.copy(formatPrompt(fmt), labels[fmt] || '提示词');
+ });
+ document.addEventListener('pointerdown', e => {
+ if (fmtMenu.open && !fmtMenu.contains(e.target)) fmtMenu.open = false;
+ });
+ }
+
// ---------- Material Picker Modal ----------
let pkType = 'costume';
let pkSink = null;
@@ -1216,6 +1449,19 @@
$('#cfProto').value = settings.proto;
$('#cfProtoW').hidden = settings.prov !== 'custom';
$('#cfFieldW').hidden = !(settings.prov === 'custom' && settings.proto === 'edits');
+ const presetsWrap = $('#cfPresetsW');
+ if (presetsWrap) {
+ presetsWrap.hidden = settings.prov !== 'custom';
+ const presetsBox = $('#cfPresets');
+ if (presetsBox && relayPresets.length) {
+ presetsBox.innerHTML = relayPresets
+ .map(p => {
+ const on = settings.proto === p.proto && (settings.model || '') === p.model;
+ return `<button type="button" class="chip${on ? ' on' : ''}" data-preset="${esc(p.id)}">${esc(p.label)}</button>`;
+ })
+ .join('');
+ }
+ }
$('#cfProxy').checked = settings.proxy;
$('#cfHelp').innerHTML =
({
@@ -1283,6 +1529,24 @@
};
});
$('#cfProto').onchange = () => { $('#cfFieldW').hidden = $('#cfProto').value !== 'edits'; };
+ $('#cfPresets')?.addEventListener('click', e => {
+ const btn = e.target.closest('[data-preset]');
+ if (!btn) return;
+ const preset = relayPresets.find(p => p.id === btn.dataset.preset);
+ if (!preset) return;
+ $('#cfProto').value = preset.proto;
+ $('#cfModel').value = preset.model;
+ $('#cfProxy').checked = !!preset.proxy;
+ if (preset.base) $('#cfBase').value = preset.base;
+ $('#cfFieldW').hidden = preset.proto !== 'edits';
+ $$('#cfPresets [data-preset]').forEach(el => el.classList.toggle('on', el === btn));
+ if (preset.base) {
+ msg(`已应用 ${preset.label} 预设,请填入 API Key`);
+ } else {
+ msg(`已应用 ${preset.label} 预设,请填入你的中转 Base URL 与 API Key`);
+ if (!$('#cfBase').value.trim()) $('#cfBase').focus({ preventScroll: true });
+ }
+ });
$('#cfEye').onclick = () => {
const k = $('#cfKey');
k.type = k.type === 'password' ? 'text' : 'password';
@@ -1645,12 +1909,6 @@
$('#wbStop').onclick = () => W.busy?.abort();
// ---------- Result Display & Comparison ----------
- const ru = new Map();
- const U = blob => {
- if (!ru.has(blob)) ru.set(blob, URL.createObjectURL(blob));
- return ru.get(blob);
- };
-
function setX(x) {
$('#wbCmp').style.setProperty('--x', x + '%');
$('#wbRange').value = x;
@@ -1762,14 +2020,16 @@
link.download = `posewear-${r.mode === 'gen' ? 'gen' : 'tryon'}-${stamp(new Date(r.t))}-${String(W.ri + 1).padStart(2, '0')}.png`;
link.click();
};
- $('#wbUse').onclick = async () => {
- const r = W.results[W.ri];
+ async function useResultAsPerson(idx) {
+ const r = W.results[idx];
if (!r) return;
const x = await toJpeg(U(r.after), 1536);
W.persons = [{ blob: x.blob, url: URL.createObjectURL(x.blob), w: x.w, h: x.h }];
+ W.view = 'board';
render();
toast('已将结果设为新的人物照片');
- };
+ }
+ $('#wbUse').onclick = () => useResultAsPerson(W.ri);
// ---------- IndexedDB Local History ----------
let dbPromise;
@@ -1911,6 +2171,8 @@
return {
...W,
extra: '',
+ neg: '',
+ shot: 'auto',
charTxt: Object.values(groups).some(items => items.length) ? W.charTxt : '',
pl: lang ? (lang === 'zh' ? 'zh' : 'en') : W.pl,
persons,
@@ -2056,15 +2318,19 @@
W.mode = r.mode || 'tryon';
W.pl = inputs?.lang || W.pl;
W.bm = inputs?.bm || 'each';
+ W.shot = 'auto';
+ if ($('#wbShot')) $('#wbShot').value = 'auto';
$('#wbAR').value = inputs?.ar || 'auto';
$('#wbN').value = '1';
$('#wbExtra').value = '';
+ if ($('#wbNeg')) $('#wbNeg').value = '';
$('#wbNeutral').checked = !!r.neutral;
$('#wbPrompt').value = r.orig || r.prompt || '';
W.dirty = !!$('#wbPrompt').value;
SV('wbMode', W.mode);
SV('wbPl', W.pl);
SV('wbBm', W.bm);
+ SV('wbShot', W.shot);
saveDraft();
if (!inputs) problems.push('旧记录的服装和姿势需重选');
if (cfg.prov !== r.prov || modelOf() !== r.model) problems.push('请核对当前服务商及模型');
@@ -2073,6 +2339,132 @@
return problems;
}
+ function recipeSnapshot() {
+ return {
+ mode: W.mode,
+ style: W.style,
+ shot: W.shot,
+ ar: $('#wbAR').value,
+ pl: W.pl,
+ extra: $('#wbExtra').value.trim(),
+ neg: ($('#wbNeg')?.value || '').trim(),
+ prompt: W.dirty ? $('#wbPrompt').value : null,
+ hasLocalUploads: W.persons.some(p => !p.k) || W.garments.some(g => g.kind !== 'lib'),
+ refs: {
+ r: W.persons.filter(p => p.k).map(p => p.k),
+ g: W.garments.filter(g => g.kind === 'lib').map(g => (g.ai == null ? g.k : [g.k, g.ai])),
+ p: W.poses.map(p => [p.k, p.ai]),
+ e: W.exprs.map(e => [e.k, e.ai]),
+ x: W.extraRefs.map(x => [x.k, x.ai]),
+ },
+ };
+ }
+
+ async function applyStudioRecipe(recipe, { keepCurrentPose = false } = {}) {
+ await init();
+ const refs = recipe.refs || {};
+ const parseEntry = entry => (Array.isArray(entry) ? { k: entry[0], ai: entry[1] } : { k: entry });
+ const allRefs = [
+ ...(refs.r || []).map(k => ({ k })),
+ ...(refs.g || []).map(parseEntry),
+ ...(keepCurrentPose ? [] : (refs.p || []).map(parseEntry)),
+ ...(refs.e || []).map(parseEntry),
+ ...(refs.x || []).map(parseEntry),
+ ];
+ const keys = allRefs.map(x => x.k).filter(Boolean);
+ if (keys.length) await A.needKeys(keys).catch(() => {});
+ const groups = groupLibraryRefs(allRefs);
+ W.persons = groups.portrait.slice(0, 3).map(libPortrait);
+ W.garments = groups.garment.slice(0, 2);
+ if (!keepCurrentPose) W.poses = groups.pose.slice(0, 6);
+ W.exprs = groups.expr.slice(0, 1);
+ W.extraRefs = groups.extra;
+
+ autoMode = false;
+ W.mode = recipe.mode === 'tryon' ? 'tryon' : 'gen';
+ W.style = STYLES.some(s => s[0] === recipe.style) ? recipe.style : 'keep';
+ W.shot = Object.hasOwn(SHOTS, recipe.shot) ? recipe.shot : 'auto';
+ W.pl = recipe.pl === 'zh' ? 'zh' : 'en';
+ SV('wbMode', W.mode);
+ SV('wbStyle', W.style);
+ SV('wbShot', W.shot);
+ SV('wbPl', W.pl);
+ if ($('#wbShot')) $('#wbShot').value = W.shot;
+ $('#wbAR').value = recipe.ar || 'auto';
+ $('#wbExtra').value = recipe.extra || '';
+ if ($('#wbNeg')) $('#wbNeg').value = recipe.neg || '';
+ W.view = 'board';
+ if (recipe.prompt != null && !keepCurrentPose) {
+ $('#wbPrompt').value = recipe.prompt;
+ W.dirty = true;
+ } else {
+ W.dirty = false;
+ }
+ saveDraft();
+ render();
+ }
+
+ window.PoseWearRecipes?.init({
+ snapshot: recipeSnapshot,
+ applyRecipe: applyStudioRecipe,
+ hasPoses: () => W.poses.length > 0,
+ });
+
+ window.PoseWearCanvas?.init({
+ openPicker: (type, opener) => picker(type, opener),
+ cycleAngle: (slot, index) => {
+ const refs = { pose: W.poses, expr: W.exprs, costume: W.garments, other: W.extraRefs }[slot];
+ const ref = refs?.[index];
+ const item = ref?.k && A.ITEMS[ref.k];
+ if (!item?.angles?.length) return;
+ ref.ai = ((ref.ai ?? item.ai ?? 0) + 1) % item.angles.length;
+ render();
+ },
+ removeRef: (slot, index) => {
+ if (slot === 'person') {
+ const [person] = W.persons.splice(index, 1);
+ if (person?.blob) URL.revokeObjectURL(person.url);
+ } else {
+ const refs = { pose: W.poses, expr: W.exprs, costume: W.garments, other: W.extraRefs }[slot];
+ const [ref] = refs ? refs.splice(index, 1) : [];
+ if (ref?.blob) URL.revokeObjectURL(ref.url);
+ }
+ render();
+ },
+ onNotesChange: () => {
+ reprompt();
+ updateStart();
+ },
+ generate: () => run(),
+ viewResult: idx => show(idx),
+ useResultAsPerson,
+ isBusy: () => !!W.busy,
+ getMeta: () => {
+ const style = STYLES.find(s => s[0] === W.style) || STYLES[0];
+ const shotSelect = $('#wbShot');
+ const shotLabel = W.shot && W.shot !== 'auto'
+ ? shotSelect?.selectedOptions?.[0]?.textContent || ''
+ : '';
+ return {
+ ar: $('#wbAR').value,
+ styleLabel: style[1],
+ shotLabel,
+ jobs: nJobs(),
+ canGo: !updateStart().length,
+ busy: !!W.busy,
+ };
+ },
+ });
+
+ $('#wbBoardCards')?.addEventListener('keydown', e => {
+ const card = e.target.closest('.board-card');
+ if (!card || e.target.closest('button')) return;
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ picker(card.dataset.pick, card);
+ }
+ });
+
window.WB = {
copyStudioBrief,
async show() {
@@ -2080,6 +2472,7 @@
await init();
render();
if (!W.results.length) loadExample();
+ requestAnimationFrame(() => window.PoseWearCanvas?.fitToView(false));
} catch {
toast('试穿台选材加载失败,请重新打开后再试');
}
@@ -2100,6 +2493,8 @@
quick: opts => run({ ...opts, quick: true }),
cfgOpen,
exportBoardPng,
+ copyBoardPng,
+ formatPrompt,
nice,
busy: () => !!W.busy,
stop: () => W.busy?.abort(),
@@ -2119,12 +2514,19 @@
}
addEventListener('keydown', e => {
- const dialog = !$('#pk').hidden ? $('#pk') : !$('#cfg').hidden ? $('#cfg') : null;
+ const dialog = !$('#pk').hidden
+ ? $('#pk')
+ : !$('#cfg').hidden
+ ? $('#cfg')
+ : $('#recipeBox') && !$('#recipeBox').hidden
+ ? $('#recipeBox')
+ : null;
if (!dialog) return;
if (e.key === 'Escape') {
e.preventDefault();
e.stopImmediatePropagation();
if (dialog.id === 'pk') pkClose();
+ else if (dialog.id === 'recipeBox') window.PoseWearRecipes?.close();
else cfgClose();
return;
}
diff --git a/src/style.css b/src/style.css
index cfacd5c..ddd45b1 100644
--- a/src/style.css
+++ b/src/style.css
@@ -2365,10 +2365,29 @@ body.batch .card-badges {
}
#lbStage.gray #lbImg,
-#skFrame.gray #skImg {
+#skFrame.gray #skImg,
+.cmp-stage.gray img {
filter: grayscale(1) contrast(1.06);
}
+#lbStage.notan #lbImg,
+#skFrame.notan #skImg,
+.cmp-stage.notan img {
+ filter: url(#pwNotan3);
+}
+
+#lbStage.sil #lbImg,
+#skFrame.sil #skImg,
+.cmp-stage.sil img {
+ filter: url(#pwSil);
+}
+
+.lb-img[data-img-type=depth] #lbStage.sil #lbImg,
+.sk-stage[data-img-type=depth] #skFrame.sil #skImg,
+.cmp-ph[data-img-type=depth] .cmp-stage.sil img {
+ filter: url(#pwSilDepth);
+}
+
.lb-pair-cmp {
position: absolute;
inset: 0;
@@ -3732,6 +3751,36 @@ body.studio .top {
background: var(--acs);
}
+#wbRecipesBtn {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ padding: 6px 11px;
+ font-size: 12.5px;
+ color: var(--tx2);
+ border: 1px solid var(--line2);
+ background: var(--bg2);
+ white-space: nowrap;
+}
+
+#wbRecipesBtn:hover {
+ color: var(--tx);
+ border-color: var(--tx2);
+ background: var(--sf);
+}
+
+#wbRecipeN {
+ font-style: normal;
+ font-size: 11px;
+ font-weight: 700;
+ line-height: 1;
+ padding: 2px 6px;
+ border-radius: 99px;
+ background: var(--ac);
+ color: #fff;
+ font-variant-numeric: tabular-nums;
+}
+
.modes {
display: flex;
margin: 0;
@@ -4364,25 +4413,34 @@ body.studio .top {
margin-right: auto;
}
-#wbExportBoard {
+.board-export-acts {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ margin-left: auto;
+ flex-wrap: wrap;
+}
+
+.canvas-head #wbCanvasSwitch:not([hidden]) ~ .board-export-acts {
+ margin-left: 0;
+}
+
+#wbExportBoard,
+#wbCopyBoard {
padding: 5px 11px;
font-size: 12px;
border: 1px solid var(--line2);
background: var(--bg2);
color: var(--tx2);
- margin-left: auto;
}
-#wbExportBoard:hover {
+#wbExportBoard:hover,
+#wbCopyBoard:hover {
color: var(--tx);
border-color: var(--tx2);
background: var(--sf);
}
-.canvas-head #wbCanvasSwitch:not([hidden]) ~ #wbExportBoard {
- margin-left: 0;
-}
-
.stage {
position: relative;
display: grid;
@@ -4394,54 +4452,183 @@ body.studio .top {
.st-c #wbStage {
border-radius: 0;
flex: 1;
- min-height: 180px;
+ min-height: 220px;
background-color: var(--sf);
- background-image: radial-gradient(var(--line2) .85px, transparent .85px);
- background-size: 13px 13px;
+ background-image: radial-gradient(color-mix(in srgb, var(--tx) 15%, transparent) 1px, transparent 1px);
+ background-size: var(--cv-step, 18px) var(--cv-step, 18px);
+ background-position: var(--cv-x, 0px) var(--cv-y, 0px);
}
.st-c:has(#wbCmp:not([hidden])) #wbStage {
min-height: 240px;
}
+/* Zen Focus Canvas mode */
+#studio.zen .st-app {
+ grid-template-columns: minmax(0, 1fr);
+}
+
+#studio.zen .st-l,
+#studio.zen .st-r {
+ display: none;
+}
+
+#studio.zen .st-c {
+ border-radius: 18px;
+}
+
.reference-board {
- display: grid;
- place-items: center;
- align-content: center;
- gap: 36px;
+ position: relative;
width: 100%;
+ height: 100%;
min-width: 0;
- padding: clamp(18px, 3.5%, 42px) clamp(18px, 4%, 48px) 68px;
- max-height: 100%;
- overflow: auto;
+ overflow: hidden;
}
-.board-cards {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap;
- gap: 12px;
- width: 100%;
- min-width: 0;
- padding: 10px 3px;
+.cv-viewport {
+ position: absolute;
+ inset: 0;
+ overflow: hidden;
+ cursor: grab;
+ touch-action: none;
+ user-select: none;
+}
+
+.cv-viewport.panning,
+.cv-viewport.space {
+ cursor: grabbing;
+}
+
+.cv-world {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 0;
+ height: 0;
+ transform-origin: 0 0;
+ will-change: transform;
+}
+
+.cv-world.anim {
+ transition: transform .24s var(--out);
+}
+
+.cv-wires {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 1px;
+ height: 1px;
+ overflow: visible;
+ pointer-events: none;
+ z-index: 1;
+}
+
+.cv-wire {
+ fill: none;
+ stroke: color-mix(in srgb, var(--tx) 20%, transparent);
+ stroke-width: 1.5;
+ stroke-linecap: round;
+ transition: stroke .2s;
+}
+
+.cv-wire.note-wire {
+ stroke: color-mix(in srgb, var(--ac) 52%, transparent);
+ stroke-dasharray: 5 4;
+}
+
+.cv-wire.out-wire {
+ stroke: color-mix(in srgb, var(--tx) 16%, transparent);
+ stroke-dasharray: 3 4;
+}
+
+.cv-wire.pulse {
+ stroke: var(--ac);
+ stroke-dasharray: 7 5;
+ animation: wireFlow 1.1s linear infinite;
+}
+
+@keyframes wireFlow {
+ to { stroke-dashoffset: -24; }
+}
+
+.cv-port {
+ fill: var(--bg2);
+ stroke: color-mix(in srgb, var(--tx) 36%, transparent);
+ stroke-width: 1.5;
+}
+
+.cv-port.note-wire {
+ stroke: var(--ac);
+}
+
+.cv-port.hub-port {
+ fill: var(--ac);
+ stroke: var(--bg2);
+ stroke-width: 2;
+}
+
+.board-cards,
+.cv-notes,
+.cv-outputs {
+ display: contents;
}
.board-card {
- position: relative;
+ position: absolute;
+ transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: stretch;
gap: 0;
text-align: start;
- max-width: 215px;
- width: clamp(64px, 38%, 215px);
- padding: 5px;
- border-radius: 13px;
+ width: 166px;
+ padding: 6px;
+ border-radius: 15px;
background: var(--bg2);
border: 1px solid var(--line2);
- box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
+ border-top: 2.5px solid var(--cat-color, var(--line2));
+ box-shadow: 0 10px 28px rgba(0, 0, 0, .09), 0 1px 3px rgba(0, 0, 0, .05);
white-space: normal;
+ cursor: grab;
+ transition: box-shadow .18s var(--out), border-color .18s;
+}
+
+.board-card:is(:hover, :focus-visible) {
+ border-color: var(--tx2);
+ border-top-color: var(--cat-color, var(--tx2));
+ box-shadow: 0 14px 36px rgba(0, 0, 0, .13);
+ outline: none;
+}
+
+.board-card:focus-visible {
+ box-shadow: 0 0 0 2.5px var(--ac), 0 14px 36px rgba(0, 0, 0, .13);
+}
+
+.board-card.dragging {
+ cursor: grabbing;
+ box-shadow: 0 22px 52px rgba(0, 0, 0, .2);
+ border-color: var(--tx);
+ border-top-color: var(--cat-color, var(--tx));
+}
+
+.board-cards.sample .board-card {
+ cursor: pointer;
+}
+
+.board-cards.sample .board-card:first-child:not(:last-child) {
+ transform: translate(-50%, -50%) rotate(-3deg);
+}
+
+.board-cards.sample .board-card:nth-child(3) {
+ transform: translate(-50%, -50%) rotate(3deg);
+}
+
+.cv-card-media {
+ position: relative;
+ width: 100%;
+ border-radius: 9px;
+ overflow: hidden;
}
.board-card img {
@@ -4449,11 +4636,17 @@ body.studio .top {
width: 100%;
aspect-ratio: 3 / 4;
object-fit: cover;
- border-radius: 8px;
+ border-radius: 9px;
background: var(--sf);
+ transition: transform .22s var(--out);
}
-.board-card:is([data-pick=costume], [data-pick=pose]) img {
+.board-card.cv-flip img {
+ transform: scaleX(-1);
+}
+
+.board-card:is([data-pick=costume], [data-pick=pose]) img,
+.board-cards:not(.sample) .board-card img {
object-fit: contain;
}
@@ -4471,24 +4664,24 @@ body.studio .top {
filter: brightness(.92);
}
-.board-card span {
+.board-card > span {
align-self: center;
- padding: 6px 3px 1px;
+ padding: 6px 4px 1px;
color: var(--tx2);
font-size: 12px;
- font-weight: 580;
+ font-weight: 600;
}
.board-idx {
position: absolute;
- top: 9px;
- left: 9px;
- z-index: 1;
+ top: 10px;
+ left: 10px;
+ z-index: 3;
min-width: 20px;
height: 20px;
padding: 0 5px;
border-radius: 6px;
- background: rgba(17, 17, 17, .78);
+ background: rgba(17, 17, 17, .82);
color: #fff;
font: 700 11px/20px var(--sans);
font-style: normal;
@@ -4500,16 +4693,16 @@ body.studio .top {
.board-ang {
position: absolute;
- right: 9px;
- bottom: 32px;
- z-index: 1;
- max-width: calc(100% - 18px);
+ right: 6px;
+ bottom: 6px;
+ z-index: 2;
+ max-width: calc(100% - 12px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
- padding: 1px 6px;
+ padding: 2px 7px;
border-radius: 99px;
- background: rgba(17, 17, 17, .72);
+ background: rgba(17, 17, 17, .74);
color: #fff;
font-size: 10px;
font-style: normal;
@@ -4517,2348 +4710,3379 @@ body.studio .top {
pointer-events: none;
}
-.board-cards:not(.many) {
- flex-wrap: nowrap;
-}
-
-.board-cards.sample:not(.many) {
- gap: 0;
+.cv-card-bar {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 4;
+ display: inline-flex;
+ align-items: center;
+ gap: 2px;
+ padding: 2px;
+ border-radius: 99px;
+ background: rgba(17, 17, 17, .78);
+ backdrop-filter: blur(8px);
+ opacity: 0;
+ transform: translateY(-2px);
+ transition: opacity .15s, transform .15s;
}
-.board-cards.sample:not(.many) .board-card {
- width: 36%;
+.board-card:is(:hover, :focus-within) .cv-card-bar {
+ opacity: 1;
+ transform: none;
}
-.board-cards.sample:not(.many) .board-card:first-child:not(:last-child) {
- transform: rotate(-6deg) translateY(5%);
- margin-right: -7%;
+.cv-card-bar button {
+ min-width: 22px;
+ height: 22px;
+ padding: 0 5px;
+ border-radius: 99px;
+ background: transparent;
+ color: #fff;
+ font-size: 11px;
+ font-weight: 600;
+ justify-content: center;
}
-.board-cards.sample:not(.many) .board-card:nth-child(2) {
- transform: translateY(-5%);
- z-index: 1;
+.cv-card-bar button:hover {
+ background: rgba(255, 255, 255, .2);
}
-.board-cards.sample:not(.many) .board-card:nth-child(3) {
- transform: rotate(6deg) translateY(8%);
- margin-left: -7%;
+.cv-card-bar button.on {
+ background: var(--ac);
}
-.board-cards:not(.sample) .board-card {
- min-width: 0;
- border-color: var(--ref-edge, var(--line2));
+.cv-card-bar button[data-cv-card=rm]:hover {
+ background: var(--ac);
}
-.board-cards:not(.sample) .board-card img {
- object-fit: contain;
+.cv-rsz {
+ position: absolute;
+ right: 3px;
+ bottom: 3px;
+ width: 14px;
+ height: 14px;
+ cursor: nwse-resize;
+ opacity: 0;
+ transition: opacity .15s;
}
-.board-cards.many .board-card {
- width: clamp(62px, 24%, 135px);
+.cv-rsz::after {
+ content: "";
+ position: absolute;
+ right: 3px;
+ bottom: 3px;
+ width: 7px;
+ height: 7px;
+ border-right: 2px solid var(--mu);
+ border-bottom: 2px solid var(--mu);
+ border-radius: 0 0 2px 0;
}
-.board-cards .board-card:is(:hover, :focus-visible) {
- z-index: 2;
- border-color: var(--tx2);
+.board-card:hover .cv-rsz {
+ opacity: .85;
}
-.board-actions {
+/* Art-Direction Sticky Notes */
+.cv-note {
+ position: absolute;
+ transform: translate(-50%, -50%);
+ z-index: 12;
display: flex;
- align-items: center;
- justify-content: center;
- flex-wrap: wrap;
- gap: 8px;
-}
-
-.board-use {
- min-height: 38px;
- padding: 8px 16px;
+ flex-direction: column;
background: var(--bg2);
border: 1px solid var(--line2);
- font-size: 13px;
+ border-radius: 14px;
+ box-shadow: 0 10px 26px rgba(0, 0, 0, .09);
+ overflow: hidden;
+ transition: box-shadow .18s, border-color .18s;
}
-.board-use::after {
- content: "↗";
- font-size: 15px;
+.cv-note.linked {
+ border-color: color-mix(in srgb, var(--ac) 34%, var(--line2));
}
-.board-shuffle::after {
- content: "↻";
- font-size: 14px;
+.cv-note.dragging {
+ box-shadow: 0 20px 44px rgba(0, 0, 0, .18);
}
-/* Before/after comparison, busy & output controls */
-.cmp {
- position: relative;
- --x: 50%;
- width: 100%;
- height: 100%;
- min-height: 0;
- max-height: none;
+.cv-note-head {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 6px 8px;
+ border-bottom: 1px solid var(--line);
background: var(--sf);
- user-select: none;
-}
-
-.cmp > img,
-.bef img {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- object-fit: contain;
+ cursor: grab;
}
-.bef {
- position: absolute;
- inset: 0;
- clip-path: inset(0 calc(100% - var(--x)) 0 0);
-}
-
-.hdl {
- position: absolute;
- top: 0;
- bottom: 0;
- left: var(--x);
- width: 2px;
- background: #fff;
- pointer-events: none;
-}
-
-.hdl span {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 40px;
- height: 40px;
- transform: translate(-50%, -50%);
+.cv-pin {
+ width: 7px;
+ height: 7px;
border-radius: 50%;
- background: #fff;
- box-shadow: var(--sh2);
+ flex: none;
+ background: var(--mu);
}
-.hdl span::before {
- content: "‹ ›";
- position: absolute;
- inset: 0;
- display: grid;
- place-items: center;
- color: #111;
- font-size: 15px;
- letter-spacing: 2px;
+.cv-note.linked .cv-pin {
+ background: var(--ac);
}
-#wbRange {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- cursor: ew-resize;
- margin: 0;
+.cv-note-link {
+ margin-right: auto;
+ padding: 2px 7px;
+ border-radius: 99px;
+ font-size: 11px;
+ font-weight: 600;
+ background: transparent;
+ color: var(--mu);
}
-#wbRange:focus-visible + em {
- outline: 2px solid var(--ac);
+.cv-note-link.on {
+ background: var(--acs);
+ color: var(--ac);
}
-.cmp em {
- position: absolute;
- top: 14px;
- font-size: 12px;
- font-style: normal;
- font-weight: 600;
- color: #fff;
- background: rgba(0, 0, 0, .5);
- padding: 4px 11px;
- border-radius: 99px;
- pointer-events: none;
+.cv-note-rm {
+ width: 22px;
+ height: 22px;
+ padding: 0;
+ border-radius: 50%;
+ justify-content: center;
+ background: transparent;
+ color: var(--mu);
+ font-size: 14px;
}
-.cmp em.l { left: 14px; }
-.cmp em.r { right: 14px; }
+.cv-note-rm:hover {
+ background: var(--acs);
+ color: var(--bad);
+}
-.cmp.solo .bef,
-.cmp.solo .hdl,
-.cmp.solo input,
-.cmp.solo em {
- display: none;
+.cv-note textarea {
+ width: 100%;
+ min-height: 76px;
+ padding: 8px 10px;
+ border: 0;
+ outline: 0;
+ resize: none;
+ background: transparent;
+ color: var(--tx);
+ font: 12.5px/1.5 var(--sans);
}
-.busy {
+/* Spatial Output Hub & Pinned Results */
+.cv-hub {
position: absolute;
- inset: 0;
+ transform: translate(-50%, -50%);
+ z-index: 9;
display: flex;
flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 10px;
- background: color-mix(in srgb, var(--bg2) 88%, transparent);
- z-index: 2;
- isolation: isolate;
+ gap: 8px;
+ padding: 10px;
+ border-radius: 17px;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ box-shadow: 0 14px 36px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .05);
}
-.skel0 {
- position: absolute;
- inset: 24px;
- margin: auto;
- max-width: 420px;
- border-radius: 16px;
- background: linear-gradient(100deg, #ececec 30%, #f8f8f8 50%, #ececec 70%);
- background-size: 250% 100%;
- animation: sh 1.4s infinite linear;
- z-index: -1;
- opacity: .9;
+.cv-hub.dragging {
+ box-shadow: 0 22px 52px rgba(0, 0, 0, .2);
}
-[data-theme=dark] .skel0 {
- background-image: linear-gradient(100deg, #222 30%, #2c2c2c 50%, #222 70%);
+.cv-hub-head {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ cursor: grab;
+ padding: 1px 2px;
}
-.busy b,
-.busy small,
-.busy button {
- position: relative;
+.cv-hub-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: var(--ac);
+ flex: none;
}
-.busy b {
- background: var(--bg2);
- padding: 8px 16px;
- border-radius: 99px;
- font-size: 14px;
- font-weight: 600;
- margin-top: 8px;
- box-shadow: var(--sh1);
+.cv-hub-dot.busy {
+ animation: pulseDot 1s ease-in-out infinite;
}
-.busy small {
- color: var(--mu);
- font-size: 12.5px;
+@keyframes pulseDot {
+ 0%, 100% { opacity: 1; transform: scale(1); }
+ 50% { opacity: .4; transform: scale(.82); }
}
-.busy button {
- background: var(--bg2);
+.cv-hub-head b {
+ font-size: 12.5px;
+ font-weight: 700;
+ color: var(--tx);
}
-#wbProg {
- appearance: none;
- width: min(220px, 65%);
- height: 5px;
- border: 0;
- border-radius: 8px;
- overflow: hidden;
- background: var(--sf2);
- accent-color: var(--ac);
+.cv-hub-n {
+ margin-left: auto;
+ padding: 2px 7px;
+ border-radius: 99px;
+ background: var(--sf);
+ color: var(--tx2);
+ font-size: 11px;
+ font-weight: 600;
+ font-variant-numeric: tabular-nums;
}
-#wbProg::-webkit-progress-bar {
- background: var(--sf2);
- border-radius: 8px;
+.cv-hub-body {
+ display: grid;
+ place-items: center;
+ min-height: 150px;
+ border-radius: 11px;
+ background: var(--sf);
+ padding: 8px;
+ overflow: hidden;
}
-#wbProg::-webkit-progress-value {
- background: var(--ac);
- border-radius: 8px;
+.cv-hub.has-img .cv-hub-body {
+ padding: 0;
+ background: #111;
}
-#wbProg:indeterminate {
- background: var(--sf2) linear-gradient(90deg, transparent, var(--ac), transparent) no-repeat;
- background-size: 48% 100%;
- animation: rendering 1.5s ease-in-out infinite alternate;
+.cv-hub-body img {
+ display: block;
+ width: 100%;
+ max-height: 256px;
+ object-fit: contain;
+ border-radius: 11px;
}
-#wbProg:indeterminate::-webkit-progress-inner-element {
- display: none;
+.cv-hub-wire {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 4px;
+ border: 1.5px dashed var(--line2);
+ border-radius: 10px;
+ background: var(--bg2);
+ color: var(--tx2);
+ transition: width .22s var(--out), height .22s var(--out);
}
-@keyframes rendering {
- from { background-position: -40% 0; }
- to { background-position: 140% 0; }
+.cv-hub-wire span {
+ font-size: 16px;
+ font-weight: 700;
+ letter-spacing: -.02em;
+ color: var(--tx);
+ font-variant-numeric: tabular-nums;
}
-.err {
- position: absolute;
- inset: auto 16px 16px;
- background: var(--bg2);
- padding: 14px 18px;
- z-index: 3;
- border-radius: 14px;
- box-shadow: var(--sh2);
+.cv-hub-wire small {
+ font-size: 11px;
+ color: var(--mu);
}
-.err b {
- color: var(--bad);
- font-size: 15px;
+.cv-hub-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
}
-.err p {
- margin: 6px 0 4px;
- font-size: 13px;
+.cv-hub-tags span {
+ padding: 2px 7px;
+ border-radius: 6px;
+ background: var(--sf);
color: var(--tx2);
- line-height: 1.7;
- word-break: break-word;
+ font-size: 11px;
+ font-weight: 550;
}
-#wbErr .raw {
- margin-top: 10px;
- font-size: 12px;
- color: var(--tx2);
+.cv-hub-acts {
+ display: flex;
+ align-items: center;
+ gap: 5px;
}
-#wbErr .raw summary,
-#wbSentD summary {
- cursor: pointer;
- width: max-content;
+.cv-hub-acts .pri {
+ flex: 1;
+ justify-content: center;
+ padding: 6px 10px;
+ font-size: 12px;
}
-#wbErr .raw pre,
-#wbSentD pre {
- white-space: pre-wrap;
- overflow-wrap: anywhere;
- max-height: 140px;
- overflow: auto;
- background: var(--sf);
- border-radius: 10px;
- padding: 8px 10px;
- margin: 8px 0 6px;
+.cv-hub-acts .ghost {
+ padding: 6px 8px;
font-size: 11.5px;
+ border: 1px solid var(--line2);
}
-#wbSentD {
- margin: 8px 2px 0;
- font-size: 12px;
- color: var(--tx2);
-}
-
-#wbSentD pre {
- max-height: 160px;
- margin: 6px 0 0;
-}
-
-#wbErr p + p.fine {
- margin-top: -4px;
-}
-
-.warn {
- margin-top: 10px;
- font-size: 12.5px;
- color: #b4501f;
- background: #fff4ea;
- padding: 9px 14px;
- border-radius: 12px;
-}
-
-[data-theme=dark] .warn {
- background: #2a1f16;
- color: #f0a46a;
+.cv-out-node {
+ position: absolute;
+ transform: translate(-50%, -50%);
+ z-index: 8;
+ padding: 6px;
+ border-radius: 14px;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ box-shadow: 0 10px 28px rgba(0, 0, 0, .09);
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
}
-.st-c .out-act,
-.st-c .warn,
-.st-c .res,
-.st-c .sent {
- margin: 8px 12px;
+.cv-out-node img {
+ display: block;
+ width: 100%;
+ aspect-ratio: 3 / 4;
+ object-fit: cover;
+ border-radius: 9px;
+ background: var(--sf);
}
-.res {
+.cv-out-bar {
display: flex;
- gap: 8px;
- overflow-x: auto;
- padding: 3px;
+ align-items: center;
+ gap: 4px;
}
-.res button {
- padding: 0;
- width: 56px;
- height: 74px;
- flex: none;
- overflow: hidden;
- border-radius: 12px;
- transition: transform .2s;
+.cv-out-bar small {
+ margin-right: auto;
+ font-size: 11px;
+ font-weight: 700;
+ color: var(--mu);
+ font-variant-numeric: tabular-nums;
}
-.res button:hover {
- transform: translateY(-2px);
+.cv-out-bar .sm {
+ padding: 3px 7px;
+ font-size: 11px;
}
-.res button.on {
- box-shadow: 0 0 0 2.5px var(--ac);
+/* Floating Frosted-Glass Canvas HUDs */
+.cv-hud {
+ position: absolute;
+ z-index: 15;
+ display: inline-flex;
+ align-items: center;
+ gap: 2px;
+ padding: 4px;
+ border-radius: 99px;
+ background: color-mix(in srgb, var(--bg2) 88%, transparent);
+ border: 1px solid var(--line2);
+ box-shadow: 0 6px 20px rgba(0, 0, 0, .09);
+ backdrop-filter: blur(14px);
+ -webkit-backdrop-filter: blur(14px);
}
-.res img {
- width: 100%;
- height: 100%;
- object-fit: cover;
+.cv-hud-tl {
+ top: 12px;
+ left: 12px;
}
-.out-act {
- flex-wrap: wrap;
- background: var(--sf);
- border-radius: 14px;
- padding: 8px;
+.cv-hud-br {
+ bottom: 12px;
+ right: 12px;
}
-.out-act small {
- color: var(--mu);
+.cv-hud button {
+ min-height: 28px;
+ padding: 4px 9px;
+ border-radius: 99px;
+ background: transparent;
+ color: var(--tx2);
font-size: 12px;
- overflow-wrap: anywhere;
+ font-weight: 560;
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
}
-.out-act button {
- background: var(--bg2);
+.cv-hud button:hover {
+ background: var(--sf);
+ color: var(--tx);
}
-.out-act #wbDl {
+.cv-hud button.on {
background: var(--tx);
color: var(--bg);
}
-/* Studio right column: provider button, prompt, options, mini history, generate bar */
-.cfg {
- gap: 10px;
- padding: 11px 14px;
- background: var(--bg2);
- flex: none;
-}
-
-.cfg b {
- font-weight: 600;
- color: var(--ac);
+.cv-sep {
+ width: 1px;
+ height: 16px;
+ margin: 0 2px;
+ background: var(--line2);
}
-.st-r .cfg {
- width: 100%;
- justify-content: flex-start;
- border-radius: 14px;
+.cv-zen-bar {
+ position: absolute;
+ top: 12px;
+ right: 12px;
+ z-index: 16;
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ padding: 5px 6px 5px 10px;
+ border-radius: 99px;
+ background: color-mix(in srgb, var(--bg2) 92%, transparent);
+ border: 1px solid var(--line2);
+ box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
+ backdrop-filter: blur(14px);
+ -webkit-backdrop-filter: blur(14px);
}
-.st-r .cfg b {
- margin-left: auto;
+.cv-zen-info {
+ font-size: 12px;
+ color: var(--tx2);
+ font-weight: 550;
}
-.dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: var(--mu);
+.board-actions {
+ position: absolute;
+ left: 50%;
+ bottom: 72px;
+ transform: translateX(-50%);
+ z-index: 14;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-wrap: wrap;
+ gap: 8px;
}
-.dot.on {
- background: var(--ok);
- box-shadow: 0 0 0 3px rgba(33, 163, 102, .18);
+.board-use {
+ min-height: 38px;
+ padding: 8px 16px;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ font-size: 13px;
+ box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
-.prompt-panel {
- padding: 13px 14px;
+.board-use::after {
+ content: "↗";
+ font-size: 15px;
}
-.prompt-panel .sh {
- margin: 0 0 8px;
+.board-shuffle::after {
+ content: "↻";
}
-.prompt-panel .sh b {
- font-size: 14px;
+/* Compact mobile fallback (< 560px) — zero horizontal overflow, touch-friendly flow */
+.reference-board[data-layout=compact] {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 14px;
+ height: auto;
+ overflow: visible;
+ padding: 48px 12px 18px;
}
-.prompt-panel #wbPrompt {
- display: block;
- margin: 0;
- padding: 9px 10px;
- min-height: 88px;
- max-height: 28vh;
- font-size: 13px;
- line-height: 1.55;
- color: var(--tx);
- border: 1px solid transparent;
- border-radius: 9px;
+.reference-board[data-layout=compact] .cv-viewport,
+.reference-board[data-layout=compact] .cv-world {
+ position: static;
+ width: 100%;
+ height: auto;
+ transform: none !important;
+ cursor: default;
+ touch-action: auto;
}
-.prompt-panel #wbPrompt:focus {
- border-color: var(--tx2);
- background: var(--bg2);
+.reference-board[data-layout=compact] .cv-wires,
+.reference-board[data-layout=compact] .cv-rsz {
+ display: none;
}
-.prompt-tools {
+.reference-board[data-layout=compact] .board-cards {
display: flex;
- align-items: center;
+ justify-content: center;
flex-wrap: wrap;
- gap: 4px;
- margin-top: 8px;
-}
-
-.prompt-tools .sm.ghost {
- padding: 5px 7px;
- font-size: 12px;
+ gap: 8px;
+ width: 100%;
}
-.quick,
-.adv,
-.st-r .hist {
- background: var(--bg2);
- padding: 12px 14px;
- margin: 0;
+.reference-board[data-layout=compact] .board-card {
+ position: relative;
+ left: auto !important;
+ top: auto !important;
+ transform: none !important;
+ width: calc(33.33% - 6px) !important;
+ min-width: 84px;
+ max-width: 148px;
+ padding: 4px;
+ border-radius: 11px;
+ cursor: pointer;
}
-.lab0 {
- font-size: 12px;
- font-weight: 700;
- color: var(--mu);
- margin-bottom: 8px;
+.reference-board[data-layout=compact] .cv-notes,
+.reference-board[data-layout=compact] .cv-outputs {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ width: 100%;
+ margin-top: 10px;
}
-.quick .chips .chip {
- padding: 6px 11px;
- font-size: 12.5px;
+.reference-board[data-layout=compact] .cv-note,
+.reference-board[data-layout=compact] .cv-hub,
+.reference-board[data-layout=compact] .cv-out-node {
+ position: relative;
+ left: auto !important;
+ top: auto !important;
+ transform: none !important;
+ width: 100% !important;
}
-.q2 {
- margin-top: 10px;
+.reference-board[data-layout=compact] .board-actions {
+ position: static;
+ transform: none;
}
-.q2 .row {
- margin: 0;
- gap: 10px;
- flex-wrap: nowrap;
+.reference-board[data-layout=compact] .cv-hud-tl {
+ top: 8px;
+ left: 8px;
+ right: 8px;
+ justify-content: center;
}
-.lab {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 12.5px;
- color: var(--tx2);
+/* Before/after comparison, busy & output controls */
+.cmp {
+ position: relative;
+ --x: 50%;
+ width: 100%;
+ height: 100%;
+ min-height: 0;
+ max-height: none;
+ background: var(--sf);
+ user-select: none;
}
-.q2 select {
- padding: 6px 28px 6px 12px;
- font-size: 12.5px;
+.cmp > img,
+.bef img {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: contain;
}
-.adv summary {
- cursor: pointer;
- list-style: none;
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 13.5px;
- font-weight: 700;
+.bef {
+ position: absolute;
+ inset: 0;
+ clip-path: inset(0 calc(100% - var(--x)) 0 0);
}
-.adv summary::-webkit-details-marker {
- display: none;
+.hdl {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: var(--x);
+ width: 2px;
+ background: #fff;
+ pointer-events: none;
}
-.adv summary::after {
- content: "";
- margin-left: auto;
- width: 7px;
- height: 7px;
- border-right: 1.8px solid var(--mu);
- border-bottom: 1.8px solid var(--mu);
- transform: rotate(45deg) translateY(-2px);
- transition: transform .2s;
+.hdl span {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 40px;
+ height: 40px;
+ transform: translate(-50%, -50%);
+ border-radius: 50%;
+ background: #fff;
+ box-shadow: var(--sh2);
}
-.adv[open] summary::after {
- transform: rotate(-135deg);
+.hdl span::before {
+ content: "‹ ›";
+ position: absolute;
+ inset: 0;
+ display: grid;
+ place-items: center;
+ color: #111;
+ font-size: 15px;
+ letter-spacing: 2px;
}
-.adv summary small {
- font-size: 11.5px;
- color: var(--mu);
- font-weight: 400;
+#wbRange {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ cursor: ew-resize;
+ margin: 0;
}
-.adv-b {
- margin-top: 10px;
+#wbRange:focus-visible + em {
+ outline: 2px solid var(--ac);
}
-.adv-b .mt {
- margin: 0 0 4px;
+.cmp em {
+ position: absolute;
+ top: 14px;
+ font-size: 12px;
+ font-style: normal;
+ font-weight: 600;
+ color: #fff;
+ background: rgba(0, 0, 0, .5);
+ padding: 4px 11px;
+ border-radius: 99px;
+ pointer-events: none;
}
-.adv-b textarea {
- font-size: 12.5px;
-}
+.cmp em.l { left: 14px; }
+.cmp em.r { right: 14px; }
-.st-r .hist:has(.hl:empty) {
+.cmp.solo .bef,
+.cmp.solo .hdl,
+.cmp.solo input,
+.cmp.solo em {
display: none;
}
-.st-r .hist .sh {
- margin-bottom: 8px;
-}
-
-.st-r .hist .sh b {
- font-size: 14px;
-}
-
-.st-r .hist .sh small {
- display: none;
+.busy {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 10px;
+ background: color-mix(in srgb, var(--bg2) 88%, transparent);
+ z-index: 2;
+ isolation: isolate;
}
-.hl {
- display: flex;
- gap: 8px;
- overflow-x: auto;
- padding-bottom: 6px;
+.skel0 {
+ position: absolute;
+ inset: 24px;
+ margin: auto;
+ max-width: 420px;
+ border-radius: 16px;
+ background: linear-gradient(100deg, #ececec 30%, #f8f8f8 50%, #ececec 70%);
+ background-size: 250% 100%;
+ animation: sh 1.4s infinite linear;
+ z-index: -1;
+ opacity: .9;
}
-.st-r .hl:empty::before {
- content: "生成后会保存在这里(仅本机)";
- font-size: 12.5px;
- color: var(--mu);
+[data-theme=dark] .skel0 {
+ background-image: linear-gradient(100deg, #222 30%, #2c2c2c 50%, #222 70%);
}
-html:lang(en) .st-r .hl:empty::before {
- content: "Generated images are saved here on this device.";
+.busy b,
+.busy small,
+.busy button {
+ position: relative;
}
-html:lang(ja) .st-r .hl:empty::before {
- content: "生成した画像はこの端末に保存されます。";
+.busy b {
+ background: var(--bg2);
+ padding: 8px 16px;
+ border-radius: 99px;
+ font-size: 14px;
+ font-weight: 600;
+ margin-top: 8px;
+ box-shadow: var(--sh1);
}
-html:lang(vi) .st-r .hl:empty::before {
- content: "Ảnh đã tạo được lưu tại đây trên thiết bị này.";
+.busy small {
+ color: var(--mu);
+ font-size: 12.5px;
}
-html:lang(tr) .st-r .hl:empty::before {
- content: "Oluşturulan görseller bu cihazda burada saklanır.";
+.busy button {
+ background: var(--bg2);
}
-.hl button {
- position: relative;
- flex: none;
- padding: 0;
- width: 54px;
- height: 72px;
+#wbProg {
+ appearance: none;
+ width: min(220px, 65%);
+ height: 5px;
+ border: 0;
+ border-radius: 8px;
overflow: hidden;
- background: var(--ph);
- border-radius: 10px;
- transition: transform .2s;
+ background: var(--sf2);
+ accent-color: var(--ac);
}
-.hl button:hover {
- transform: translateY(-2px);
+#wbProg::-webkit-progress-bar {
+ background: var(--sf2);
+ border-radius: 8px;
}
-.hl img {
- width: 100%;
- height: 100%;
- object-fit: cover;
+#wbProg::-webkit-progress-value {
+ background: var(--ac);
+ border-radius: 8px;
}
-.st-r .hl span {
- display: none;
+#wbProg:indeterminate {
+ background: var(--sf2) linear-gradient(90deg, transparent, var(--ac), transparent) no-repeat;
+ background-size: 48% 100%;
+ animation: rendering 1.5s ease-in-out infinite alternate;
}
-.hl i {
- position: absolute;
- right: 4px;
- top: 4px;
- width: 18px;
- height: 18px;
- border-radius: 50%;
- background: rgba(0, 0, 0, .55);
- color: #fff;
- font-style: normal;
- font-size: 12px;
- line-height: 18px;
+#wbProg:indeterminate::-webkit-progress-inner-element {
display: none;
}
-.hl button:hover i {
- display: block;
+@keyframes rendering {
+ from { background-position: -40% 0; }
+ to { background-position: 140% 0; }
}
-#wbHist em {
+.err {
position: absolute;
- left: 4px;
- top: 4px;
- font-style: normal;
- font-size: 10px;
- background: rgba(0, 0, 0, .55);
- color: #fff;
- border-radius: 6px;
- padding: 0 4px;
+ inset: auto 16px 16px;
+ background: var(--bg2);
+ padding: 14px 18px;
+ z-index: 3;
+ border-radius: 14px;
+ box-shadow: var(--sh2);
}
-.hl button.hist-more {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 4px;
- font-size: 11px;
- color: var(--mu);
- text-align: center;
- background: var(--sf);
- border: 1px dashed var(--line2);
- cursor: pointer;
+.err b {
+ color: var(--bad);
+ font-size: 15px;
}
-.hl button.hist-more:hover {
- color: var(--tx);
- border-color: var(--ac);
- transform: none;
+.err p {
+ margin: 6px 0 4px;
+ font-size: 13px;
+ color: var(--tx2);
+ line-height: 1.7;
+ word-break: break-word;
}
-.hl button.hist-more b {
+#wbErr .raw {
+ margin-top: 10px;
font-size: 12px;
- display: block;
- color: var(--tx);
+ color: var(--tx2);
}
-.hl button.hist-more small {
- font-size: 10px;
- color: var(--mu);
- display: block;
+#wbErr .raw summary,
+#wbSentD summary {
+ cursor: pointer;
+ width: max-content;
}
-.st-r > .sp {
- flex: 1 1 0;
- min-height: 0;
+#wbErr .raw pre,
+#wbSentD pre {
+ white-space: pre-wrap;
+ overflow-wrap: anywhere;
+ max-height: 140px;
+ overflow: auto;
+ background: var(--sf);
+ border-radius: 10px;
+ padding: 8px 10px;
+ margin: 8px 0 6px;
+ font-size: 11.5px;
}
-.st-r .gobar {
- position: sticky;
- bottom: 0;
- z-index: 5;
- margin-top: auto;
- border-radius: 20px;
- padding: 12px;
- background: var(--bg2);
- box-shadow: 0 -5px 14px color-mix(in srgb, var(--bg) 75%, transparent);
+#wbSentD {
+ margin: 8px 2px 0;
+ font-size: 12px;
+ color: var(--tx2);
}
-.gb-i {
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 0 4px 10px;
+#wbSentD pre {
+ max-height: 160px;
+ margin: 6px 0 0;
}
-.gb-i > span {
- flex: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
+#wbErr p + p.fine {
+ margin-top: -4px;
}
-.gb-i b {
- font-size: 14px;
+.warn {
+ margin-top: 10px;
+ font-size: 12.5px;
+ color: #b4501f;
+ background: #fff4ea;
+ padding: 9px 14px;
+ border-radius: 12px;
}
-.cfgchip {
- display: none;
- font-size: 12px;
- padding: 6px 12px;
- gap: 7px;
- background: var(--sf);
+[data-theme=dark] .warn {
+ background: #2a1f16;
+ color: #f0a46a;
}
-.big {
- width: 100%;
- padding: 15px;
- font-size: 16px;
- font-weight: 600;
- margin: 0;
- border-radius: 14px;
- box-shadow: none;
+.st-c .out-act,
+.st-c .warn,
+.st-c .res,
+.st-c .sent {
+ margin: 8px 12px;
}
-.big:hover {
- transform: translateY(-1px);
+.res {
+ display: flex;
+ gap: 8px;
+ overflow-x: auto;
+ padding: 3px;
}
-.gobar .big:disabled {
- background: #f1f1f1;
- color: #aaa;
- box-shadow: none;
- opacity: 1;
- cursor: not-allowed;
+.res button {
+ padding: 0;
+ width: 56px;
+ height: 74px;
+ flex: none;
+ overflow: hidden;
+ border-radius: 12px;
+ transition: transform .2s;
}
-[data-theme=dark] .gobar .big:disabled {
- background: #2a2a2a;
- color: #666;
+.res button:hover {
+ transform: translateY(-2px);
}
-#wbGo {
- position: relative;
- overflow: hidden;
+.res button.on {
+ box-shadow: 0 0 0 2.5px var(--ac);
}
-#wbGo .ring {
- display: inline-block;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- border: 2px solid rgba(255, 255, 255, .35);
- border-top-color: #fff;
- margin-right: 8px;
- vertical-align: -3px;
- animation: spin .8s linear infinite;
+.res img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
}
-/* ==========================================================================
- 8. Picker, Settings, Modals, Toast & Motion Effects
- ========================================================================== */
-
-#helpBox, #pk, #cfg {
- position: fixed;
- inset: 0;
- z-index: 70;
- display: grid;
- place-items: center;
- background: rgba(0, 0, 0, .45);
- padding: 20px;
- animation: fade .2s both;
+.out-act {
+ flex-wrap: wrap;
+ background: var(--sf);
+ border-radius: 14px;
+ padding: 8px;
}
-.mdl {
- position: fixed;
- inset: 0;
- z-index: 80;
- display: grid;
- place-items: center;
- background: rgba(0, 0, 0, .45);
- padding: 20px;
- animation: fade .2s both;
+.out-act small {
+ color: var(--mu);
+ font-size: 12px;
+ overflow-wrap: anywhere;
}
-.hb {
+.out-act button {
background: var(--bg2);
- padding: 28px 30px;
- width: min(440px, 100%);
- box-shadow: var(--sh3);
- border-radius: 22px;
}
-.hb h3 {
- font-size: 20px;
- margin-bottom: 14px;
+.out-act #wbDl {
+ background: var(--tx);
+ color: var(--bg);
}
-.hb dl {
- display: grid;
- grid-template-columns: auto 1fr;
- gap: 9px 18px;
- margin: 0 0 22px;
- font-size: 13.5px;
+/* Studio right column: provider button, prompt, options, mini history, generate bar */
+.cfg {
+ gap: 10px;
+ padding: 11px 14px;
+ background: var(--bg2);
+ flex: none;
}
-.hb dd {
- margin: 0;
- color: var(--tx2);
+.cfg b {
+ font-weight: 600;
+ color: var(--ac);
}
-.hb .pri {
+.st-r .cfg {
width: 100%;
+ justify-content: flex-start;
+ border-radius: 14px;
}
-.mdl .hb p {
- color: var(--tx2);
- font-size: 14px;
- line-height: 1.75;
- margin: 0 0 18px;
+.st-r .cfg b {
+ margin-left: auto;
}
-.mdl .row {
- display: flex;
- gap: 10px;
- justify-content: flex-end;
+.dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: var(--mu);
}
-.mdl .hb .pri {
- width: auto;
+.dot.on {
+ background: var(--ok);
+ box-shadow: 0 0 0 3px rgba(33, 163, 102, .18);
}
-.pl {
- margin: 0 0 18px;
- padding-left: 18px;
- font-size: 13.5px;
- line-height: 1.75;
- color: var(--tx2);
+.prompt-panel {
+ padding: 13px 14px;
}
-.pl li {
- margin-bottom: 8px;
+.prompt-panel .sh {
+ margin: 0 0 8px;
}
-.pl b {
+.prompt-panel .sh b {
+ font-size: 14px;
+}
+
+.prompt-panel #wbPrompt {
+ display: block;
+ margin: 0;
+ padding: 9px 10px;
+ min-height: 88px;
+ max-height: 28vh;
+ font-size: 13px;
+ line-height: 1.55;
color: var(--tx);
+ border: 1px solid transparent;
+ border-radius: 9px;
}
-.cnote {
- font-size: 12.5px;
- color: var(--mu);
- margin: 18px 0 0;
- text-align: center;
+.prompt-panel #wbPrompt:focus {
+ border-color: var(--tx2);
+ background: var(--bg2);
}
-.lnkb {
- background: none;
- border: 0;
- padding: 0 0 0 6px;
- color: var(--tx);
- text-decoration: underline;
- font-size: inherit;
- cursor: pointer;
+.prompt-tools {
+ display: flex;
+ align-items: center;
+ flex-wrap: nowrap;
+ gap: 2px;
+ margin-top: 8px;
}
-/* Picker & provider settings modals */
-.pk-box, .cfg-box {
- background: var(--bg2);
- width: min(1000px, 100%);
- max-height: 86vh;
- display: flex;
- flex-direction: column;
- box-shadow: var(--sh3);
- border-radius: 24px;
- overflow: hidden;
+.prompt-tools .seg.sm button {
+ padding: 4px 8px;
+ font-size: 11.5px;
}
-.cfg-box {
- width: min(580px, 100%);
- max-height: 92vh;
+.prompt-tools .sm.ghost {
+ padding: 4px 6px;
+ font-size: 11.5px;
+ white-space: nowrap;
}
-.pk-h {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: 16px 16px 16px 24px;
+.fmt-menu {
+ position: relative;
}
-.pk-h b {
- font-size: 18px;
- font-weight: 700;
- flex: none;
+.fmt-menu > summary {
+ list-style: none;
+ cursor: pointer;
+ user-select: none;
+ display: inline-flex;
+ align-items: center;
+ border-radius: 8px;
+ color: var(--tx2);
+ font-weight: 500;
+ transition: background .15s, color .15s;
}
-#cfg .pk-h {
- justify-content: space-between;
+.fmt-menu > summary::-webkit-details-marker {
+ display: none;
}
-#pkQ {
- flex: 1;
- min-width: 0;
- font: inherit;
+.fmt-menu > summary:hover,
+.fmt-menu[open] > summary {
background: var(--sf);
color: var(--tx);
- border: 1.5px solid transparent;
- border-radius: 99px;
- padding: 9px 16px;
- outline: 0;
- transition: border-color .18s, background .18s;
}
-#pkQ:focus {
+.fmt-pop {
+ position: absolute;
+ right: 0;
+ bottom: calc(100% + 6px);
+ z-index: 25;
+ min-width: 168px;
+ padding: 5px;
background: var(--bg2);
- border-color: var(--tx2);
+ border: 1px solid var(--line2);
+ border-radius: 12px;
+ box-shadow: var(--sh2);
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
}
-#pkDone, #pkX, #cfgX {
- flex: none;
+.fmt-pop button {
+ width: 100%;
+ justify-content: flex-start;
+ padding: 7px 10px;
+ border-radius: 8px;
+ background: transparent;
+ color: var(--tx);
+ font-size: 12.5px;
+ font-weight: 500;
+ text-align: left;
+ white-space: nowrap;
}
-#pkPoseTypes {
- align-self: flex-start;
- flex: none;
- margin: 0 24px 10px;
+.fmt-pop button:hover {
+ background: var(--sf);
}
-#pkPoseTypes button {
- min-height: 30px;
- padding-inline: 14px;
+.quick,
+.adv,
+.st-r .hist {
+ background: var(--bg2);
+ padding: 12px 14px;
+ margin: 0;
}
-.pk-types {
- display: flex;
- flex: none;
- align-items: center;
- flex-wrap: wrap;
+.lab0 {
+ font-size: 12px;
+ font-weight: 700;
+ color: var(--mu);
+ margin-bottom: 8px;
+}
+
+.quick #wbStyles {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 5px;
- margin: 0 24px 10px;
}
-.pk-types button {
- min-height: 32px;
- padding: 6px 12px;
- font-size: 12.5px;
- color: var(--tx2);
+.quick .chips .chip {
+ padding: 5px 4px;
+ font-size: 11.5px;
+ line-height: 1.25;
+ min-height: 30px;
+ justify-content: center;
+ text-align: center;
+ border-radius: 9px;
+ white-space: normal;
}
-.pk-types button:is(.on, [aria-pressed=true]) {
- background: var(--tx);
- color: var(--bg);
+.q2 {
+ display: flex;
+ flex-direction: column;
+ align-items: stretch;
+ gap: 8px;
+ margin-top: 10px;
}
-.pk-bar {
+.q2 .row {
+ margin: 0;
+ gap: 10px;
+ flex-wrap: nowrap;
+}
+
+.lab {
display: flex;
align-items: center;
gap: 8px;
- margin: 0 24px 10px;
- min-width: 0;
+ font-size: 12.5px;
+ color: var(--tx2);
}
-#pkFavOnly {
- flex: none;
- padding: 5px 12px;
- font-size: 12.5px;
- min-height: 30px;
- border: 1px solid var(--line2);
- background: var(--bg2);
+.shot-lab {
+ width: 100%;
}
-#pkFavOnly.on {
- background: var(--ac);
- border-color: var(--ac);
- color: #fff;
+.shot-lab select {
+ flex: 1;
+ min-width: 0;
}
-.pk-cats {
+.q2 select {
+ padding: 6px 28px 6px 12px;
+ font-size: 12.5px;
+}
+
+.adv summary {
+ cursor: pointer;
+ list-style: none;
display: flex;
align-items: center;
- gap: 6px;
- overflow-x: auto;
- scrollbar-width: none;
- min-width: 0;
- flex: 1;
- padding: 1px 2px;
+ gap: 8px;
+ font-size: 13.5px;
+ font-weight: 700;
}
-.pk-cats::-webkit-scrollbar {
+.adv summary::-webkit-details-marker {
display: none;
}
-.pk-cats .chip {
- flex: none;
- padding: 5px 11px;
- font-size: 12px;
- min-height: 30px;
+.adv summary::after {
+ content: "";
+ margin-left: auto;
+ width: 7px;
+ height: 7px;
+ border-right: 1.8px solid var(--mu);
+ border-bottom: 1.8px solid var(--mu);
+ transform: rotate(45deg) translateY(-2px);
+ transition: transform .2s;
}
-.pk-g {
- overflow: auto;
- padding: 6px 24px 24px;
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
- gap: 18px 12px;
+.adv[open] summary::after {
+ transform: rotate(-135deg);
}
-.pk-g .skel {
- aspect-ratio: 3 / 4;
+.adv summary small {
+ font-size: 11.5px;
+ color: var(--mu);
+ font-weight: 400;
}
-.pk-g button {
- position: relative;
- flex-direction: column;
- align-items: stretch;
- padding: 0;
- background: transparent;
- gap: 6px;
- text-align: left;
- border-radius: 0;
+.adv-b {
+ margin-top: 10px;
}
-.pk-g img {
- aspect-ratio: 3 / 4;
- object-fit: cover;
- background: var(--ph);
- width: 100%;
- border-radius: 12px;
- transition: box-shadow .15s;
+.adv-b .mt {
+ margin: 0 0 4px;
}
-.pk-g button.pose img {
- object-fit: contain;
- background: var(--phw);
+.adv-b textarea {
+ font-size: 12.5px;
}
-.pk-g button.depth img {
- object-fit: contain;
+.neg-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ margin: 10px 0 4px;
}
-.pk-g button:hover img {
- box-shadow: 0 0 0 2px var(--line2);
+.neg-head label {
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--tx2);
}
-.pk-g button.on img {
- box-shadow: 0 0 0 3px var(--ac);
+#wbNegFill {
+ padding: 3px 8px;
+ font-size: 11.5px;
}
-.pk-g button.on::after {
- content: "";
- position: absolute;
- top: 7px;
- right: 7px;
- width: 22px;
- height: 22px;
- border-radius: 50%;
- background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
- box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
+.st-r .hist:has(.hl:empty) {
+ display: none;
}
-.pk-g span {
- font-size: 12px;
- font-weight: 400;
- color: var(--tx2);
- overflow: hidden;
- text-overflow: ellipsis;
+.st-r .hist .sh {
+ margin-bottom: 8px;
}
-.pk-g button.on span {
- color: var(--ac);
- font-weight: 600;
+.st-r .hist .sh b {
+ font-size: 14px;
}
-.cfg-b {
- padding: 4px 24px 20px;
- overflow: auto;
+.st-r .hist .sh small {
+ display: none;
+}
+
+.hl {
display: flex;
- flex-direction: column;
- gap: 12px;
+ gap: 8px;
+ overflow-x: auto;
+ padding-bottom: 6px;
}
-.grp {
- font-size: 12px;
- font-weight: 700;
+.st-r .hl:empty::before {
+ content: "生成后会保存在这里(仅本机)";
+ font-size: 12.5px;
color: var(--mu);
- letter-spacing: .04em;
- margin-top: 6px;
}
-.prov {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
- gap: 8px;
+html:lang(en) .st-r .hl:empty::before {
+ content: "Generated images are saved here on this device.";
}
-.prov label {
- cursor: pointer;
+html:lang(ja) .st-r .hl:empty::before {
+ content: "生成した画像はこの端末に保存されます。";
}
-.prov input {
- position: absolute;
- opacity: 0;
+html:lang(vi) .st-r .hl:empty::before {
+ content: "Ảnh đã tạo được lưu tại đây trên thiết bị này.";
}
-.prov span {
- display: flex;
- flex-direction: column;
- gap: 2px;
- background: var(--sf);
- border: 2px solid transparent;
- padding: 12px 10px;
- border-radius: 14px;
- height: 100%;
- transition: .2s;
+html:lang(tr) .st-r .hl:empty::before {
+ content: "Oluşturulan görseller bu cihazda burada saklanır.";
}
-.prov b {
- display: block;
- font-size: 13.5px;
- font-weight: 700;
+.hl button {
+ position: relative;
+ flex: none;
+ padding: 0;
+ width: 54px;
+ height: 72px;
+ overflow: hidden;
+ background: var(--ph);
+ border-radius: 10px;
+ transition: transform .2s;
}
-.prov small {
- font-size: 11.5px;
- color: var(--mu);
+.hl button:hover {
+ transform: translateY(-2px);
}
-.prov input:checked + span {
- border-color: var(--tx);
- background: var(--bg2);
+.hl img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
}
-.prov input:focus-visible + span {
- outline: 2px solid var(--ac);
+.st-r .hl span {
+ display: none;
}
-.lg {
- width: 30px;
- height: 30px;
- border-radius: 9px;
- display: grid;
- place-items: center;
+.hl i {
+ position: absolute;
+ right: 4px;
+ top: 4px;
+ width: 18px;
+ height: 18px;
+ border-radius: 50%;
+ background: rgba(0, 0, 0, .55);
color: #fff;
font-style: normal;
- font-size: 15px;
- font-weight: 700;
- margin-bottom: 6px;
-}
-
-.local-lg {
- background: var(--tx);
- color: var(--bg);
-}
-
-.local-lg svg {
- width: 17px;
- height: 17px;
- fill: none;
- stroke: currentColor;
- stroke-width: 1.8;
- stroke-linecap: round;
- stroke-linejoin: round;
+ font-size: 12px;
+ line-height: 18px;
+ display: none;
}
-@keyframes hl {
- 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 35%, transparent); }
- 100% { box-shadow: 0 0 0 0 transparent; }
+.hl button:hover i {
+ display: block;
}
-#cfg .prov.hl {
- animation: hl 1.6s ease-out;
- border-radius: 14px;
+#wbHist em {
+ position: absolute;
+ left: 4px;
+ top: 4px;
+ font-style: normal;
+ font-size: 10px;
+ background: rgba(0, 0, 0, .55);
+ color: #fff;
+ border-radius: 6px;
+ padding: 0 4px;
}
-.fld {
+.hl button.hist-more {
display: flex;
flex-direction: column;
- gap: 6px;
- font-size: 13px;
- font-weight: 600;
+ align-items: center;
+ justify-content: center;
+ padding: 4px;
+ font-size: 11px;
+ color: var(--mu);
+ text-align: center;
+ background: var(--sf);
+ border: 1px dashed var(--line2);
+ cursor: pointer;
+}
+
+.hl button.hist-more:hover {
color: var(--tx);
+ border-color: var(--ac);
+ transform: none;
}
-.fld input,
-.fld select {
- font: 14px var(--sans);
+.hl button.hist-more b {
+ font-size: 12px;
+ display: block;
color: var(--tx);
- background-color: var(--sf);
- border: 1.5px solid transparent;
- border-radius: 12px;
- padding: 10px 13px;
- outline: 0;
- width: 100%;
}
-.fld input:focus {
- border-color: var(--tx);
- background: var(--bg2);
+.hl button.hist-more small {
+ font-size: 10px;
+ color: var(--mu);
+ display: block;
}
-.kw {
- display: flex;
- gap: 6px;
+.st-r > .sp {
+ flex: 1 1 0;
+ min-height: 0;
}
-.kw input {
- flex: 1;
+.st-r .gobar {
+ position: sticky;
+ bottom: 0;
+ z-index: 5;
+ margin-top: auto;
+ border-radius: 20px;
+ padding: 12px;
+ background: var(--bg2);
+ box-shadow: 0 -5px 14px color-mix(in srgb, var(--bg) 75%, transparent);
}
-.tg {
+.gb-i {
display: flex;
+ align-items: center;
gap: 10px;
- align-items: flex-start;
- font-size: 13px;
- cursor: pointer;
+ padding: 0 4px 10px;
}
-.tg input {
- margin-top: 3px;
- accent-color: var(--ac);
- width: 16px;
- height: 16px;
+.gb-i > span {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
}
-.tg b {
- font-weight: 600;
- display: block;
+.gb-i b {
+ font-size: 14px;
}
-.tg small {
- color: var(--mu);
+.cfgchip {
+ display: none;
font-size: 12px;
- line-height: 1.6;
-}
-
-.note {
- font-size: 12.5px;
- line-height: 1.75;
- color: var(--tx2);
+ padding: 6px 12px;
+ gap: 7px;
background: var(--sf);
- padding: 12px 14px;
- border-radius: 12px;
}
-.note b {
- display: block;
- color: var(--tx);
+.big {
+ width: 100%;
+ padding: 15px;
+ font-size: 16px;
font-weight: 600;
+ margin: 0;
+ border-radius: 14px;
+ box-shadow: none;
}
-#cfHelp {
- margin: 0;
- padding: 10px 12px;
- background: var(--sf);
- border-radius: 12px;
- color: var(--tx2);
-}
-
-#cfHelp:empty {
- display: none;
+.big:hover {
+ transform: translateY(-1px);
}
-#cfHelp a {
- color: var(--ac);
- font-weight: 600;
- text-decoration: none;
+.gobar .big:disabled {
+ background: #f1f1f1;
+ color: #aaa;
+ box-shadow: none;
+ opacity: 1;
+ cursor: not-allowed;
}
-#cfLocalSetup summary {
- width: fit-content;
- cursor: pointer;
+[data-theme=dark] .gobar .big:disabled {
+ background: #2a2a2a;
+ color: #666;
}
-#cfLocalSetup p {
- margin: 6px 0 0;
+#wbGo {
+ position: relative;
+ overflow: hidden;
}
-#cfLocalSetup a {
- color: var(--tx);
- text-underline-offset: 3px;
+#wbGo .ring {
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ border: 2px solid rgba(255, 255, 255, .35);
+ border-top-color: #fff;
+ margin-right: 8px;
+ vertical-align: -3px;
+ animation: spin .8s linear infinite;
}
-#cfg.local-engine .cfg-b :is(.fld:not(#cfCheckpointW), .tg, .note),
-#cfg.local-engine .cfg-b .grp:not(:first-child),
-#cfg.local-engine #cfClr {
- display: none;
-}
+/* ==========================================================================
+ 8. Picker, Settings, Modals, Toast & Motion Effects
+ ========================================================================== */
-.cfg-f {
- display: flex;
- gap: 8px;
- padding: 14px 24px;
- border-top: 1px solid var(--line);
+#helpBox, #pk, #cfg {
+ position: fixed;
+ inset: 0;
+ z-index: 70;
+ display: grid;
+ place-items: center;
+ background: rgba(0, 0, 0, .45);
+ padding: 20px;
+ animation: fade .2s both;
}
-/* Toast, back-to-top & micro particles */
-#toast {
+.mdl {
position: fixed;
- left: 50%;
- bottom: calc(32px + env(safe-area-inset-bottom));
- transform: translate(-50%, 14px);
- opacity: 0;
- display: flex;
- align-items: center;
- gap: 14px;
- background: rgba(17, 17, 17, .92);
- color: #fff;
- padding: 11px 22px;
- border-radius: 99px;
- transition: transform .35s var(--out), opacity .25s;
- z-index: 99;
- pointer-events: none;
- font-size: 13.5px;
- box-shadow: var(--sh2);
+ inset: 0;
+ z-index: 80;
+ display: grid;
+ place-items: center;
+ background: rgba(0, 0, 0, .45);
+ padding: 20px;
+ animation: fade .2s both;
}
-#toast.on {
- opacity: 1;
- transform: translate(-50%, 0);
- animation: tspr .5s cubic-bezier(.34, 1.56, .64, 1);
+.hb {
+ background: var(--bg2);
+ padding: 28px 30px;
+ width: min(440px, 100%);
+ box-shadow: var(--sh3);
+ border-radius: 22px;
}
-@keyframes tspr {
- from { opacity: 0; transform: translate(-50%, 14px) scale(.96); }
+.hb h3 {
+ font-size: 20px;
+ margin-bottom: 14px;
}
-#toast.act {
- pointer-events: auto;
- padding-right: 8px;
+.hb dl {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ gap: 9px 18px;
+ margin: 0 0 22px;
+ font-size: 13.5px;
}
-#toast button {
- background: rgba(255, 255, 255, .14);
- color: #fff;
- border-radius: 99px;
- padding: 5px 12px;
- font-size: 13px;
- font-weight: 600;
- min-height: 0;
+.hb dd {
+ margin: 0;
+ color: var(--tx2);
}
-#toast button:hover {
- background: rgba(255, 255, 255, .24);
+.hb .pri {
+ width: 100%;
}
-body.tray:not(.studio) #toast {
- bottom: auto;
- top: calc(var(--hdr, 72px) + 14px);
+.mdl .hb p {
+ color: var(--tx2);
+ font-size: 14px;
+ line-height: 1.75;
+ margin: 0 0 18px;
}
-body:has(#trayFab:not([hidden])) #toast {
- bottom: calc(var(--dock-edge) + 60px);
+.mdl .row {
+ display: flex;
+ gap: 10px;
+ justify-content: flex-end;
}
-body:has(#tray:not([hidden])) #toast {
- bottom: auto;
- top: calc(var(--hdr, 72px) + 8px);
+.mdl .hb .pri {
+ width: auto;
}
-#cfg:not([hidden]) ~ #toast,
-body:has(#cfg:not([hidden])) #toast {
- bottom: calc(84px + env(safe-area-inset-bottom));
+.pl {
+ margin: 0 0 18px;
+ padding-left: 18px;
+ font-size: 13.5px;
+ line-height: 1.75;
+ color: var(--tx2);
}
-#toTop {
- position: fixed;
- left: 24px;
- bottom: 24px;
- z-index: 25;
- background: var(--bg2);
- box-shadow: var(--sh2);
- opacity: 0;
- pointer-events: none;
- transition: opacity .3s;
+.pl li {
+ margin-bottom: 8px;
}
-#toTop.on {
- opacity: 1;
- pointer-events: auto;
+.pl b {
+ color: var(--tx);
}
-.pt {
- position: fixed;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- pointer-events: none;
- z-index: 200;
+.cnote {
+ font-size: 12.5px;
+ color: var(--mu);
+ margin: 18px 0 0;
+ text-align: center;
}
-.flyimg {
- position: fixed;
- z-index: 200;
- object-fit: cover;
- pointer-events: none;
- box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
- will-change: transform;
+.lnkb {
+ background: none;
+ border: 0;
+ padding: 0 0 0 6px;
+ color: var(--tx);
+ text-decoration: underline;
+ font-size: inherit;
+ cursor: pointer;
}
-/* ==========================================================================
- 9. Generation History Page
- ========================================================================== */
-
-#histSec {
- max-width: var(--w);
- margin: 0 auto;
- padding: 6px 24px 60px;
- min-height: calc(100vh - 180px);
+/* Picker & provider settings modals */
+.pk-box, .cfg-box {
+ background: var(--bg2);
+ width: min(1000px, 100%);
+ max-height: 86vh;
+ display: flex;
+ flex-direction: column;
+ box-shadow: var(--sh3);
+ border-radius: 24px;
+ overflow: hidden;
}
-.hist-bar {
- position: sticky;
- top: calc(var(--hdr, 72px) - 1px);
- z-index: 20;
- padding: 6px 0 10px;
- background: var(--bg);
- display: flex;
- align-items: center;
- gap: 12px;
+.cfg-box {
+ width: min(580px, 100%);
+ max-height: 92vh;
}
-.hist-bar .tbar {
+.pk-h {
display: flex;
align-items: center;
- gap: 8px;
- flex: 1;
- min-width: 0;
+ gap: 14px;
+ padding: 16px 16px 16px 24px;
}
-#histCount {
- font-size: 13px;
- color: var(--mu);
- margin-right: 4px;
- white-space: nowrap;
+.pk-h b {
+ font-size: 18px;
+ font-weight: 700;
+ flex: none;
}
-#histCount b {
- color: var(--tx);
- font-weight: 600;
+#cfg .pk-h {
+ justify-content: space-between;
}
-.hist-sel-all {
- display: flex;
- align-items: center;
- gap: 6px;
- font-size: 13px;
- color: var(--tx2);
- cursor: pointer;
- white-space: nowrap;
- user-select: none;
-}
-
-.hist-sel-all input {
- width: 16px;
- height: 16px;
- accent-color: var(--ac);
- cursor: pointer;
-}
-
-#histSelN {
- font-size: 13px;
- color: var(--ac);
- font-weight: 600;
- white-space: nowrap;
-}
-
-#histSelN b {
- font-variant-numeric: tabular-nums;
-}
-
-#histQ {
- width: 200px;
- max-width: 100%;
+#pkQ {
+ flex: 1;
+ min-width: 0;
font: inherit;
- font-size: 13px;
background: var(--sf);
color: var(--tx);
border: 1.5px solid transparent;
border-radius: 99px;
- padding: 6px 13px;
+ padding: 9px 16px;
outline: 0;
transition: border-color .18s, background .18s;
}
-#histQ:hover {
- background: var(--sf2);
-}
-
-#histQ:focus {
+#pkQ:focus {
background: var(--bg2);
border-color: var(--tx2);
}
-#histQ::placeholder {
- color: var(--mu);
+#pkDone, #pkX, #cfgX {
+ flex: none;
}
-.hist-stats {
+#pkPoseTypes {
+ align-self: flex-start;
+ flex: none;
+ margin: 0 24px 10px;
+}
+
+#pkPoseTypes button {
+ min-height: 30px;
+ padding-inline: 14px;
+}
+
+.pk-types {
display: flex;
- flex-wrap: wrap;
+ flex: none;
align-items: center;
- gap: 6px 14px;
+ flex-wrap: wrap;
+ gap: 5px;
+ margin: 0 24px 10px;
+}
+
+.pk-types button {
+ min-height: 32px;
+ padding: 6px 12px;
font-size: 12.5px;
color: var(--tx2);
- padding: 0 0 10px;
- line-height: 1.6;
- font-variant-numeric: tabular-nums;
}
-.hist-ratio {
- display: flex;
- overflow: hidden;
- flex: none;
- width: 84px;
- height: 5px;
- border-radius: 3px;
- background: var(--mu);
+.pk-types button:is(.on, [aria-pressed=true]) {
+ background: var(--tx);
+ color: var(--bg);
}
-.hist-ratio i,
-.hist-key i {
- background: var(--ac);
+.pk-bar {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin: 0 24px 10px;
+ min-width: 0;
}
-.hist-key.gen i {
- background: var(--mu);
+#pkFavOnly {
+ flex: none;
+ padding: 5px 12px;
+ font-size: 12.5px;
+ min-height: 30px;
+ border: 1px solid var(--line2);
+ background: var(--bg2);
}
-.hist-key {
- display: inline-flex;
- align-items: center;
- gap: 4px;
+#pkFavOnly.on {
+ background: var(--ac);
+ border-color: var(--ac);
+ color: #fff;
}
-.hist-key i {
- width: 6px;
- height: 6px;
- border-radius: 50%;
+.pk-cats {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ overflow-x: auto;
+ scrollbar-width: none;
+ min-width: 0;
+ flex: 1;
+ padding: 1px 2px;
}
-.hist-key b {
- color: var(--tx);
+.pk-cats::-webkit-scrollbar {
+ display: none;
}
-.hist-providers {
+.pk-cats .chip {
+ flex: none;
+ padding: 5px 11px;
font-size: 12px;
+ min-height: 30px;
}
-.hist-grid {
+.pk-g {
+ overflow: auto;
+ padding: 6px 24px 24px;
display: grid;
- grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
- gap: 28px 16px;
- max-width: var(--w);
- margin: 0;
- padding: 0 0 40px;
-}
-
-.hist-nomatch {
- grid-column: 1 / -1;
- text-align: center;
- padding: 54px 16px;
- color: var(--tx2);
+ grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
+ gap: 18px 12px;
}
-.hist-nomatch p {
- margin: 0 0 12px;
- font-size: 14px;
+.pk-g .skel {
+ aspect-ratio: 3 / 4;
}
-.hist-card {
- display: flex;
+.pk-g button {
+ position: relative;
flex-direction: column;
- min-width: 0;
- animation: rise .5s var(--out) both;
+ align-items: stretch;
+ padding: 0;
+ background: transparent;
+ gap: 6px;
+ text-align: left;
+ border-radius: 0;
}
-.hist-card .hph {
- position: relative;
+.pk-g img {
aspect-ratio: 3 / 4;
- overflow: hidden;
+ object-fit: cover;
background: var(--ph);
- cursor: pointer;
- border-radius: 16px;
- transition: transform .35s var(--out), box-shadow .35s;
+ width: 100%;
+ border-radius: 12px;
+ transition: box-shadow .15s;
}
-.hist-card:hover .hph {
- transform: translateY(-2px);
- box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
+.pk-g button.pose img {
+ object-fit: contain;
+ background: var(--phw);
}
-.hist-card .hph img {
- display: block;
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: inherit;
+.pk-g button.depth img {
+ object-fit: contain;
}
-.hist-card .hopen {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- border: 0;
- background: transparent;
- border-radius: inherit;
- padding: 0;
+.pk-g button:hover img {
+ box-shadow: 0 0 0 2px var(--line2);
}
-.hist-card .hopen:focus-visible {
- outline-offset: -3px;
+.pk-g button.on img {
+ box-shadow: 0 0 0 3px var(--ac);
}
-.hist-card .hsel {
+.pk-g button.on::after {
+ content: "";
position: absolute;
- left: 10px;
- top: 10px;
- z-index: 2;
+ top: 7px;
+ right: 7px;
width: 22px;
height: 22px;
border-radius: 50%;
- border: 2px solid #fff;
- background: rgba(0, 0, 0, .18);
- box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
- cursor: pointer;
- transition: transform .25s var(--out), background .2s;
- appearance: none;
- -webkit-appearance: none;
+ background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}
-.hist-card .hsel:checked {
- background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
- border-color: var(--ac);
- transform: scale(1.1);
+.pk-g span {
+ font-size: 12px;
+ font-weight: 400;
+ color: var(--tx2);
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-.hist-card.selected .hph {
- box-shadow: 0 0 0 3px var(--ac);
+.pk-g button.on span {
+ color: var(--ac);
+ font-weight: 600;
}
-.hist-card .hcbtns {
- position: absolute;
- right: 10px;
- top: 10px;
+.cfg-b {
+ padding: 4px 24px 20px;
+ overflow: auto;
display: flex;
flex-direction: column;
- gap: 8px;
- opacity: 0;
- transform: scale(.9);
- transition: .25s var(--out);
- z-index: 2;
+ gap: 12px;
}
-.hist-card:hover .hcbtns,
-.hcbtns:focus-within {
- opacity: 1;
- transform: none;
+.grp {
+ font-size: 12px;
+ font-weight: 700;
+ color: var(--mu);
+ letter-spacing: .04em;
+ margin-top: 6px;
}
-.hist-card .hcbtns button {
- width: 36px;
- height: 36px;
- padding: 0;
- background: #fff;
- color: #111;
- font-size: 16px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
- border-radius: 50%;
+.prov {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
+ gap: 8px;
}
-.hist-card .hcbtns button:hover {
- background: #fff;
- transform: scale(1.08);
+.prov label {
+ cursor: pointer;
}
-.hist-card .hmode {
+.prov input {
position: absolute;
- left: 10px;
- bottom: 10px;
- font-size: 11.5px;
- font-weight: 600;
- color: #fff;
- background: rgba(0, 0, 0, .55);
- padding: 2px 8px;
- border-radius: 99px;
- z-index: 1;
- pointer-events: none;
+ opacity: 0;
}
-.hist-card .hinfo {
- padding: 10px 4px 0;
- min-width: 0;
+.prov span {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ background: var(--sf);
+ border: 2px solid transparent;
+ padding: 12px 10px;
+ border-radius: 14px;
+ height: 100%;
+ transition: .2s;
}
-.hist-card .hinfo h3 {
- font-size: 14.5px;
- font-weight: 600;
- line-height: 1.4;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.prov b {
+ display: block;
+ font-size: 13.5px;
+ font-weight: 700;
}
-.hist-card .hinfo .sub {
- font-size: 12.5px;
+.prov small {
+ font-size: 11.5px;
color: var(--mu);
- margin-top: 2px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
}
-#histEmpty {
- text-align: center;
- padding: 60px 20px 100px;
- max-width: 560px;
- margin: 0 auto;
+.prov input:checked + span {
+ border-color: var(--tx);
+ background: var(--bg2);
}
-#histEmpty h3 {
- font-size: 20px;
+.prov input:focus-visible + span {
+ outline: 2px solid var(--ac);
}
-#histEmpty p {
- color: var(--tx2);
+.lg {
+ width: 30px;
+ height: 30px;
+ border-radius: 9px;
+ display: grid;
+ place-items: center;
+ color: #fff;
+ font-style: normal;
+ font-size: 15px;
+ font-weight: 700;
+ margin-bottom: 6px;
}
-.hlb-cmp {
- margin-top: 16px;
+.local-lg {
+ background: var(--tx);
+ color: var(--bg);
+}
+
+.local-lg svg {
+ width: 17px;
+ height: 17px;
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.8;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+@keyframes hl {
+ 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 35%, transparent); }
+ 100% { box-shadow: 0 0 0 0 transparent; }
+}
+
+#cfg .prov.hl {
+ animation: hl 1.6s ease-out;
border-radius: 14px;
- overflow: hidden;
- position: relative;
- --x: 50%;
}
-.hlb-cmp img {
- display: block;
+.fld {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--tx);
+}
+
+.fld input,
+.fld select {
+ font: 14px var(--sans);
+ color: var(--tx);
+ background-color: var(--sf);
+ border: 1.5px solid transparent;
+ border-radius: 12px;
+ padding: 10px 13px;
+ outline: 0;
width: 100%;
- aspect-ratio: 3 / 4;
- object-fit: cover;
}
-.hlb-cmp .hlb-bef {
- position: absolute;
- inset: 0;
- clip-path: inset(0 calc(100% - var(--x)) 0 0);
+.fld input:focus {
+ border-color: var(--tx);
+ background: var(--bg2);
}
-.hlb-cmp .hlb-hdl {
- position: absolute;
- top: 0;
- bottom: 0;
- left: var(--x);
- width: 2px;
- background: #fff;
- pointer-events: none;
+.kw {
+ display: flex;
+ gap: 6px;
}
-.hlb-cmp .hlb-hdl span {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 32px;
- height: 32px;
- transform: translate(-50%, -50%);
- border-radius: 50%;
- background: #fff;
- box-shadow: var(--sh2);
+.kw input {
+ flex: 1;
}
-.hlb-cmp .hlb-hdl span::before {
- content: "‹ ›";
- position: absolute;
- inset: 0;
- display: grid;
- place-items: center;
- color: #111;
+.tg {
+ display: flex;
+ gap: 10px;
+ align-items: flex-start;
font-size: 13px;
- letter-spacing: 2px;
+ cursor: pointer;
}
-.hlb-cmp input[type=range] {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- cursor: ew-resize;
- margin: 0;
+.tg input {
+ margin-top: 3px;
+ accent-color: var(--ac);
+ width: 16px;
+ height: 16px;
}
-.hlb-cmp em {
- position: absolute;
- top: 10px;
- font-size: 11px;
- font-style: normal;
+.tg b {
font-weight: 600;
- color: #fff;
- background: rgba(0, 0, 0, .5);
- padding: 3px 9px;
- border-radius: 99px;
- pointer-events: none;
+ display: block;
}
-.hlb-cmp em.l { left: 10px; }
-.hlb-cmp em.r { right: 10px; }
+.tg small {
+ color: var(--mu);
+ font-size: 12px;
+ line-height: 1.6;
+}
-.hlb-refs {
- margin-top: 16px;
+.note {
+ font-size: 12.5px;
+ line-height: 1.75;
+ color: var(--tx2);
+ background: var(--sf);
+ padding: 12px 14px;
+ border-radius: 12px;
}
-.hlb-refs-h {
+.note b {
display: block;
- font-size: 12px;
+ color: var(--tx);
font-weight: 600;
+}
+
+#cfHelp {
+ margin: 0;
+ padding: 10px 12px;
+ background: var(--sf);
+ border-radius: 12px;
color: var(--tx2);
- margin-bottom: 8px;
}
-.hlb-refs-row {
- display: flex;
- gap: 8px;
- overflow-x: auto;
- padding-bottom: 4px;
- scrollbar-width: thin;
+#cfHelp:empty {
+ display: none;
+}
+
+#cfHelp a {
+ color: var(--ac);
+ font-weight: 600;
+ text-decoration: none;
+}
+
+#cfLocalSetup summary {
+ width: fit-content;
+ cursor: pointer;
+}
+
+#cfLocalSetup p {
+ margin: 6px 0 0;
+}
+
+#cfLocalSetup a {
+ color: var(--tx);
+ text-underline-offset: 3px;
+}
+
+#cfg.local-engine .cfg-b :is(.fld:not(#cfCheckpointW), .tg, .note),
+#cfg.local-engine .cfg-b .grp:not(:first-child),
+#cfg.local-engine #cfClr {
+ display: none;
+}
+
+.cfg-f {
+ display: flex;
+ gap: 8px;
+ padding: 14px 24px;
+ border-top: 1px solid var(--line);
+}
+
+/* Toast, back-to-top & micro particles */
+#toast {
+ position: fixed;
+ left: 50%;
+ bottom: calc(32px + env(safe-area-inset-bottom));
+ transform: translate(-50%, 14px);
+ opacity: 0;
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ background: rgba(17, 17, 17, .92);
+ color: #fff;
+ padding: 11px 22px;
+ border-radius: 99px;
+ transition: transform .35s var(--out), opacity .25s;
+ z-index: 99;
+ pointer-events: none;
+ font-size: 13.5px;
+ box-shadow: var(--sh2);
+}
+
+#toast.on {
+ opacity: 1;
+ transform: translate(-50%, 0);
+ animation: tspr .5s cubic-bezier(.34, 1.56, .64, 1);
+}
+
+@keyframes tspr {
+ from { opacity: 0; transform: translate(-50%, 14px) scale(.96); }
+}
+
+#toast.act {
+ pointer-events: auto;
+ padding-right: 8px;
+}
+
+#toast button {
+ background: rgba(255, 255, 255, .14);
+ color: #fff;
+ border-radius: 99px;
+ padding: 5px 12px;
+ font-size: 13px;
+ font-weight: 600;
+ min-height: 0;
+}
+
+#toast button:hover {
+ background: rgba(255, 255, 255, .24);
+}
+
+body.tray:not(.studio) #toast {
+ bottom: auto;
+ top: calc(var(--hdr, 72px) + 14px);
+}
+
+body:has(#trayFab:not([hidden])) #toast {
+ bottom: calc(var(--dock-edge) + 60px);
+}
+
+body:has(#tray:not([hidden])) #toast {
+ bottom: auto;
+ top: calc(var(--hdr, 72px) + 8px);
+}
+
+#cfg:not([hidden]) ~ #toast,
+body:has(#cfg:not([hidden])) #toast {
+ bottom: calc(84px + env(safe-area-inset-bottom));
+}
+
+#toTop {
+ position: fixed;
+ left: 24px;
+ bottom: 24px;
+ z-index: 25;
+ background: var(--bg2);
+ box-shadow: var(--sh2);
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity .3s;
+}
+
+#toTop.on {
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.pt {
+ position: fixed;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ pointer-events: none;
+ z-index: 200;
+}
+
+.flyimg {
+ position: fixed;
+ z-index: 200;
+ object-fit: cover;
+ pointer-events: none;
+ box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
+ will-change: transform;
+}
+
+/* ==========================================================================
+ 9. Generation History Page
+ ========================================================================== */
+
+#histSec {
+ max-width: var(--w);
+ margin: 0 auto;
+ padding: 6px 24px 60px;
+ min-height: calc(100vh - 180px);
+}
+
+.hist-bar {
+ position: sticky;
+ top: calc(var(--hdr, 72px) - 1px);
+ z-index: 20;
+ padding: 6px 0 10px;
+ background: var(--bg);
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.hist-bar .tbar {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ flex: 1;
+ min-width: 0;
+}
+
+#histCount {
+ font-size: 13px;
+ color: var(--mu);
+ margin-right: 4px;
+ white-space: nowrap;
+}
+
+#histCount b {
+ color: var(--tx);
+ font-weight: 600;
+}
+
+.hist-sel-all {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 13px;
+ color: var(--tx2);
+ cursor: pointer;
+ white-space: nowrap;
+ user-select: none;
+}
+
+.hist-sel-all input {
+ width: 16px;
+ height: 16px;
+ accent-color: var(--ac);
+ cursor: pointer;
+}
+
+#histSelN {
+ font-size: 13px;
+ color: var(--ac);
+ font-weight: 600;
+ white-space: nowrap;
+}
+
+#histSelN b {
+ font-variant-numeric: tabular-nums;
+}
+
+#histQ {
+ width: 200px;
+ max-width: 100%;
+ font: inherit;
+ font-size: 13px;
+ background: var(--sf);
+ color: var(--tx);
+ border: 1.5px solid transparent;
+ border-radius: 99px;
+ padding: 6px 13px;
+ outline: 0;
+ transition: border-color .18s, background .18s;
+}
+
+#histQ:hover {
+ background: var(--sf2);
+}
+
+#histQ:focus {
+ background: var(--bg2);
+ border-color: var(--tx2);
+}
+
+#histQ::placeholder {
+ color: var(--mu);
+}
+
+.hist-stats {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 6px 14px;
+ font-size: 12.5px;
+ color: var(--tx2);
+ padding: 0 0 10px;
+ line-height: 1.6;
+ font-variant-numeric: tabular-nums;
+}
+
+.hist-ratio {
+ display: flex;
+ overflow: hidden;
+ flex: none;
+ width: 84px;
+ height: 5px;
+ border-radius: 3px;
+ background: var(--mu);
+}
+
+.hist-ratio i,
+.hist-key i {
+ background: var(--ac);
+}
+
+.hist-key.gen i {
+ background: var(--mu);
+}
+
+.hist-key {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+}
+
+.hist-key i {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+}
+
+.hist-key b {
+ color: var(--tx);
+}
+
+.hist-providers {
+ font-size: 12px;
+}
+
+.hist-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
+ gap: 28px 16px;
+ max-width: var(--w);
+ margin: 0;
+ padding: 0 0 40px;
+}
+
+.hist-nomatch {
+ grid-column: 1 / -1;
+ text-align: center;
+ padding: 54px 16px;
+ color: var(--tx2);
+}
+
+.hist-nomatch p {
+ margin: 0 0 12px;
+ font-size: 14px;
+}
+
+.hist-card {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ animation: rise .5s var(--out) both;
+}
+
+.hist-card .hph {
+ position: relative;
+ aspect-ratio: 3 / 4;
+ overflow: hidden;
+ background: var(--ph);
+ cursor: pointer;
+ border-radius: 16px;
+ transition: transform .35s var(--out), box-shadow .35s;
+}
+
+.hist-card:hover .hph {
+ transform: translateY(-2px);
+ box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
+}
+
+.hist-card .hph img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border-radius: inherit;
+}
+
+.hist-card .hopen {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+ background: transparent;
+ border-radius: inherit;
+ padding: 0;
+}
+
+.hist-card .hopen:focus-visible {
+ outline-offset: -3px;
+}
+
+.hist-card .hsel {
+ position: absolute;
+ left: 10px;
+ top: 10px;
+ z-index: 2;
+ width: 22px;
+ height: 22px;
+ border-radius: 50%;
+ border: 2px solid #fff;
+ background: rgba(0, 0, 0, .18);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
+ cursor: pointer;
+ transition: transform .25s var(--out), background .2s;
+ appearance: none;
+ -webkit-appearance: none;
+}
+
+.hist-card .hsel:checked {
+ background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
+ border-color: var(--ac);
+ transform: scale(1.1);
+}
+
+.hist-card.selected .hph {
+ box-shadow: 0 0 0 3px var(--ac);
+}
+
+.hist-card .hcbtns {
+ position: absolute;
+ right: 10px;
+ top: 10px;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ opacity: 0;
+ transform: scale(.9);
+ transition: .25s var(--out);
+ z-index: 2;
+}
+
+.hist-card:hover .hcbtns,
+.hcbtns:focus-within {
+ opacity: 1;
+ transform: none;
+}
+
+.hist-card .hcbtns button {
+ width: 36px;
+ height: 36px;
+ padding: 0;
+ background: #fff;
+ color: #111;
+ font-size: 16px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
+ border-radius: 50%;
+}
+
+.hist-card .hcbtns button:hover {
+ background: #fff;
+ transform: scale(1.08);
+}
+
+.hist-card .hmode {
+ position: absolute;
+ left: 10px;
+ bottom: 10px;
+ font-size: 11.5px;
+ font-weight: 600;
+ color: #fff;
+ background: rgba(0, 0, 0, .55);
+ padding: 2px 8px;
+ border-radius: 99px;
+ z-index: 1;
+ pointer-events: none;
+}
+
+.hist-card .hinfo {
+ padding: 10px 4px 0;
+ min-width: 0;
+}
+
+.hist-card .hinfo h3 {
+ font-size: 14.5px;
+ font-weight: 600;
+ line-height: 1.4;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.hist-card .hinfo .sub {
+ font-size: 12.5px;
+ color: var(--mu);
+ margin-top: 2px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+#histEmpty {
+ text-align: center;
+ padding: 60px 20px 100px;
+ max-width: 560px;
+ margin: 0 auto;
+}
+
+#histEmpty h3 {
+ font-size: 20px;
+}
+
+#histEmpty p {
+ color: var(--tx2);
+}
+
+.hlb-cmp {
+ margin-top: 16px;
+ border-radius: 14px;
+ overflow: hidden;
+ position: relative;
+ --x: 50%;
+}
+
+.hlb-cmp img {
+ display: block;
+ width: 100%;
+ aspect-ratio: 3 / 4;
+ object-fit: cover;
+}
+
+.hlb-cmp .hlb-bef {
+ position: absolute;
+ inset: 0;
+ clip-path: inset(0 calc(100% - var(--x)) 0 0);
+}
+
+.hlb-cmp .hlb-hdl {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: var(--x);
+ width: 2px;
+ background: #fff;
+ pointer-events: none;
+}
+
+.hlb-cmp .hlb-hdl span {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 32px;
+ height: 32px;
+ transform: translate(-50%, -50%);
+ border-radius: 50%;
+ background: #fff;
+ box-shadow: var(--sh2);
+}
+
+.hlb-cmp .hlb-hdl span::before {
+ content: "‹ ›";
+ position: absolute;
+ inset: 0;
+ display: grid;
+ place-items: center;
+ color: #111;
+ font-size: 13px;
+ letter-spacing: 2px;
+}
+
+.hlb-cmp input[type=range] {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ cursor: ew-resize;
+ margin: 0;
+}
+
+.hlb-cmp em {
+ position: absolute;
+ top: 10px;
+ font-size: 11px;
+ font-style: normal;
+ font-weight: 600;
+ color: #fff;
+ background: rgba(0, 0, 0, .5);
+ padding: 3px 9px;
+ border-radius: 99px;
+ pointer-events: none;
+}
+
+.hlb-cmp em.l { left: 10px; }
+.hlb-cmp em.r { right: 10px; }
+
+.hlb-refs {
+ margin-top: 16px;
+}
+
+.hlb-refs-h {
+ display: block;
+ font-size: 12px;
+ font-weight: 600;
+ color: var(--tx2);
+ margin-bottom: 8px;
+}
+
+.hlb-refs-row {
+ display: flex;
+ gap: 8px;
+ overflow-x: auto;
+ padding-bottom: 4px;
+ scrollbar-width: thin;
+}
+
+.hlb-ref {
+ flex: none;
+ width: 54px;
+ height: 70px;
+ border-radius: 10px;
+ overflow: hidden;
+ background: var(--sf);
+ border: 1px solid var(--line2);
+ display: block;
+ transition: transform .18s var(--out), border-color .18s;
+}
+
+a.hlb-ref:hover {
+ transform: translateY(-2px);
+ border-color: var(--ac);
+}
+
+.hlb-ref img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ display: block;
+}
+
+.hlb-del {
+ color: var(--bad);
+}
+
+.hlb-del:hover {
+ background: var(--acs);
+ color: var(--bad);
+}
+
+/* ==========================================================================
+ 10. Gesture Sketch Studio
+ ========================================================================== */
+
+#sketch {
+ position: fixed;
+ inset: 0;
+ z-index: 75;
+ display: flex;
+ flex-direction: column;
+ background: var(--bg);
+ color: var(--tx);
+ animation: fade .2s both;
+}
+
+.sk-prog {
+ position: relative;
+ height: 3px;
+ width: 100%;
+ background: var(--line);
+ flex: none;
+ overflow: hidden;
+}
+
+.sk-prog i {
+ display: block;
+ height: 100%;
+ width: 100%;
+ background: var(--ac);
+ transform-origin: left center;
+ transition: transform .2s linear;
+}
+
+.sk-top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ padding: 10px 20px;
+ border-bottom: 1px solid var(--line);
+ flex: none;
+ flex-wrap: wrap;
+}
+
+.sk-meta {
+ display: flex;
+ align-items: baseline;
+ gap: 10px;
+ min-width: 0;
+ flex: 1 1 160px;
+}
+
+.sk-meta b {
+ font-size: 14px;
+ font-variant-numeric: tabular-nums;
+ color: var(--tx);
+ flex: none;
+}
+
+.sk-meta span {
+ font-size: 13px;
+ color: var(--tx2);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.sk-timer-box {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+ justify-content: center;
+}
+
+#skTime {
+ font: 700 22px/1 ui-monospace, Menlo, monospace;
+ font-variant-numeric: tabular-nums;
+ color: var(--tx);
+ min-width: 74px;
+ text-align: center;
+ letter-spacing: .03em;
+}
+
+.sk-right {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ flex: none;
+}
+
+#skSound {
+ color: var(--tx2);
+}
+
+#skSound .sk-snd-on {
+ display: none;
+}
+
+#skSound.on {
+ background: var(--acs);
+ color: var(--ac);
+}
+
+#skSound.on .sk-snd-on {
+ display: block;
+}
+
+#skSound.on .sk-snd-off {
+ display: none;
+}
+
+.sk-stage {
+ flex: 1;
+ min-height: 0;
+ display: grid;
+ place-items: center;
+ padding: 18px 24px;
+ overflow: auto;
+ background: var(--sf);
+ position: relative;
+}
+
+.sk-stage[data-img-type=pose],
+.sk-stage[data-img-type=pose] .sk-frame {
+ background: var(--phw);
+}
+
+.sk-stage[data-img-type=depth],
+.sk-stage[data-img-type=depth] .sk-frame {
+ background: #141414;
+}
+
+.sk-frame {
+ position: relative;
+ display: inline-grid;
+ place-items: center;
+ max-width: 100%;
+ max-height: 100%;
+ border-radius: 12px;
+ overflow: hidden;
+}
+
+.sk-frame img {
+ display: block;
+ max-width: min(92vw, 1120px);
+ max-height: calc(100dvh - 176px);
+ width: auto;
+ height: auto;
+ object-fit: contain;
+ transition: transform .22s var(--out), filter .22s;
+}
+
+.sk-stage[data-img-type=pose] .sk-frame img {
+ mix-blend-mode: multiply;
+}
+
+.sk-frame.flipped img {
+ transform: scaleX(-1);
+}
+
+.sk-done {
+ text-align: center;
+ max-width: 680px;
+ width: 100%;
+ padding: 28px 24px;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ border-radius: 22px;
+ box-shadow: var(--sh2);
+}
+
+.sk-done h3 {
+ font-size: 22px;
+ margin-bottom: 6px;
+}
+
+.sk-done p {
+ margin: 0 0 18px;
+ color: var(--tx2);
+ font-size: 14px;
+}
+
+.sk-recap {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 10px;
+ max-height: 44vh;
+ overflow: auto;
+ margin-bottom: 20px;
+ padding: 2px;
+}
+
+.sk-recap button {
+ width: 92px;
+ flex: none;
+ padding: 0;
+ border-radius: 10px;
+ overflow: hidden;
+ aspect-ratio: 3 / 4;
+ background: var(--ph);
+ border: 1px solid var(--line2);
+}
+
+.sk-recap button:hover {
+ border-color: var(--ac);
+ transform: translateY(-2px);
+}
+
+.sk-recap img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ display: block;
+}
+
+.sk-done-act {
+ display: flex;
+ justify-content: center;
+ gap: 10px;
+ flex-wrap: wrap;
+}
+
+#sketch:has(#skDone:not([hidden])) .sk-foot {
+ display: none;
+}
+
+.sk-foot {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
+ border-top: 1px solid var(--line);
+ background: var(--bg);
+ flex: none;
+ flex-wrap: wrap;
+}
+
+.sk-ctrl {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.sk-ctrl button {
+ min-height: 38px;
+}
+
+#skPrev, #skNext {
+ width: 38px;
+ padding: 0;
+ font-size: 20px;
+}
+
+#skPause {
+ min-width: 92px;
+}
+
+.sk-tools {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ flex-wrap: wrap;
+}
+
+.sk-tools button {
+ padding: 7px 13px;
+ font-size: 13px;
+ background: var(--sf);
+ color: var(--tx2);
+}
+
+.sk-tools button:hover {
+ background: var(--sf2);
+ color: var(--tx);
+}
+
+.sk-tools button.on {
+ background: var(--tx);
+ color: var(--bg);
+}
+
+.sk-tools button[data-skt=fav].on {
+ background: var(--acs);
+ color: var(--ac);
+}
+
+/* ==========================================================================
+ 11. Global Command Palette
+ ========================================================================== */
+
+#cmdPal {
+ position: fixed;
+ inset: 0;
+ z-index: 85;
+ display: grid;
+ place-items: start center;
+ padding: min(13vh, 104px) 16px 20px;
+ background: rgba(0, 0, 0, .46);
+ backdrop-filter: blur(4px);
+ -webkit-backdrop-filter: blur(4px);
+ animation: fade .16s both;
+}
+
+.cmd-box {
+ width: min(540px, 100%);
+ max-height: min(70vh, 560px);
+ display: flex;
+ flex-direction: column;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ border-radius: 18px;
+ box-shadow: var(--sh3);
+ overflow: hidden;
+}
+
+.cmd-in {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 12px 14px;
+ border-bottom: 1px solid var(--line);
+}
+
+.cmd-in svg {
+ width: 18px;
+ height: 18px;
+ flex: none;
+ fill: none;
+ stroke: var(--mu);
+ stroke-width: 2;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+#cmdQ {
+ flex: 1;
+ min-width: 0;
+ border: 0;
+ outline: 0;
+ background: transparent;
+ color: var(--tx);
+ font: 15px/1.4 var(--sans);
+}
+
+#cmdQ::placeholder {
+ color: var(--mu);
+}
+
+#cmdQ::-webkit-search-cancel-button {
+ display: none;
+}
+
+.cmd-list {
+ flex: 1;
+ min-height: 0;
+ overflow: auto;
+ padding: 6px;
+ scrollbar-width: thin;
+}
+
+.cmd-g {
+ padding: 8px 10px 4px;
+ font-size: 11.5px;
+ font-weight: 650;
+ color: var(--mu);
+ letter-spacing: .03em;
+}
+
+.cmd-it {
+ position: relative;
+ width: 100%;
+ justify-content: flex-start;
+ gap: 10px;
+ padding: 9px 12px;
+ border-radius: 10px;
+ background: transparent;
+ color: var(--tx);
+ font-size: 13.5px;
+ font-weight: 500;
+ text-align: left;
+}
+
+.cmd-it:hover {
+ background: var(--sf);
+}
+
+.cmd-it.on {
+ background: var(--sf2);
+ color: var(--tx);
+}
+
+.cmd-it.on::before {
+ content: "";
+ position: absolute;
+ left: 0;
+ top: 7px;
+ bottom: 7px;
+ width: 3px;
+ border-radius: 3px;
+ background: var(--ac);
+}
+
+.cmd-it span {
+ flex: 1;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.cmd-it small {
+ font-size: 11.5px;
+ color: var(--mu);
+ font-variant-numeric: tabular-nums;
+ background: var(--sf);
+ padding: 2px 7px;
+ border-radius: 6px;
+ flex: none;
+}
+
+.cmd-it.on small {
+ background: var(--bg2);
+ color: var(--tx2);
+}
+
+.cmd-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ flex: none;
+ background: var(--cat-color, var(--mu));
+}
+
+.cmd-empty {
+ padding: 28px 16px;
+ text-align: center;
+ color: var(--mu);
+ font-size: 13.5px;
}
-.hlb-ref {
- flex: none;
- width: 54px;
- height: 70px;
- border-radius: 10px;
- overflow: hidden;
+.cmd-foot {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ padding: 8px 14px;
+ border-top: 1px solid var(--line);
background: var(--sf);
- border: 1px solid var(--line2);
- display: block;
- transition: transform .18s var(--out), border-color .18s;
+ font-size: 11.5px;
+ color: var(--mu);
}
-a.hlb-ref:hover {
- transform: translateY(-2px);
- border-color: var(--ac);
+.cmd-foot kbd {
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ padding: 2px 5px;
}
-.hlb-ref img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
+.cf-presets-w {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
}
-.hlb-del {
- color: var(--bad);
+.cf-presets-w .chips {
+ gap: 6px;
}
-.hlb-del:hover {
- background: var(--acs);
- color: var(--bad);
+.cf-presets-w .chip {
+ padding: 5px 10px;
+ font-size: 12px;
}
-/* ==========================================================================
- 10. Gesture Sketch Studio
- ========================================================================== */
-
-#sketch {
+/* Side-by-Side Reference Compare Studio */
+#cmpModal {
position: fixed;
inset: 0;
- z-index: 75;
- display: flex;
- flex-direction: column;
- background: var(--bg);
- color: var(--tx);
- animation: fade .2s both;
+ z-index: 84;
+ display: grid;
+ place-items: center;
+ padding: 18px;
+ background: rgba(12, 12, 14, .76);
+ backdrop-filter: blur(8px);
+ -webkit-backdrop-filter: blur(8px);
+ animation: fade .18s both;
}
-.sk-prog {
- position: relative;
- height: 3px;
- width: 100%;
- background: var(--line);
- flex: none;
+.cmp-box {
+ width: min(1440px, 100%);
+ height: min(92dvh, 880px);
+ display: flex;
+ flex-direction: column;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ border-radius: 20px;
+ box-shadow: var(--sh3);
overflow: hidden;
}
-.sk-prog i {
- display: block;
- height: 100%;
- width: 100%;
- background: var(--ac);
- transform-origin: left center;
- transition: transform .2s linear;
-}
-
-.sk-top {
+.cmp-head {
display: flex;
align-items: center;
- justify-content: space-between;
- gap: 12px;
- padding: 10px 20px;
+ gap: 10px;
+ padding: 12px 16px;
border-bottom: 1px solid var(--line);
- flex: none;
+ background: var(--bg2);
flex-wrap: wrap;
}
-.sk-meta {
+.cmp-title {
display: flex;
align-items: baseline;
- gap: 10px;
- min-width: 0;
- flex: 1 1 160px;
+ gap: 8px;
+ margin-right: auto;
}
-.sk-meta b {
- font-size: 14px;
- font-variant-numeric: tabular-nums;
- color: var(--tx);
- flex: none;
+.cmp-title b {
+ font-size: 15px;
+ font-weight: 700;
}
-.sk-meta span {
- font-size: 13px;
- color: var(--tx2);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.cmp-title span {
+ font-size: 12px;
+ color: var(--mu);
+ font-variant-numeric: tabular-nums;
}
-.sk-timer-box {
+.cmp-tools {
display: flex;
align-items: center;
- gap: 10px;
+ gap: 6px;
flex-wrap: wrap;
- justify-content: center;
}
-#skTime {
- font: 700 22px/1 ui-monospace, Menlo, monospace;
- font-variant-numeric: tabular-nums;
- color: var(--tx);
- min-width: 74px;
- text-align: center;
- letter-spacing: .03em;
+.cmp-tools button {
+ padding: 6px 11px;
+ border-radius: 99px;
+ font-size: 12.5px;
+ font-weight: 500;
+ background: var(--sf);
+ color: var(--tx2);
+ border: 1px solid transparent;
+ transition: background .15s, color .15s, border-color .15s;
}
-.sk-right {
- display: flex;
- align-items: center;
- gap: 4px;
- flex: none;
+.cmp-tools button:hover {
+ background: var(--sf2);
+ color: var(--tx);
}
-#skSound {
- color: var(--tx2);
+.cmp-tools button.on {
+ background: var(--tx);
+ color: var(--bg);
}
-#skSound .sk-snd-on {
- display: none;
+.cmp-grid {
+ flex: 1;
+ min-height: 0;
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 12px;
+ padding: 14px;
+ overflow: auto;
+ background: var(--sf);
}
-#skSound.on {
- background: var(--acs);
- color: var(--ac);
+.cmp-grid[data-n="3"] {
+ grid-template-columns: repeat(3, minmax(0, 1fr));
}
-#skSound.on .sk-snd-on {
- display: block;
+.cmp-grid[data-n="4"] {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
}
-#skSound.on .sk-snd-off {
- display: none;
+.cmp-card {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ background: var(--bg2);
+ border: 1px solid var(--line2);
+ border-radius: 14px;
+ overflow: hidden;
+ border-top: 2px solid var(--cat-color, var(--line2));
}
-.sk-stage {
+.cmp-ph {
+ position: relative;
flex: 1;
- min-height: 0;
+ min-height: 220px;
display: grid;
place-items: center;
- padding: 18px 24px;
- overflow: auto;
- background: var(--sf);
- position: relative;
+ background: var(--ph);
+ overflow: hidden;
}
-.sk-stage[data-img-type=pose],
-.sk-stage[data-img-type=pose] .sk-frame {
+.cmp-ph[data-img-type=pose] {
background: var(--phw);
}
-.sk-stage[data-img-type=depth],
-.sk-stage[data-img-type=depth] .sk-frame {
+.cmp-ph[data-img-type=depth] {
background: #141414;
}
-.sk-frame {
+.cmp-stage {
position: relative;
display: inline-grid;
place-items: center;
max-width: 100%;
max-height: 100%;
- border-radius: 12px;
- overflow: hidden;
+ padding: 8px;
}
-.sk-frame img {
+.cmp-stage img {
display: block;
- max-width: min(92vw, 1120px);
- max-height: calc(100dvh - 176px);
+ max-width: 100%;
+ max-height: min(60dvh, 520px);
width: auto;
height: auto;
object-fit: contain;
- transition: transform .22s var(--out), filter .22s;
+ border-radius: 6px;
+ transition: filter .25s, transform .2s var(--out);
}
-.sk-stage[data-img-type=pose] .sk-frame img {
+:root .cmp-ph[data-img-type=pose] .cmp-stage img {
mix-blend-mode: multiply;
}
-.sk-frame.flipped img {
+.cmp-stage.flipped img {
transform: scaleX(-1);
}
-.sk-done {
+.cmp-idx {
+ position: absolute;
+ top: 8px;
+ left: 8px;
+ min-width: 22px;
+ height: 22px;
+ padding: 0 6px;
+ border-radius: 99px;
+ background: rgba(17, 17, 17, .74);
+ color: #fff;
+ font-size: 11px;
+ font-weight: 700;
+ line-height: 22px;
text-align: center;
- max-width: 680px;
- width: 100%;
- padding: 28px 24px;
- background: var(--bg2);
- border: 1px solid var(--line2);
- border-radius: 22px;
- box-shadow: var(--sh2);
-}
-
-.sk-done h3 {
- font-size: 22px;
- margin-bottom: 6px;
-}
-
-.sk-done p {
- margin: 0 0 18px;
- color: var(--tx2);
- font-size: 14px;
-}
-
-.sk-recap {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- gap: 10px;
- max-height: 44vh;
- overflow: auto;
- margin-bottom: 20px;
- padding: 2px;
+ font-variant-numeric: tabular-nums;
}
-.sk-recap button {
- width: 92px;
- flex: none;
+.cmp-rm {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+ width: 28px;
+ height: 28px;
padding: 0;
- border-radius: 10px;
- overflow: hidden;
- aspect-ratio: 3 / 4;
- background: var(--ph);
- border: 1px solid var(--line2);
-}
-
-.sk-recap button:hover {
- border-color: var(--ac);
- transform: translateY(-2px);
+ border-radius: 50%;
+ background: rgba(17, 17, 17, .62);
+ color: #fff;
+ font-size: 16px;
+ line-height: 1;
+ justify-content: center;
}
-.sk-recap img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
+.cmp-rm:hover {
+ background: var(--ac);
}
-.sk-done-act {
+.cmp-angs {
+ position: absolute;
+ left: 8px;
+ right: 8px;
+ bottom: 8px;
display: flex;
- justify-content: center;
- gap: 10px;
+ gap: 4px;
flex-wrap: wrap;
+ justify-content: center;
}
-#sketch:has(#skDone:not([hidden])) .sk-foot {
- display: none;
+.cmp-angs button {
+ padding: 3px 8px;
+ border-radius: 99px;
+ font-size: 11px;
+ background: rgba(17, 17, 17, .64);
+ color: #fff;
+ backdrop-filter: blur(4px);
}
-.sk-foot {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
- border-top: 1px solid var(--line);
- background: var(--bg);
- flex: none;
- flex-wrap: wrap;
+.cmp-angs button.on {
+ background: var(--ac);
+ color: #fff;
}
-.sk-ctrl {
+.cmp-info {
+ padding: 10px 12px 12px;
+ border-top: 1px solid var(--line);
display: flex;
- align-items: center;
- gap: 8px;
-}
-
-.sk-ctrl button {
- min-height: 38px;
+ flex-direction: column;
+ gap: 4px;
}
-#skPrev, #skNext {
- width: 38px;
- padding: 0;
- font-size: 20px;
+.cmp-info h4 {
+ margin: 0;
+ font-size: 13.5px;
+ font-weight: 650;
+ color: var(--tx);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-#skPause {
- min-width: 92px;
+.cmp-info small {
+ font-size: 11.5px;
+ color: var(--mu);
}
-.sk-tools {
+.cmp-act {
display: flex;
align-items: center;
gap: 6px;
+ margin-top: 6px;
flex-wrap: wrap;
}
-.sk-tools button {
- padding: 7px 13px;
- font-size: 13px;
- background: var(--sf);
- color: var(--tx2);
-}
-
-.sk-tools button:hover {
- background: var(--sf2);
- color: var(--tx);
-}
-
-.sk-tools button.on {
- background: var(--tx);
- color: var(--bg);
+.cmp-act .sm {
+ padding: 4px 9px;
+ font-size: 12px;
+ min-height: 28px;
}
-.sk-tools button[data-skt=fav].on {
- background: var(--acs);
- color: var(--ac);
+.cmp-act button.on {
+ background: var(--ac);
+ color: #fff;
}
-/* ==========================================================================
- 11. Global Command Palette
- ========================================================================== */
-
-#cmdPal {
+/* Saved Character & Scene Recipes Dialog */
+#recipeBox {
position: fixed;
inset: 0;
- z-index: 85;
+ z-index: 84;
display: grid;
- place-items: start center;
- padding: min(13vh, 104px) 16px 20px;
- background: rgba(0, 0, 0, .46);
+ place-items: center;
+ padding: 18px;
+ background: rgba(0, 0, 0, .48);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
animation: fade .16s both;
}
-.cmd-box {
+.rcp-box {
width: min(540px, 100%);
- max-height: min(70vh, 560px);
+ max-height: min(84dvh, 680px);
display: flex;
flex-direction: column;
background: var(--bg2);
border: 1px solid var(--line2);
- border-radius: 18px;
+ border-radius: 20px;
box-shadow: var(--sh3);
overflow: hidden;
}
-.cmd-in {
+.rcp-box .mu {
+ font-size: 12px;
+ color: var(--mu);
+ font-variant-numeric: tabular-nums;
+}
+
+.rcp-save {
display: flex;
align-items: center;
- gap: 10px;
- padding: 12px 14px;
+ gap: 8px;
+ padding: 10px 20px 12px;
border-bottom: 1px solid var(--line);
}
-.cmd-in svg {
- width: 18px;
- height: 18px;
- flex: none;
- fill: none;
- stroke: var(--mu);
- stroke-width: 2;
- stroke-linecap: round;
- stroke-linejoin: round;
-}
-
-#cmdQ {
+.rcp-save input {
flex: 1;
min-width: 0;
- border: 0;
- outline: 0;
- background: transparent;
+ padding: 8px 12px;
+ border-radius: 10px;
+ border: 1px solid var(--line2);
+ background: var(--sf);
color: var(--tx);
- font: 15px/1.4 var(--sans);
+ font: 13.5px var(--sans);
}
-#cmdQ::placeholder {
- color: var(--mu);
+.rcp-save input:focus {
+ outline: none;
+ border-color: var(--tx2);
+ background: var(--bg2);
}
-#cmdQ::-webkit-search-cancel-button {
- display: none;
+.rcp-note {
+ margin: 0;
+ padding: 8px 20px 0;
+ font-size: 12px;
+ color: var(--mu);
}
-.cmd-list {
+.rcp-body {
flex: 1;
min-height: 0;
overflow: auto;
- padding: 6px;
- scrollbar-width: thin;
+ padding: 12px 20px 16px;
}
-.cmd-g {
- padding: 8px 10px 4px;
- font-size: 11.5px;
- font-weight: 650;
- color: var(--mu);
- letter-spacing: .03em;
+.rcp-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
}
-.cmd-it {
- position: relative;
- width: 100%;
- justify-content: flex-start;
- gap: 10px;
- padding: 9px 12px;
- border-radius: 10px;
- background: transparent;
- color: var(--tx);
- font-size: 13.5px;
- font-weight: 500;
- text-align: left;
+.rcp-item {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 9px 10px;
+ border: 1px solid var(--line2);
+ border-radius: 13px;
+ background: var(--bg);
}
-.cmd-it:hover {
+.rcp-thumbs {
+ width: 56px;
+ height: 56px;
+ flex: none;
+ border-radius: 9px;
+ overflow: hidden;
background: var(--sf);
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ grid-auto-rows: 1fr;
+ gap: 1px;
}
-.cmd-it.on {
- background: var(--sf2);
- color: var(--tx);
+.rcp-thumbs img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ display: block;
}
-.cmd-it.on::before {
- content: "";
- position: absolute;
- left: 0;
- top: 7px;
- bottom: 7px;
- width: 3px;
- border-radius: 3px;
- background: var(--ac);
+.rcp-thumbs img:only-child {
+ grid-column: 1 / -1;
+ grid-row: 1 / -1;
}
-.cmd-it span {
+.rcp-ph {
+ grid-column: 1 / -1;
+ grid-row: 1 / -1;
+ display: grid;
+ place-items: center;
+ font-size: 13px;
+ font-weight: 700;
+ color: var(--mu);
+}
+
+.rcp-meta {
flex: 1;
min-width: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+}
+
+.rcp-meta b {
+ font-size: 13.5px;
+ font-weight: 650;
+ color: var(--tx);
+ white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
-.cmd-it small {
+.rcp-meta small {
font-size: 11.5px;
color: var(--mu);
font-variant-numeric: tabular-nums;
- background: var(--sf);
- padding: 2px 7px;
- border-radius: 6px;
- flex: none;
}
-.cmd-it.on small {
- background: var(--bg2);
- color: var(--tx2);
+.rcp-act {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ flex-wrap: wrap;
+ justify-content: flex-end;
}
-.cmd-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- flex: none;
- background: var(--cat-color, var(--mu));
+.rcp-del {
+ width: 28px;
+ padding: 0;
+ justify-content: center;
+ color: var(--mu);
}
-.cmd-empty {
- padding: 28px 16px;
+.rcp-del:hover {
+ color: var(--bad);
+ background: var(--acs);
+}
+
+.rcp-empty {
text-align: center;
+ padding: 28px 16px;
color: var(--mu);
- font-size: 13.5px;
}
-.cmd-foot {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: 8px 14px;
- border-top: 1px solid var(--line);
- background: var(--sf);
- font-size: 11.5px;
- color: var(--mu);
+.rcp-empty p {
+ margin: 0 0 6px;
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--tx2);
}
-.cmd-foot kbd {
- background: var(--bg2);
- border: 1px solid var(--line2);
- padding: 2px 5px;
+.rcp-empty small {
+ font-size: 12.5px;
+ line-height: 1.5;
}
/* ==========================================================================
@@ -6912,6 +8136,7 @@ a.hlb-ref:hover {
.top .search { max-width: none; }
.top .tools { gap: 2px; }
.tabs .nav-trigger { min-height: 40px; padding: 6px 11px; }
+ .cmp-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
@@ -6970,11 +8195,14 @@ a.hlb-ref:hover {
/* Studio mobile */
#studio { height: auto; padding: 0 12px calc(128px + env(safe-area-inset-bottom)); }
- .studio-head { padding: 12px 0; gap: 8px; }
- .studio-head-act { gap: 6px; }
- .studio-head .modes { max-width: 62%; }
+ .studio-head { padding: 12px 0; gap: 8px; flex-wrap: wrap; }
+ .studio-head-act { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
+ .studio-head .modes { max-width: 100%; }
.studio-head .modes button { padding: 7px 10px; font-size: 12px; }
- #wbClearAll { padding: 5px 8px; font-size: 12px; }
+ #wbClearAll, #wbRecipesBtn { padding: 5px 8px; font-size: 12px; }
+ .cmp-box { height: 94dvh; border-radius: 16px; }
+ .cmp-grid, .cmp-grid[data-n="3"], .cmp-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; }
+ .cmp-ph { min-height: 160px; }
.st-app { display: flex; flex-direction: column; gap: 12px; height: auto; }
.st-l, .st-r { display: flex; flex-direction: column; overflow: visible; min-width: 0; }
.st-l { order: -2; }
@@ -6989,17 +8217,15 @@ a.hlb-ref:hover {
.st-l .pick .rmx { width: 36px; height: 36px; }
.st-l .pick select { min-height: 36px; }
.prompt-panel #wbPrompt, .primary-materials #wbCharTxt { font-size: 16px; }
- .st-c #wbStage, .st-c:has(#wbPh0:not([hidden])) #wbStage { min-height: 0; }
+ .st-c #wbStage, .st-c:has(#wbPh0[data-layout=spatial]:not([hidden])) #wbStage { min-height: min(460px, 56dvh); }
+ .st-c:has(#wbPh0[data-layout=compact]:not([hidden])) #wbStage { min-height: 0; }
.st-c:has(#wbCmp:not([hidden])) #wbStage,
.st-c:has(#wbBusy:not([hidden])) #wbStage,
.st-c:has(#wbErr:not([hidden])) #wbStage { min-height: min(450px, 60dvh); }
- .reference-board { padding: 16px 12px; gap: 13px; }
- .board-cards { max-width: 370px; }
- .board-cards:not(.many) .board-card { width: 26%; padding: 3px; border-radius: 9px; }
- .board-card img { border-radius: 6px; }
- .board-card span { font-size: 11px; padding: 3px; }
- .board-idx { top: 5px; left: 5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; }
- .board-ang { display: none; }
+ .reference-board[data-layout=compact] .board-card img { border-radius: 6px; }
+ .reference-board[data-layout=compact] .board-card > span { font-size: 11px; padding: 3px; }
+ .reference-board[data-layout=compact] .board-idx { top: 5px; left: 5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; }
+ .reference-board[data-layout=compact] .board-ang { display: none; }
.board-use { min-height: 34px; padding: 6px 12px; }
.st-r .gobar {
position: fixed;
@@ -7230,6 +8456,10 @@ a.hlb-ref:hover {
.studio-head { flex-wrap: wrap; row-gap: 8px; }
.lb-tools button span { display: none; }
.lb-tools button { width: 34px; padding: 0; justify-content: center; }
+ #cmpModal { padding: 8px; }
+ .cmp-grid, .cmp-grid[data-n="3"], .cmp-grid[data-n="4"] { grid-template-columns: 1fr; }
+ .rcp-item { flex-wrap: wrap; }
+ .rcp-act { width: 100%; justify-content: flex-start; }
}
@media (max-width: 480px) {
@@ -7241,6 +8471,7 @@ a.hlb-ref:hover {
@media (max-width: 420px) {
.cfg-f { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
+ #recipeBox .cfg-f { display: flex; }
.cfg-f .sp { display: none; }
.cfg-f button { grid-column: span 2; }
.cfg-f #cfTest, .cfg-f #cfSave { grid-column: span 3; }
diff --git a/src/sw.js b/src/sw.js
index f07d44f..bdcb3ce 100644
--- a/src/sw.js
+++ b/src/sw.js
@@ -1,5 +1,5 @@
const VERSION = 'posewear-development';
-const PRECACHE = ['./','index.html','theme.js','style.css','i18n.js','catalog.js','references.js','palette.js','app.js','sketch.js','command-palette.js','zip.js','extras.js','image-providers.js','board-export.js','studio.js','history.js','favicon.svg'];
+const PRECACHE = ['./','index.html','theme.js','style.css','i18n.js','catalog.js','references.js','palette.js','app.js','sketch.js','command-palette.js','compare.js','zip.js','extras.js','image-providers.js','board-export.js','recipes.js','canvas.js','studio.js','history.js','favicon.svg'];
self.addEventListener('install', event => {
event.waitUntil(caches.open(VERSION).then(cache => cache.addAll(PRECACHE)).then(() => self.skipWaiting()));
});
diff --git a/tests/creative-update-regressions.js b/tests/creative-update-regressions.js
new file mode 100644
index 0000000..df67a2a
--- /dev/null
+++ b/tests/creative-update-regressions.js
@@ -0,0 +1,446 @@
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const { chromium } = require('playwright');
+
+const root = path.join(__dirname, '..', 'src');
+const mkImg = name => ({ t: name, m: name, i: name, o: name });
+const angles = [
+ { zh: '正面', en: 'front view', ...mkImg('icon-192.png') },
+ { zh: '侧面', en: 'side view', ...mkImg('icon-512.png') },
+];
+
+const data = {
+ 'poses.json': [
+ { id: '001', ti: '站姿一', zh: '站姿一', en: 'standing one', no: '1', cat: '站姿', line: '全身', lineEn: 'full body', angles },
+ { id: '002', ti: '坐姿二', zh: '坐姿二', en: 'sitting two', no: '2', cat: '坐姿', line: '全身', lineEn: 'full body', angles },
+ ],
+ 'depths.json': [
+ { id: '001', pack: 'gia-depth', ti: '站姿一', zh: '站姿一', en: 'standing one', no: '1', cat: '站姿', line: '全身', lineEn: 'full body', angles },
+ ],
+ 'costumes.json': [
+ { id: 'c1', ti: '红色连衣裙', zh: '红色连衣裙', en: 'red dress', kw: 'red dress', no: '1', cat: '连衣裙', ...mkImg('swatch-demo.svg') },
+ { id: 'c2', ti: '蓝色制服', zh: '蓝色制服', en: 'blue jacket', kw: 'blue jacket', no: '2', cat: '制服', ...mkImg('icon-512.png') },
+ ],
+ 'portraits.json': [
+ { id: 'p1', ti: '室内人像一', zh: '室内人像一', en: 'indoor portrait one', no: '1', cat: '室内', sec: '默认', st: '自然', ...mkImg('icon-192.png') },
+ ],
+};
+
+async function run() {
+ const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH });
+ try {
+ const ctx = await browser.newContext({
+ viewport: { width: 1366, height: 860 },
+ reducedMotion: 'reduce',
+ serviceWorkers: 'block',
+ locale: 'zh-CN',
+ });
+ const page = await ctx.newPage();
+ const errors = [];
+ page.on('pageerror', err => errors.push(err.message));
+
+ await page.addInitScript(() => {
+ // Capture clipboard text & PNG image blobs deterministically in headless tests.
+ window.__clipTexts = [];
+ window.__clipBlobs = [];
+ class MockClipboardItem {
+ constructor(items) { this.items = items; }
+ }
+ window.ClipboardItem = MockClipboardItem;
+ Object.defineProperty(navigator, 'clipboard', {
+ configurable: true,
+ value: {
+ writeText: async text => { window.__clipTexts.push(text); },
+ write: async items => {
+ for (const item of items) {
+ const map = item.items || {};
+ for (const [type, blob] of Object.entries(map)) {
+ const head = [...new Uint8Array(await blob.slice(0, 4).arrayBuffer())];
+ window.__clipBlobs.push({ type, size: blob.size, head });
+ }
+ }
+ },
+ },
+ });
+ });
+
+ await page.route('**/*', route => {
+ const url = new URL(route.request().url());
+ if (url.hostname !== 'posewear.test') return route.abort();
+ const file = url.pathname.slice(1) || 'index.html';
+ if (file === 'swatch-demo.svg') {
+ const svg = '<svg xmlns="http://www.w3.org/2000/svg" width="90" height="120"><rect width="90" height="40" fill="#C8233C"/><rect y="40" width="90" height="40" fill="#2B5B84"/><rect y="80" width="90" height="40" fill="#2E8B57"/></svg>';
+ return route.fulfill({ contentType: 'image/svg+xml', body: svg });
+ }
+ if (file.endsWith('.json')) return route.fulfill({ json: data[file] || [] });
+ const source = path.join(root, file);
+ if (fs.existsSync(source)) return route.fulfill({ path: source });
+ return route.fulfill({ status: 404, body: '' });
+ });
+
+ // 1. Notan 3-tone & Silhouette inspection in Lightbox and Gesture Studio
+ await page.goto('http://posewear.test/#costume');
+ await page.locator('#grid .card').first().waitFor();
+ await page.locator('#grid .card').first().locator('.phk').click();
+ await page.locator('#lbTools [data-lt=gray]').waitFor({ state: 'visible' });
+ await page.locator('#lbTools [data-lt=sil]').waitFor({ state: 'visible' });
+
+ await page.keyboard.press('b');
+ assert.deepEqual(
+ await page.evaluate(() => ({
+ gray: document.querySelector('#lbStage').classList.contains('gray'),
+ notan: document.querySelector('#lbStage').classList.contains('notan'),
+ label: document.querySelector('#lbTools [data-lt=gray] span').textContent,
+ })),
+ { gray: true, notan: false, label: '灰度' }
+ );
+ await page.keyboard.press('b');
+ assert.deepEqual(
+ await page.evaluate(() => ({
+ gray: document.querySelector('#lbStage').classList.contains('gray'),
+ notan: document.querySelector('#lbStage').classList.contains('notan'),
+ label: document.querySelector('#lbTools [data-lt=gray] span').textContent,
+ })),
+ { gray: true, notan: true, label: '明度块面' }
+ );
+ await page.keyboard.press('u');
+ assert.deepEqual(
+ await page.evaluate(() => ({
+ gray: document.querySelector('#lbStage').classList.contains('gray'),
+ notan: document.querySelector('#lbStage').classList.contains('notan'),
+ sil: document.querySelector('#lbStage').classList.contains('sil'),
+ })),
+ { gray: false, notan: false, sil: true },
+ 'Silhouette mode (U) should activate .sil and clear grayscale/notan'
+ );
+ await page.keyboard.press('Escape');
+ assert.ok(!(await page.locator('#lbStage').evaluate(el => el.classList.contains('sil'))));
+
+ // Gesture Studio Notan & Silhouette
+ await page.locator('#sketchBtn').click();
+ await page.locator('#sketch').waitFor({ state: 'visible' });
+ await page.keyboard.press('b');
+ assert.ok(await page.locator('#skFrame').evaluate(el => el.classList.contains('gray') && !el.classList.contains('notan')));
+ await page.keyboard.press('b');
+ assert.ok(await page.locator('#skFrame').evaluate(el => el.classList.contains('gray') && el.classList.contains('notan')));
+ assert.equal(await page.locator('#sketch [data-skt=gray]').textContent(), '明度块面');
+ await page.keyboard.press('u');
+ assert.ok(await page.locator('#skFrame').evaluate(el => el.classList.contains('sil') && !el.classList.contains('gray')));
+ await page.keyboard.press('Escape');
+ assert.ok(await page.locator('#sketch').isHidden());
+ console.log('PASS 3-tone Notan & Silhouette inspection in Lightbox and Gesture Studio');
+
+ // 2. Side-by-Side Reference Compare Studio from Batch Bar & Floating Tray
+ await page.locator('#libraryMenu summary').click();
+ await page.locator('.tabs [data-tab=pose]').click();
+ await page.locator('#grid .card').first().waitFor();
+ await page.locator('#batchBtn').click();
+ await page.locator('#grid .card').nth(0).click();
+ await page.locator('#grid .card').nth(1).click();
+
+ await page.locator('#bbar [data-b=cmp]').waitFor({ state: 'visible' });
+ await page.locator('#bbar [data-b=cmp]').click();
+ await page.locator('#cmpModal').waitFor({ state: 'visible' });
+ assert.equal(await page.locator('#cmpGrid .cmp-card').count(), 2);
+ assert.equal(await page.locator('#cmpGrid').getAttribute('data-n'), '2');
+ assert.equal(await page.locator('#cmpCount').textContent(), '2 / 4');
+
+ // Synced tools: flip (H), grid (G), gray/notan (B), silhouette (U), pose/depth pair (V)
+ await page.keyboard.press('h');
+ assert.equal(await page.locator('#cmpGrid .cmp-stage.flipped').count(), 2);
+ await page.keyboard.press('g');
+ assert.equal(await page.locator('#cmpGrid .lb-grid[data-mode=thirds]').count(), 2);
+ await page.keyboard.press('b');
+ assert.equal(await page.locator('#cmpGrid .cmp-stage.gray').count(), 2);
+ await page.keyboard.press('b');
+ assert.equal(await page.locator('#cmpGrid .cmp-stage.notan').count(), 2);
+ assert.equal(await page.locator('#cmpModal [data-ct=gray] span').textContent(), '明度块面');
+ await page.keyboard.press('u');
+ assert.equal(await page.locator('#cmpGrid .cmp-stage.sil').count(), 2);
+ assert.equal(await page.locator('#cmpGrid .cmp-stage.gray').count(), 0);
+ await page.locator('#cmpModal [data-ct=pair]').waitFor({ state: 'visible' });
+ await page.keyboard.press('v');
+ assert.equal(await page.locator('#cmpGrid .cmp-card[data-type=depth]').count(), 1, 'V should switch pairable pose card to depth');
+ await page.keyboard.press('v');
+ assert.equal(await page.locator('#cmpGrid .cmp-card[data-type=pose]').count(), 2);
+
+ // Inline angle switch inside compare card
+ await page.locator('#cmpGrid .cmp-card').first().locator('[data-cai="1"]').click();
+ assert.ok((await page.locator('#cmpGrid .cmp-card').first().locator('img').getAttribute('src')).includes('icon-512.png'));
+
+ // Removing one card when 2 remain closes compare modal cleanly
+ await page.locator('#cmpGrid .cmp-card').first().locator('[data-ca=rm]').click();
+ await page.locator('#cmpModal').waitFor({ state: 'hidden' });
+
+ // Exit batch mode, add 2 items to selection, and open Compare Studio from Floating Workspace Dock (#trayCmp)
+ await page.locator('#bbar [data-b=x]').click();
+ await page.locator('#grid .card').nth(0).locator('[data-a=sel]').click();
+ await page.locator('#grid .card').nth(1).locator('[data-a=sel]').click();
+ await page.locator('#trayFab').click();
+ await page.locator('#trayCmp').waitFor({ state: 'visible' });
+ await page.locator('#trayCmp').click();
+ await page.locator('#cmpModal').waitFor({ state: 'visible' });
+ await page.keyboard.press('Escape');
+ await page.locator('#cmpModal').waitFor({ state: 'hidden' });
+ await page.locator('#trayMin').click();
+ console.log('PASS Side-by-Side Reference Compare Studio (batch bar, tray, synced tools, pair & angle switch)');
+
+ // 3. Studio Creative Suite: 12 styles, camera shot, negative prompt, multi-ecosystem export, clipboard PNG, relay presets
+ await page.locator('.tabs [data-tab=studio]').click();
+ await page.waitForFunction(() => window.WB && APP.st.tab === 'studio');
+ assert.ok(await page.locator('#wbCopyBoard').isHidden(), 'Copy PNG should stay hidden on sample board');
+ assert.equal(await page.locator('#wbStyles .chip').count(), 12, 'Studio should offer 12 style presets');
+
+ await page.locator('#wbExample').click();
+ await page.waitForFunction(() => document.querySelectorAll('#wbBoardCards .board-idx').length >= 2);
+ assert.ok(await page.locator('#wbCopyBoard').isVisible());
+
+ // Copy Board PNG to clipboard
+ await page.locator('#wbCopyBoard').click();
+ await page.waitForFunction(() => window.__clipBlobs.length >= 1);
+ const copiedPng = await page.evaluate(() => window.__clipBlobs[0]);
+ assert.equal(copiedPng.type, 'image/png');
+ assert.ok(copiedPng.size > 4000);
+ assert.deepEqual(copiedPng.head, [137, 80, 78, 71]);
+
+ // Style (Turnaround sheet) + Camera Shot (85mm) + Negative prompt fill
+ await page.locator('#wbStyles [data-style=sheet]').click();
+ assert.match(await page.locator('#wbPrompt').inputValue(), /turnaround sheet/i);
+ await page.selectOption('#wbShot', 'lens85');
+ assert.match(await page.locator('#wbPrompt').inputValue(), /85mm portrait lens perspective/i);
+ await page.locator('details.adv > summary').click();
+ await page.locator('#wbNegFill').click();
+ assert.match(await page.locator('#wbNeg').inputValue(), /malformed hands/i);
+ assert.match(await page.locator('#wbPrompt').inputValue(), /Avoid: malformed hands/i);
+
+ // Multi-ecosystem prompt formats (Midjourney / SD-NovelAI / JSON)
+ await page.selectOption('#wbAR', '2:3');
+ const formatted = await page.evaluate(() => ({
+ mj: WB.formatPrompt('mj'),
+ sd: WB.formatPrompt('sd'),
+ json: JSON.parse(WB.formatPrompt('json')),
+ }));
+ assert.match(formatted.mj, /--no malformed hands/i);
+ assert.match(formatted.mj, /--ar 2:3/);
+ assert.match(formatted.sd, /Negative prompt:\s*malformed hands/i);
+ assert.equal(formatted.json.style, 'sheet');
+ assert.equal(formatted.json.shot, 'lens85');
+ assert.equal(formatted.json.aspectRatio, '2:3');
+ assert.match(formatted.json.negativePrompt, /malformed hands/i);
+ assert.ok(Array.isArray(formatted.json.references) && formatted.json.references.length >= 2);
+
+ await page.locator('#wbFmtMenu summary').click();
+ await page.locator('#wbFmtMenu [data-fmt=mj]').click();
+ assert.ok(await page.evaluate(() => window.__clipTexts.some(t => t.includes('--ar 2:3'))));
+
+ // Custom Relay Presets
+ await page.locator('#wbCfg').click();
+ await page.locator('[name=prov][value=custom]').check();
+ await page.locator('#cfPresetsW').waitFor({ state: 'visible' });
+ assert.equal(await page.locator('#cfPresets [data-preset]').count(), 5);
+ await page.locator('#cfPresets [data-preset=xai]').click();
+ assert.equal(await page.locator('#cfBase').inputValue(), 'https://api.x.ai');
+ assert.equal(await page.locator('#cfProto').inputValue(), 'xai');
+ assert.equal(await page.locator('#cfModel').inputValue(), 'grok-imagine-image-2.0');
+ assert.equal(await page.locator('#cfProxy').isChecked(), true);
+ await page.locator('#cfPresets [data-preset=flux]').click();
+ assert.equal(await page.locator('#cfProto').inputValue(), 'json');
+ assert.equal(await page.locator('#cfModel').inputValue(), 'flux-2-pro');
+ await page.locator('#cfgX').click();
+ console.log('PASS Studio 12 styles, camera shot, negative prompt, multi-ecosystem export, board clipboard PNG & relay presets');
+
+ // 3b. Infinite Spatial Canvas Studio: spatial layout, wires, output hub, zoom/tidy, drag card, prompt-linked sticky note, Zen Focus
+ assert.equal(await page.locator('#wbPh0').getAttribute('data-layout'), 'spatial');
+ await page.locator('#wbCanvasOutputs .cv-hub').waitFor({ state: 'visible' });
+ await page.waitForFunction(() => document.querySelectorAll('#wbCanvasWires path.cv-wire').length >= 2);
+
+ // Zoom & Reset
+ await page.locator('#wbCanvasZoom [data-cv-act=zin]').click();
+ const zoomedPct = await page.locator('#wbZoomPct').textContent();
+ await page.locator('#wbCanvasZoom [data-cv-act=zreset]').click();
+ assert.equal(await page.locator('#wbZoomPct').textContent(), '100%');
+ assert.notEqual(zoomedPct, '100%');
+
+ // Toggle semantic wires off/on
+ await page.locator('#wbCanvasTools [data-cv-act=wires]').click();
+ assert.equal(await page.locator('#wbCanvasWires path').count(), 0);
+ await page.locator('#wbCanvasTools [data-cv-act=wires]').click();
+ await page.waitForFunction(() => document.querySelectorAll('#wbCanvasWires path.cv-wire').length >= 2);
+
+ // Drag a reference card smoothly without falsely opening the picker
+ const firstCard = page.locator('#wbBoardCards .board-card').first();
+ const beforePos = await firstCard.evaluate(el => ({ l: parseFloat(el.style.left), t: parseFloat(el.style.top) }));
+ const box = await firstCard.boundingBox();
+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(box.x + box.width / 2 + 64, box.y + box.height / 2 + 32, { steps: 6 });
+ await page.mouse.up();
+ const afterPos = await firstCard.evaluate(el => ({ l: parseFloat(el.style.left), t: parseFloat(el.style.top) }));
+ assert.ok(Math.abs(afterPos.l - beforePos.l) >= 32, 'Dragging card should move its spatial world position');
+ assert.ok(await page.locator('#pk').isHidden(), 'Dragging card must not accidentally open picker');
+
+ // Sticky Note with live prompt injection + toggle + delete
+ await page.locator('#wbCanvasTools [data-cv-act=note]').click();
+ const noteTa = page.locator('#wbCanvasNotes .cv-note textarea').first();
+ await noteTa.waitFor({ state: 'visible' });
+ await noteTa.fill('rim light dramatic haze');
+ assert.match(await page.locator('#wbPrompt').inputValue(), /rim light dramatic haze/);
+ await page.waitForFunction(() => document.querySelectorAll('#wbCanvasWires path.note-wire').length === 1);
+ await page.locator('#wbCanvasNotes .cv-note [data-note-act=link]').first().click();
+ assert.doesNotMatch(await page.locator('#wbPrompt').inputValue(), /rim light dramatic haze/);
+ await page.locator('#wbCanvasNotes .cv-note [data-note-act=rm]').first().click();
+ assert.equal(await page.locator('#wbCanvasNotes .cv-note').count(), 0);
+
+ // Tidy & Zen Focus Canvas + Escape exit
+ await page.locator('#wbCanvasTools [data-cv-act=tidy]').click();
+ await page.locator('#wbCanvasZoom [data-cv-act=zen]').click();
+ assert.ok(await page.locator('#studio').evaluate(el => el.classList.contains('zen')));
+ assert.ok(await page.locator('#wbZenBar').isVisible());
+ await page.keyboard.press('Escape');
+ assert.ok(!(await page.locator('#studio').evaluate(el => el.classList.contains('zen'))));
+ assert.ok(await page.locator('#wbZenBar').isHidden());
+ console.log('PASS Infinite Spatial Canvas (drag, zoom, wires, output hub, prompt-linked sticky notes, Zen Focus)');
+
+ // 4. Named Character & Scene Recipes (Save, Persist, Keep-Current-Pose Swap, Full Load, Delete+Undo, JSON Import)
+ const savedPoseKey = await page.evaluate(() => WB._W.poses[0]?.k);
+ assert.ok(savedPoseKey, 'Studio should have a pose selected from example');
+ await page.locator('#wbRecipesBtn').click();
+ await page.locator('#recipeBox').waitFor({ state: 'visible' });
+ await page.fill('#rcpName', '银发机能风');
+ await page.locator('#rcpSave').click();
+ assert.equal(await page.locator('#wbRecipeN').textContent(), '1');
+ assert.equal(await page.locator('#rcpList .recipe-name').first().textContent(), '银发机能风');
+ await page.keyboard.press('Escape');
+ await page.locator('#recipeBox').waitFor({ state: 'hidden' });
+
+ // Reload and verify recipe persistence
+ await page.reload();
+ await page.waitForFunction(() => window.WB && APP.st.tab === 'studio');
+ assert.equal(await page.locator('#wbRecipeN').textContent(), '1');
+
+ // Switch studio to a different pose and different style, then Keep-Current-Pose swap!
+ const otherPoseKey = savedPoseKey === 'p:001' ? 'p:002' : 'p:001';
+ await page.evaluate(async key => {
+ await WB.setSel({ pose: [APP.ITEMS[key]] });
+ }, otherPoseKey);
+ await page.locator('#wbStyles [data-style=ecom]').click();
+ assert.equal(await page.evaluate(() => WB._W.poses[0]?.k), otherPoseKey);
+
+ await page.locator('#wbRecipesBtn').click();
+ await page.locator('#rcpList [data-rcp-keep]').first().waitFor({ state: 'visible' });
+ await page.locator('#rcpList [data-rcp-keep]').first().click();
+ await page.locator('#recipeBox').waitFor({ state: 'hidden' });
+ await page.waitForFunction(k => WB._W.poses[0]?.k === k && WB._W.style === 'sheet' && WB._W.garments.length >= 1, otherPoseKey);
+
+ // Full load restores original saved pose
+ await page.locator('#wbRecipesBtn').click();
+ await page.locator('#rcpList [data-rcp-load]').first().click();
+ await page.waitForFunction(k => WB._W.poses[0]?.k === k, savedPoseKey);
+
+ // Delete + Undo
+ await page.locator('#wbRecipesBtn').click();
+ await page.locator('#rcpList [data-rcp-del]').first().click();
+ assert.ok(await page.locator('#rcpEmpty').isVisible());
+ assert.ok(await page.locator('#wbRecipeN').isHidden());
+ await page.locator('#toast button').click();
+ assert.equal(await page.locator('#wbRecipeN').textContent(), '1');
+
+ // JSON Import
+ const importPayload = JSON.stringify({
+ recipes: [{
+ id: 'imported_1',
+ name: 'Cyber Lookbook',
+ t: Date.now(),
+ mode: 'gen',
+ style: 'cyber',
+ shot: 'low',
+ ar: '9:16',
+ pl: 'en',
+ extra: 'neon reflections',
+ neg: 'blurry',
+ refs: { r: ['r:p1'], g: ['c:c2'], p: [['p:002', 0]], e: [], x: [] },
+ }],
+ });
+ await page.setInputFiles('#rcpImpF', {
+ name: 'recipes.json',
+ mimeType: 'application/json',
+ buffer: Buffer.from(importPayload, 'utf8'),
+ });
+ await page.waitForFunction(() => document.querySelectorAll('#rcpList .rcp-item').length === 2);
+ assert.equal(await page.locator('#wbRecipeN').textContent(), '2');
+ await page.keyboard.press('Escape');
+ console.log('PASS Named Studio Recipes (save, persistence, keep-pose swap, full load, delete+undo, JSON import)');
+
+ // 5. 5-Language Parity Check (en / ja / vi / tr) on new UI controls + preserved user recipe names
+ const checks = [
+ ['en', 'Recipes', 'Copy PNG', 'Formats', 'Studio recipes'],
+ ['ja', 'レシピ', 'PNG コピー', '形式別', 'スタイルレシピ'],
+ ['vi', 'Công thức', 'Chép PNG', 'Định dạng', 'Công thức phối đồ'],
+ ['tr', 'Tarifler', 'PNG kopyala', 'Biçimler', 'Stüdyo tarifleri'],
+ ];
+ for (const [loc, rcpBtn, copyPng, formatsLbl, rcpTitle] of checks) {
+ await page.locator('#languageMenu summary').click();
+ await page.selectOption('#uiLocale', loc);
+ await page.waitForFunction(l => document.documentElement.lang === l, loc);
+ await page.locator('#languageMenu summary').click();
+ assert.equal(await page.locator('#wbRecipesBtn').evaluate(el => el.firstChild.textContent.trim()), rcpBtn);
+ assert.equal(await page.locator('#wbCopyBoard').textContent(), copyPng);
+ assert.equal(await page.locator('#wbFmtMenu summary').textContent(), formatsLbl);
+ await page.locator('#wbRecipesBtn').click();
+ assert.equal(await page.locator('#rcpT').textContent(), rcpTitle);
+ // User-authored recipe name must stay untranslated!
+ const names = await page.locator('#rcpList .recipe-name').allTextContents();
+ assert.ok(names.includes('银发机能风'), 'User recipe name should be preserved in ' + loc);
+ if (loc !== 'ja') {
+ const uiTexts = await page.evaluate(() => [
+ document.querySelector('#rcpT').textContent,
+ document.querySelector('#rcpSave').textContent,
+ document.querySelector('#rcpExp').textContent,
+ document.querySelector('#wbCopyBoard').textContent,
+ document.querySelector('#wbFmtMenu summary').textContent,
+ ]);
+ for (const text of uiTexts) {
+ assert.ok(!/[\u4e00-\u9fff]/.test(text), `Leaked CJK in ${loc}: ${text}`);
+ }
+ }
+ await page.keyboard.press('Escape');
+ }
+ console.log('PASS 5-language UI parity (en/ja/vi/tr) and preserved user recipe names');
+
+ // 6. Narrow mobile (320x568) + Dark theme overflow & layout check on new controls
+ await page.setViewportSize({ width: 320, height: 568 });
+ await page.evaluate(() => window.PoseWearTheme.select('dark'));
+ await page.waitForFunction(() => document.documentElement.dataset.theme === 'dark');
+ const studioOverflow = await page.evaluate(() => ({
+ scrollW: document.documentElement.scrollWidth,
+ innerW: window.innerWidth,
+ rcpRect: document.querySelector('#wbRecipesBtn').getBoundingClientRect().toJSON(),
+ }));
+ assert.ok(studioOverflow.scrollW <= studioOverflow.innerW + 1, 'Studio should not overflow horizontally at 320px: ' + JSON.stringify(studioOverflow));
+ assert.ok(studioOverflow.rcpRect.right <= 321 && studioOverflow.rcpRect.left >= 0, '#wbRecipesBtn should stay within 320px viewport');
+
+ await page.locator('#wbRecipesBtn').click();
+ await page.locator('#recipeBox').waitFor({ state: 'visible' });
+ const rcpBoxRect = await page.locator('.rcp-box').boundingBox();
+ assert.ok(rcpBoxRect && rcpBoxRect.x >= 0 && rcpBoxRect.x + rcpBoxRect.width <= 321, 'Recipe modal should fit 320px viewport');
+ await page.keyboard.press('Escape');
+
+ await page.evaluate(() => APP.compareOpen(['p:001', 'p:002']));
+ await page.locator('#cmpModal').waitFor({ state: 'visible' });
+ const cmpBoxRect = await page.locator('.cmp-box').boundingBox();
+ assert.ok(cmpBoxRect && cmpBoxRect.x >= 0 && cmpBoxRect.x + cmpBoxRect.width <= 321, 'Compare modal should fit 320px viewport');
+ await page.keyboard.press('Escape');
+ console.log('PASS 320px mobile dark-mode layout & viewport fit for new dialogs');
+
+ assert.deepEqual(errors, []);
+ console.log('creative-update-regressions PASS');
+ } finally {
+ await browser.close();
+ }
+}
+
+run().catch(err => {
+ console.error(err);
+ process.exitCode = 1;
+});
diff --git a/tests/local-engine-regressions.mjs b/tests/local-engine-regressions.mjs
index a7b6a98..bac0089 100644
--- a/tests/local-engine-regressions.mjs
+++ b/tests/local-engine-regressions.mjs
@@ -33,11 +33,18 @@ const server=http.createServer(async(req,res)=>{
if(req.url==='/prompt'){
const {prompt}=await new Response(Readable.toWeb(req)).json();
submittedGraph = prompt;
- assert.equal(prompt['2'].inputs.image,'input-folder/loaded.jpg');
- assert.equal(prompt['3'].inputs.text,'reference test');
- return json({prompt_id:'job-1'});
+ const outputId = Object.entries(prompt).find(([,n]) => n._meta?.title === 'PoseWear Output')?.[0] || '8';
+ const promptNode = Object.values(prompt).find(n => n._meta?.title === 'PoseWear Prompt');
+ assert.equal(promptNode.inputs.text ?? promptNode.inputs.prompt, 'reference test');
+ const imageNodes = Object.values(prompt).filter(n => /^PoseWear Image \d+$/.test(n._meta?.title));
+ assert.ok(imageNodes.every(n => n.inputs.image === 'input-folder/loaded.jpg'));
+ return json({prompt_id:'job-'+outputId});
+ }
+ if(req.url.startsWith('/history/job-')){
+ const id = req.url.slice('/history/'.length);
+ const outNode = id.slice('job-'.length);
+ return json({[id]:{outputs:{[outNode]:{images:[{filename:'output.png',type:'output'}]}}}});
}
- if(req.url==='/history/job-1')return json({'job-1':{outputs:{'8':{images:[{filename:'output.png',type:'output'}]}}}});
if(req.url.startsWith('/view?'))return res.writeHead(200,{'content-type':'image/png'}).end(bytes);
res.writeHead(404).end();
});
@@ -110,6 +117,23 @@ try{
}else assert.equal((await request(engine,'POST')).status,200);
console.log('PASS local '+name+' connection, submission and result');
}
+ const depthEngine=localEngine({POSEWEAR_LOCAL_ENGINE:'comfyui',POSEWEAR_LOCAL_URL:origin,
+ POSEWEAR_COMFY_WORKFLOW:new URL('../docs/comfyui/depth-controlnet-api.json',import.meta.url)});
+ const depthImg=await request(depthEngine,'POST',1,undefined,'576x1024');
+ assert.equal(depthImg.status,200);
+ assert.equal(submittedGraph['4'].inputs.text,'reference test');
+ assert.equal(submittedGraph['7'].inputs.width,576);
+ assert.equal(submittedGraph['7'].inputs.height,1024);
+
+ const qwenEngine=localEngine({POSEWEAR_LOCAL_ENGINE:'comfyui',POSEWEAR_LOCAL_URL:origin,
+ POSEWEAR_COMFY_WORKFLOW:new URL('../docs/comfyui/multi-ref-qwen-edit-api.json',import.meta.url)});
+ assert.equal((await request(qwenEngine,'POST',2)).status,502,'3-ref workflow should reject 2 references');
+ const qwenImg=await request(qwenEngine,'POST',3,undefined,'1024x1536');
+ assert.equal(qwenImg.status,200);
+ assert.equal(submittedGraph['8'].inputs.prompt,'reference test');
+ assert.equal(submittedGraph['10'].inputs.width,1024);
+ assert.equal(submittedGraph['10'].inputs.height,1536);
+ console.log('PASS bundled ComfyUI depth ControlNet and 3-ref Qwen-Image-Edit templates');
assert.equal((await request(null,'GET')).status,404);
}finally{server.closeAllConnections();await new Promise(resolve=>server.close(resolve));}
const unavailable=await request(preset,'GET');
diff --git a/tests/run.mjs b/tests/run.mjs
index de6deca..e0c52e7 100644
--- a/tests/run.mjs
+++ b/tests/run.mjs
@@ -6,6 +6,7 @@ const directory = new URL('./', import.meta.url);
// These suites serve source files and fixtures directly or start their own loopback server.
const offlineSuites = [
'build-post-regressions.mjs',
+ 'creative-update-regressions.js',
'gallery-regressions.js',
'locale-regressions.js',
'local-engine-regressions.mjs',