
VisualSpec
io.github.utkarshx27由 GitHub 帳號 utkarshx27 發布v0.1.0更新於 Oct 24, 2026
Structured, constraint-aware visual generation and deterministic layout for AI agents
概覽
讓助理把需求轉成結構化視覺規格,確定性地渲染排版與版面,並搭配可選的 AI 圖像生成製作社群圖片。
- 可以做什麼
- VisualSpec 會把自然語言需求轉換成機器可讀的 YAML 視覺規格,進行 schema 驗證,並用 SVG 排版引擎在本機渲染精確的標題、副標題、徽章與安全邊界。它也能執行完整流程,把 AI 生成的底圖與確定性文字疊加合成,接著對邊界、尺寸、行數與文案不變條件做視覺品檢,並進行局部修復。工具包含 visual_brief_to_spec、visual_validate_spec、visual_render、visual_generate、visual_check_qa、visual_repair 與 visual_list_resources。
- 適用情境
- 適合需要文案、排版與平台尺寸都精確可控的社群或行銷圖片,而不是完全交給圖像模型處理。支援 Instagram、LinkedIn 與通用社群格式,以及產品發布、引言卡片與數據卡片範本。確定性渲染不需要任何圖像 API 金鑰。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,需要 Node.js 與 npx。可選的 GEMINI_API_KEY 或 OPENAI_API_KEY 用來啟用 AI 圖像生成;沒有這些金鑰時只能做確定性渲染與模擬生成。僅限桌面端,沒有遠端端點。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 VisualSpec,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
VisualSpec
Deterministic visual generation for AI agents.
AI creates the imagery. VisualSpec guarantees the typography and layout.
[VisualSpec Generation Pipeline Demo]
[npm package] [MCP Registry] [License] [Tests] [GitHub stars]
The Core Problem
Most image-generation workflows fail for social and marketing graphics because a single natural-language prompt is expected to handle too many concerns at once:
- subject & background
- exact typography & wording
- platform dimensions & safe margins
- visual hierarchy & negative space
- brand color rules & constraints
Image models frequently hallucinate gibberish text, truncate words, or disregard composition rules.
The Solution: Layer Separation
VisualSpec separates generative concerns from deterministic concerns:
- Generative Layers (AI Models): Photography, 3D subjects, atmospheric backgrounds, textures, lighting.
- Deterministic Layers (Code & SVG Engine): Exact headlines, subtitles, badges, logos, metrics, safe margins, and layout rules.
- Structured Visual Spec: A machine-readable YAML specification that acts as the single contract.
- Visual QA & Targeted Repair: Verifies geometry, margins, and exact copy invariants, synthesizing localized repairs without regenerating entire scenes.
Documentation
- Architecture & Design Principles
- VisualSpec Schema & Contract
- MCP Server Setup (Cursor, Claude, Antigravity)
- Adding a New Image Model Provider
- Contributing Guidelines
Quickstart
Instant Run (No Install Required)
Or Install Globally
Or Build from Source
1. Initialize a Project
2. Validate a Visual Spec
3. Inspect the Compiled Generation Prompt
4. Deterministic Render (No API Key Required)
Render layout, typography, and background styling locally:
5. Run the Full Generation Pipeline
6. Verify Asset Quality with Visual QA
Model Context Protocol (MCP) Server
VisualSpec runs as a native MCP server over stdio, enabling AI coding assistants (Cursor, Claude Code, Gemini CLI, and Antigravity IDE) to invoke visual tools directly:
Available MCP Tools
visual_brief_to_spec: Convert natural language requests into valid VisualSpec YAML.visual_validate_spec: Schema validation for specs.visual_render: Deterministic layout & typography rendering (zero API key).visual_generate: Full image model adapter + deterministic text overlay pipeline.visual_check_qa: Inspect safe margins, line counts, dimensions, and invariants.visual_repair: Automated diagnosis and localized typography/layout repair.visual_list_resources: List supported platform packs and templates.
See the MCP Setup Guide for Cursor, Claude Desktop, and Antigravity IDE configuration snippets.
Output Bundle
Every generation creates a complete, reproducible debug bundle:
Supported Platforms & Templates
Platforms
- Instagram: Feed portrait (1080x1350, 4:5), Square (1080x1080, 1:1), Story (1080x1920, 9:16).
- LinkedIn: Feed portrait (1080x1350), Square (1080x1080), Banner (1200x628).
- Generic Social: Universal 1:1, 4:5, and 16:9 social formats.
Templates
- Product Launch: High-impact headline, feature pill, product visual region, supporting subhead.
- Quote Card: Center-focused editorial quote, author attribution, minimal atmospheric glow.
- Stat Card: Large numeric hero metric, descriptive label, and data context notes.
Agent Skills
The framework includes 10 standardized skill definitions located in ./skills/:
using-visualspec: Master workflow instructions.visual-brief: Brief extraction and analysis.visual-spec: YAML authoring and schema rules.composition: Spatial hierarchy and negative space allocation.typography: Font family classing and line budgeting.strict-constraints: Invariant taxonomy and forbidden parameters.social-instagram: Instagram-specific design reasoning.social-linkedin: LinkedIn-specific design reasoning.visual-qa: Automated inspection and validation.visual-repair: Localized diagnosis and patch generation.
Roadmap & Open Contributions
We welcome contributions! Key areas to build together:
- Additional Platforms: X/Twitter (Header, Post), YouTube Thumbnails, Pinterest, TikTok Cover.
- Additional Templates: Testimonial, Product Comparison, Event Announcement, Feature List.
- Additional Image Model Adapters: Flux, Stable Diffusion / ComfyUI, Midjourney API.
- Brand Packs: Multi-brand palette overrides, custom font loading, logo clear space rules.
- Visual Studio: Local web playground / viewer for real-time spec inspection and margin toggling.
Contributing
Contributions are welcome! Please check our:
Testing
Run the automated test suite:
All 28 tests run offline without requiring any third-party API keys.
License
Licensed under the Apache License, Version 2.0.
來源:README.md,提交 cd28b8e
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分