Skip to main content
Glama
README.md
> **Language**: **English** | [简体中文](./README.zh-CN.md)

# Atelier Board

**A real-time interactive composition & critique board for AI image prompting.**

[![Live Demo](https://img.shields.io/badge/Live%20Demo-Try%20in%20Browser-7c3aed?style=for-the-badge)](https://wice2261-ux.github.io/atelier-board/?lang=en)
[![Release v0.4.1](https://img.shields.io/github/v/release/wice2261-ux/atelier-board?style=for-the-badge&color=0ea5e9)](https://github.com/wice2261-ux/atelier-board/releases/latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-22c55e?style=for-the-badge)](./LICENSE)

> **Try it right now (no install, zero backend)**: Open the **[Online Live Demo](https://wice2261-ux.github.io/atelier-board/?lang=en)** to test framing, 1-point perspective, color extraction, ComfyUI/A1111 PNG metadata recovery, and native `.workflow.json` export directly in your browser.

Atelier Board turns framing, lighting, multi-image references, and iterative image edits from vague text back-and-forth into a visual canvas—syncing bidirectionally with your AI agent via **MCP Apps**, **Local Bridge (HTTP + SSE)**, a **native DeepSeek Harness sidebar plugin**, or a **standalone offline HTML file**.

- **For non-art AI creators**: No need to memorize cinematography, perspective, or lighting terminology—draw a few boxes, drag a key-light or object-direction arrow, crop and collage pieces from multiple reference images, and let Atelier Board translate your visual intuition into a clean semantic brief and annotated image for your AI.
- **For artists & power prompters**: Get exact pixel and normalized coordinates, composition guides (Rule of Thirds / Diagonal / Golden Ratio), multi-reference collage with hidden lighting/style layers, automatic **multi-platform metadata recovery** (ComfyUI / A1111-Forge / NovelAI / compressed PNG / WebP & JPEG EXIF), Ghost Blueprint overlays, multi-round prompt history with word-level Diff, and a structured `FIX / ADD / MOVE / KEEP / DEL` critique loop.

---

## Visual Demo

<table>
  <tr>
    <th width="50%">Draft Layout Mode (Live Agent Sync)</th>
    <th width="50%">Critique Mode (PNG Metadata Recovery + Ghost Blueprint)</th>
  </tr>
  <tr>
    <td><img src="./docs/assets/demo-draft.gif" alt="Draft Layout Demo" width="100%" /></td>
    <td><img src="./docs/assets/demo-critique.gif" alt="Critique Mode Demo" width="100%" /></td>
  </tr>
</table>

<sub>*Screencasts recorded in Chinese UI; the live board includes a one-click <code>中 / EN</code> language toggle in the top bar.*</sub>

---

## Key Features

### 1. Bilingual Runtime UI & Semantic Output (`EN / 中文`)
- Single-bundle runtime internationalization with zero heavy dependencies: automatically follows `?lang=en|zh`, saved preference, host locale (e.g. DeepSeek Harness), or browser language, with a one-click **`中 / EN`** toggle in the top bar.
- Both UI labels, exported semantic Markdown, compiler diagnostics, and annotated PNG / reference-sheet badges adapt to your selected language, while saved project JSON stays 100% cross-language compatible.

### 2. Draft Layout Mode
- **Spatial framing, free rotation & subject facing dial**: 4 element kinds (`Subject / Region / Text / Accent`), z-order controls, `LOCK` pins, 4 composition guides (`None / Rule of Thirds / Diagonal / Golden Ratio`), **free box rotation** (`-180°` to `180°` via canvas rotation handle with `Shift` 15° snapping, local-axis 8-handle resize, and off-canvas bleed support), and a **top-down Subject Facing Dial** (`-180°` to `180°` horizontal yaw with 6-tier semantic phrasing from front view / slightly angled / 3/4 view to profile / back view, combinable with `gaze` arrows for over-the-shoulder looks).
- **Camera framing, horizon line & 1-point vanishing point**: Configure shot size, camera angle, lens feel, depth of field (with per-element `◎` focus binding), and a draggable canvas **horizon line** (height, Dutch-angle roll with `Shift` 5° snap, and optional **1-point vanishing point** rays).
- **2 freehand SVG sketch brushes (`F` / `C`)**: Draw smooth **Flow Curves** (auto-arrowed S/C composition leading lines) and **Freehand Contours** (rough poses, foreground silhouettes, or irregular critique outlines), RDP-simplified to compact vectors with `S1/S2…` badges and geometric trend descriptions.
- **3 directional vector arrows with box anchoring & light character**:
  - **Key Light (`light`)**: primary light direction, highlight side, plus **color temperature** (`Warm / Neutral / Cool / Neon` or custom tint) and **light quality** (`Soft / Hard / Rim Light`);
  - **Gaze (`gaze`)**: character sightline and visual interaction;
  - **Object Direction (`direction`)**: paired with depth hints (`Flat / Toward Camera / Away from Camera`);
  - **Dual-end box anchoring**: snap arrow endpoints directly onto Draft or Critique boxes (hold `Alt` to bypass) so arrows follow box move/scale/rotation and output explicit subject relationships.
- **Color palette, value/key & auto-extraction**: Set value key (`High / Mid / Low / Chiaroscuro`), saturation tone, and up to 5 weighted color swatches (`Dominant / Secondary / Accent`)—either from built-in presets or **auto-extracted from any `Ref A–F` / Critique image** in-browser. Semantic output translates HEX values into readable bilingual color names, and `annotated.png` appends a slim bottom palette strip whenever swatches are set.
- **8 classic composition templates & live composition linter**: Start faster with 8 ready-made full-stack templates (Rule of Thirds portrait, 1-point perspective corridor, diagonal action, over-the-shoulder dialogue, editorial poster, golden-line landscape, product studio, split diptych) with SVG aspect previews and full `Ctrl+Z` undo. A non-blocking **Composition Linter** proactively flags lock/edit overlaps, crowded text boxes, tiny moves, and regional alignment issues with click-to-focus.
- **Agent-to-board drafting & shared prompt baseline**: Describe your idea in chat and let your AI call `push_draft_to_board` to populate an editable initial layout directly on the canvas (including target model / prompt language presets, color palettes, and regional strengths). Both Draft and Critique modes share the **Prompt Baseline card** with one-click copy, manual snapshot saving, and history Diff access; press `Ctrl+V` anywhere in Draft to paste reference images straight into `Ref A–F`.

### 3. Multi-Reference Collage (`Ref A–F`, works in both Draft & Critique)
- Load up to 6 reference images (auto-resized to max 1024px edge) and open any image in a full **multi-object crop workbench**:
  - Reuses the main canvas box & 3-vector tools—draw **multiple crop boxes** and **multiple directional arrows** on a single reference image (move, 8-handle resize, endpoint drag, or one-click "Select Full Image");
  - Reference dimension defaults to **`None`** (relying purely on your own label and note), with optional quick tags (`Background / Character / Outfit / Lighting / Style / Pose`);
  - Place cropped patches onto either the **Draft canvas** or directly over a **Critique output image**, with per-patch opacity, visibility toggles, and **horizontal/vertical mirror flip (`Flip X / Flip Y`)** synced across canvas, snapshots, source arrows, and semantic briefs;
  - Automatically exports both `annotated.png` and `reference-sheet.png` for multimodal agents.

### 4. Critique & Diff Iteration Loop
- **Multi-platform metadata recovery & `Ctrl+V` paste**: Drag, drop, or press `Ctrl+V` to load generated outputs and automatically recover prompts, models, LoRAs, and sampling settings from **ComfyUI PNG** (including `zTXt` / compressed `iTXt` and `[NaN]` JSON), **A1111 / Forge `parameters`**, **NovelAI**, and **WebP / JPEG EXIF & XMP**.
- **5 diff primitives & 3 critique strategies**:
  - **Incremental Edit (`incremental`)**: Minimal-perturbation prompt fixes using `FIX / ADD / MOVE / KEEP / DEL` (`DEL` marks objects for complete removal with a dashed cross) anchored to the original prompt;
  - **Reference Remix (`reference-remix`)**: Re-imagine from a reference image when no original prompt exists;
  - **Iterative Restore (`iterative-restore`)**: Side-by-side comparison against a target image (hold to peek original) so the agent can converge round by round.
- **AI diagnostic suggestions & human-in-the-loop review**: Let your AI inspect an uploaded output and push candidate defect boxes (`critiqueSuggestions` via `push_draft_to_board`) rendered in a separate dashed `AI` overlay. Pending suggestions stay isolated from formal edit instructions and exported `annotated.png` until you explicitly click **"+ Accept"** (promoting them into editable Critique items) or **"✕"** to dismiss.
- **Prompt write-back & multi-round Diff history**: After finalizing a revised prompt (English, Chinese, or mixed), the agent calls `sync_prompt_to_board` to update the baseline, archive up to 30 lightweight text snapshots automatically, and refresh the MOSS Ghost Blueprint—letting you inspect word-level prompt Diffs, compare parameter changes, and restore any prior round in one click.

### 5. 3 Built-in Output Dialects & Model Presets (Zero-Code Model Adaptation)
- **Target model & prompt language presets**: Declare target model syntax (`Auto / FLUX / Qwen-Image / SDXL-Illustrious / NovelAI / Midjourney / Custom`) and preferred prompt language (`Auto / English / Simplified Chinese`) right in the board.
- **Spatial Discussion (Markdown)**: High-signal spatial brief for natural-language models (FLUX / Qwen-Image / SD 3.5) and tag-based models (SDXL / Pony / Illustrious / NovelAI);
- **MOSS-Image JSON**: Bidirectional `abs_centralized yxyx` single-line JSON compiler with 16px alignment validation and paste-to-import;
- **Regional Area / ComfyUI (`atelier-regional-area/v1` + native workflow)**: Exports 8px latent-aligned `area_px_8`, percentage `area_pct`, per-region `strength` weights (`0.1–2.0`), and 4-decimal `bbox_xyxy_norm`, plus a **100% native ComfyUI LiteGraph `.workflow.json`** (`CLIPTextEncode` → `ConditioningSetArea` / `ConditioningSetAreaPercentage` → `ConditioningCombine` + `EmptyLatentImage`, zero custom-node dependencies) validated against official ComfyUI minimum size constraints.

---

## Architecture

Atelier Board strictly separates its **Core Layer** from its **Adapter Layer** so every harness shares one single source of truth:

```mermaid
flowchart LR
  subgraph Core["Core Layer (src/core + src/canvas + src/i18n)"]
    S["Unified Document Schema (schema.ts)"]
    D["Dialect Registry (MOSS / Regional / Semantic Lens)"]
    M["ComfyUI PNG Metadata Recovery"]
    C["SVG Stage + Multi-Ref Workbench + PNG/Sheet Renderer"]
  end

  subgraph Adapter["Adapter Layer (src/adapters + server + plugins)"]
    A1["Antigravity MCP App (Native Sidebar)"]
    A2["DeepSeek Harness Plugin (Native Cordis Sidebar)"]
    A3["Local Bridge (HTTP + SSE for Claude / Codex)"]
    A4["Standalone Offline HTML (Clipboard / Local FS)"]
    MCP["MCP Server (4 Business Tools)"]
  end

  Core --> Adapter
  MCP -->|"Antigravity / Claude / Codex / DSH"| AI["AI Agent"]
```

---

## Quick Start (3 Minutes)

### Prerequisites
- Node.js `20+`

### 1. Install & Build (or download prebuilt GitHub Release bundles)

```bash
npm install
npm run build:all
```

This builds:
- `dist-singlefile/index.html` — standalone / embedded frontend
- `server/dist/mcp-server.mjs` — zero-dependency MCP Server + Local Bridge
- `plugins/dsh-atelier-board/` — installable DeepSeek Harness native sidebar plugin

Run `npm run pack:release` to assemble all 6 ready-to-distribute release bundles + `release/SHA256SUMS.txt`.

### 2. Connect Your Harness

| Target Harness | Integration Mode | Setup & Templates |
| --- | --- | --- |
| **Google Antigravity** | Native sidebar MCP App plugin (`${PLUGIN_ROOT}`) | [Setup Guide §1](./docs/harness-setup.md#1-google-antigravity-native-sidebar-mcp-app) · [Template](./examples/antigravity-plugin/) |
| **DeepSeek Harness (DSH)** | Native Cordis sidebar plugin (open directly from left sidebar) | [Setup Guide §5](./docs/harness-setup.md#5-deepseek-harness-dsh) · [Plugin Source](./plugins/dsh-atelier-board/) |
| **Codex Desktop** | Standard Codex plugin bundle (`openai/ui` sidebar & panel metadata) | [Setup Guide §4](./docs/harness-setup.md#4-codex) · [Template](./examples/codex-plugin/) |
| **Codex CLI** | `~/.codex/config.toml` + Local Bridge (`--no-app-tools`) | [Setup Guide §4](./docs/harness-setup.md#4-codex) · [Snippet](./examples/codex/config.toml) |
| **Claude Desktop** | `claude_desktop_config.json` + Local Bridge (`--no-app-tools`) | [Setup Guide §2](./docs/harness-setup.md#2-claude-desktop) · [Snippet](./examples/claude-desktop/claude_desktop_config.json) |
| **Claude Code** | Standard plugin bundle (`--plugin-dir`) or `.mcp.json` | [Setup Guide §3](./docs/harness-setup.md#3-claude-code) · [Template](./examples/claude-code-plugin/) |
| **Offline / Web AI** | Double-click `dist-singlefile/index.html` or run `npm run bridge` | [Setup Guide §6](./docs/harness-setup.md#6-offline--zero-mcp-mode) |

- **DSH native plugin**: `dsh plugin --profile desktop add <extracted-dir>` and restart DSH—click **Atelier Board** in the left sidebar anytime.
- **Codex Desktop plugin**: `codex plugin marketplace add <extracted-dir> && codex plugin add atelier-board@atelier-board`.
- **Claude Code plugin**: `claude --plugin-dir <extracted-dir>`.

### 3. Add the Neutral Workflow Skill to Your Agent

Copy [docs/SKILL_TEMPLATE.md](./docs/SKILL_TEMPLATE.md) (or [中文版](./docs/SKILL_TEMPLATE.zh-CN.md)) into your agent's skill directory or system prompt so it follows the Draft, Multi-Reference Collage, and Critique workflows cleanly.

---

## Documentation

- [Universal Agent Workflow Skill Template (`SKILL_TEMPLATE.md`)](./docs/SKILL_TEMPLATE.md) · [简体中文](./docs/SKILL_TEMPLATE.zh-CN.md)
- [Model Adaptation & Dialect Extension Guide (`model-adaptation.md`)](./docs/model-adaptation.md) · [简体中文](./docs/model-adaptation.zh-CN.md)
- [Multi-Harness Setup Guide (`harness-setup.md`)](./docs/harness-setup.md) · [简体中文](./docs/harness-setup.zh-CN.md)

---

## Development & Testing

```bash
# Start Vite dev server
npm run dev

# Run full unit test suite
npm test

# Production web build
npm run build

# Build single-file frontend, MCP server, and DSH plugin
npm run build:all

# Build & package all 6 GitHub Release artifacts + SHA256SUMS.txt into release/
npm run pack:release

# Run standalone Local Bridge only (default http://127.0.0.1:4173)
npm run bridge

# Run bundled MCP server stdio smoke tests (default & --no-app-tools)
ATELIER_BOARD_SMOKE_STDIO=1 npm test -- server/__tests__/mcp-server.test.ts -t "打包产物通过 stdio"
```

---

## License

[MIT](./LICENSE)

TDQS

C2.9/5.0

Scored across 6 tools

Disambiguation2/5

get_board_state and app_get_state both read board state with only subtle wording differences (semantic context vs full state/metadata), and push_draft_to_board already accepts a prompt profile that sync_prompt_to_board writes separately. app_sync_state vs push_draft_to_board also overlap on persisting layout/annotations, so an agent cannot reliably pick the right writer.

Naming Consistency2/5

Naming mixes a resource-prefix style (app_sync_state, app_get_state) with verb_noun style (open_atelier_board, push_draft_to_board, sync_prompt_to_board, get_board_state), including two different verbs (push vs sync) for very similar write operations. The pattern is not predictable from name alone.

Tool Count4/5

Six tools is a sensible, well-scoped count for a canvas/board assistant. The only quibble is that the redundancy comes from duplicated read/write paths rather than from too many tools.

Completeness3/5

The surface covers opening the board, reading state, pushing layouts/palettes/prompts, and syncing app state, so core round-trip workflows exist. However there is no explicit clear/reset, annotation removal, history/undo, or export operation, which are notable gaps for a drawing board lifecycle.

Maintenance

ActivityNo data
ResponsivenessNo recent community issues