Skip to content

Peleke/graphix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

245 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Graphix

AI-Native Graphic Novel & Comic Creation Tool

TypeScript React Hono Bun License: MIT

Stop wrestling with Photoshop. Start generating "content."

Get Started ยท Features ยท Architecture ยท Contributing


โš ๏ธ A Note on "Art"

Let's be real: what this tool produces is not art. It's AI-generated images arranged into panels. Real comics are made by artists who spent years mastering anatomy, perspective, and storytelling through sequential imagery. This is... not that.

Graphix is for rapid prototyping, concept visualization, moodboards, and having fun. If you're using this to replace actual artists, please reconsider your life choices. If you're using it to iterate on ideas before hiring an artist, or just messing aroundโ€”welcome aboard, ye scurvy dog. ๐Ÿดโ€โ˜ ๏ธ

We're not delusional. We're just building tools.


The Problem

Creating visual narratives is a fragmented nightmare. You need Photoshop for editing, Midjourney for generation, ComfyUI for control, spreadsheets for character consistency, and a prayer for workflow sanity. The tools fight you instead of helping you iterate on ideas.

The Solution

Graphix is an AI-native creation tool built for the workflow you actually need:

Characters that stay (somewhat) consistent. Panels that generate in context. Pages that compose themselves.

Instead of juggling 10 apps, Graphix gives you one unified workspace where characters remember their appearance (mostly), panels understand their narrative context, and you focus on the story, not the tools.

Is it art? No. Is it useful? Hell yes.


โœจ Features

๐ŸŽญ Character Consistency Engine

Define a character onceโ€”species, colors, styleโ€”and Graphix attempts visual consistency across panels. IP-Adapter embeddings, LoRA associations, and prompt fragments all managed automatically. Results may vary. Hands will still look weird.

๐Ÿ“– Story-First Workflow

Write your premise, break it into beats, and watch panels scaffold themselves. Narrative context flows into generation prompts automatically. Your story drives the slop, not the other way around.

๐ŸŽจ ControlNet Made Easy

Pose references, depth maps, lineart extractionโ€”all the power of ComfyUI's ControlNet stacking, exposed through an ergonomic UI that doesn't require a PhD in diffusion models.

๐ŸŒณ Generation Tree Visualization

Every variant, every iteration, visualized as a D3-powered tree. Branch from any generation, compare results side-by-side, never lose a good idea to overwriting.

๐Ÿ“„ Page Composition

Drag panels into templates, adjust gutters, add captions. WYSIWYG page composition that exports to print-ready PDFs or image sequences.

๐Ÿ”Œ Local-First Architecture

Your data, your machine. SQLite database, local file storage, no cloud dependency. Deploy to Turso when you're ready to share your magnificent AI slop with the world.


๐Ÿ†š Why Graphix?

Traditional AI Workflow Graphix
Character Consistency Manual prompt copy-paste โœ… Automatic embedding + LoRA
Panel Context Noneโ€”each gen is isolated โœ… Story beats inform prompts
ControlNet ComfyUI node spaghetti โœ… Visual preset picker
Version History Overwrite and pray โœ… Full generation tree
Page Layout Photoshop/InDesign โœ… Built-in composer
Data Ownership Cloud lock-in โœ… Local-first, your files
Self-Awareness "AI art is real art!" โœ… We know what this is

๐Ÿ–ผ๏ธ Screenshots

Dashboard Story Editor Generation Tree
Project overview with characters Narrative-driven panel creation D3 visualization of all variants

Full UI launching soon


Part II: Technical Documentation

For engineers, contributors, and the morbidly curious


๐Ÿ—๏ธ Architecture Overview

Graphix is a monorepo with clean separation between business logic, API adapters, and UI.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         UI (PWA)                                 โ”‚
โ”‚      React 19 ยท TanStack Router ยท Zustand ยท Fabric.js           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      @graphix/server                             โ”‚
โ”‚         Hono REST API ยท MCP Server ยท OpenAPI Spec               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                  โ”‚
           โ–ผ                  โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  @graphix/core  โ”‚    โ”‚              ComfyUI MCP                 โ”‚
โ”‚  Business Logic โ”‚    โ”‚     Image/Video Generation via MCP      โ”‚
โ”‚  Drizzle ORM    โ”‚    โ”‚                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  SQLite/Turso   โ”‚
โ”‚   Database      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Package Structure

Package Purpose
@graphix/core Pure business logicโ€”services, generation, composition. Zero transport concerns.
@graphix/server REST API (Hono) + MCP server. OpenAPI spec with Zod schemas.
@graphix/client Type-safe TypeScript client generated from OpenAPI spec.
@graphix/ui React frontendโ€”dashboard, editors, canvas, generation tree.

Tech Stack

Layer Technology Why
Runtime Bun Fast, TypeScript-native, great DX
Frontend React 19, TanStack Router Modern React with file-based routing
State Zustand + Immer Simple, performant state management
Styling Panda CSS Type-safe, zero-runtime CSS-in-JS
Canvas Fabric.js Proven canvas library for composition
Visualization D3.js Generation tree rendering
API Hono Fast, lightweight, middleware ecosystem
Database Drizzle ORM + SQLite/Turso Type-safe, local-first with cloud option
Validation Zod Runtime validation + OpenAPI generation
Testing Bun Test, Vitest, Playwright Unit, integration, E2E coverage
Desktop Tauri Native app distribution

๐Ÿš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/Peleke/graphix.git
cd graphix

# Install dependencies
bun install

# Set up environment
cp .env.example .env

Environment Configuration

# .env

# Database (SQLite for local, Turso for cloud)
STORAGE_MODE=sqlite
DATABASE_URL=file:./graphix.db

# For Turso (optional)
# STORAGE_MODE=turso
# TURSO_DATABASE_URL=libsql://your-db.turso.io
# TURSO_AUTH_TOKEN=your-token

# ComfyUI MCP
COMFYUI_MCP_URL=http://localhost:3001

# Text Generation (optional)
OLLAMA_URL=http://localhost:11434

Database Setup

# Push schema to database
bun run db:push

# Or run migrations
bun run db:migrate

Start Development

# Start everything (recommended)
bun run dev

# Or start individually:
# Terminal 1: API server (port 3002)
cd packages/server && bun run dev

# Terminal 2: UI (port 5173)
cd packages/ui && bun run dev

Open http://localhost:5173 ๐ŸŽ‰

Using with MCP (Claude Code / Claude Desktop)

Graphix exposes 200+ tools via MCP for AI-assisted comic creation.

Option A: Install from npm (recommended)

{
  "mcpServers": {
    "graphix": {
      "command": "npx",
      "args": ["-y", "@graphix/server"],
      "env": {
        "COMFYUI_MCP_URL": "http://localhost:3001"
      }
    }
  }
}

Option B: Run from source (for development)

{
  "mcpServers": {
    "graphix": {
      "command": "bun",
      "args": ["run", "/path/to/graphix/packages/server/src/bin-mcp.ts"],
      "env": {
        "COMFYUI_MCP_URL": "http://localhost:3001"
      }
    }
  }
}

The only required env var is COMFYUI_MCP_URL. SQLite database auto-creates on first run. See docs/MCP.md for the full tool reference and optional configuration.


๐Ÿ“ Project Structure

graphix/
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ core/                     # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ db/               # Drizzle schema & connection
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ services/         # Project, Character, Panel, etc.
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ generation/       # ComfyUI client, ControlNet, LoRA
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ composition/      # Page layout, export
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ utils/            # Security, upload handling
โ”‚   โ”‚   โ””โ”€โ”€ package.json
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ server/                   # API layer
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ rest/             # Hono routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ mcp/              # MCP server
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ openapi/          # OpenAPI spec generation
โ”‚   โ”‚   โ””โ”€โ”€ package.json
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ client/                   # Generated TypeScript client
โ”‚   โ”‚   โ””โ”€โ”€ src/
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ui/                       # React frontend
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ routes/           # TanStack Router pages
โ”‚       โ”‚   โ”œโ”€โ”€ components/       # React components
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/    # Project list, cards
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ characters/   # Character editor, LoRA browser
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ generation-tree/  # D3 visualization
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ panel-generator/  # Panel creation UI
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ page-composer/    # Canvas composition
โ”‚       โ”‚   โ”œโ”€โ”€ api/              # TanStack Query hooks
โ”‚       โ”‚   โ”œโ”€โ”€ stores/           # Zustand stores
โ”‚       โ”‚   โ””โ”€โ”€ theme/            # Design tokens
โ”‚       โ”œโ”€โ”€ e2e/                  # Playwright tests
โ”‚       โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ docs/                         # Planning & documentation
โ”œโ”€โ”€ scripts/                      # Build & deploy scripts
โ””โ”€โ”€ package.json                  # Workspace root

๐Ÿงช Testing

# Run all tests
bun test

# Run by package
cd packages/core && bun test      # 1941 tests
cd packages/server && bun test    # 583 tests
cd packages/ui && bun run test    # 876 tests (Vitest)

# E2E tests
cd packages/ui && bun run test:e2e

# Watch mode
bun test --watch

Test Coverage

Package Tests Coverage
@graphix/core 1,941 Services, generation, composition
@graphix/server 583 REST routes, contract tests
@graphix/ui 876 Stores, hooks, components
Total 3,400 Full stack coverage

๐Ÿ“Š API Documentation

The REST API is fully documented with OpenAPI 3.0. Start the server and visit:

Key Endpoints

Endpoint Description
GET /api/projects List all projects
POST /api/projects Create new project
GET /api/characters List characters for a project
POST /api/panels/:id/generate Generate panel image
GET /api/generations/:panelId Get all generations for a panel
POST /api/composition/export Export page as PDF/PNG

๐ŸŽฏ Roadmap

โœ… M1: Static Graphic Novels (Current)

  • Project & character management
  • Story scaffolding (premise โ†’ beats โ†’ panels)
  • Panel generation with ControlNet
  • Generation tree visualization
  • Page composition & export
  • Full E2E flow validation

๐Ÿ”œ M2: Interactive Panels

  • Click panel โ†’ I2V animation
  • Audio integration
  • Timeline editor

๐Ÿ”ฎ M3: Animated Shorts

  • T2I โ†’ I2V โ†’ V2V pipeline
  • Scene-based workflow
  • Multi-minute video export

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Write tests for your changes
  4. Run the test suite (bun test)
  5. Commit with conventional commits (git commit -m 'feat: add amazing feature')
  6. Push and open a Pull Request

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


๐Ÿ™ Acknowledgments

  • ComfyUI โ€” The backbone of image generation
  • comfyui-mcp โ€” MCP bridge for ComfyUI
  • Hono โ€” Lightning-fast web framework
  • TanStack โ€” Router & Query excellence
  • D3.js โ€” Generation tree visualization
  • Actual artists โ€” Who do the real thing. Hire them.

Built for rapid iteration, not artistic pretension.

๐Ÿดโ€โ˜ ๏ธ ARRR, NOW GO GENERATE SOME MAGNIFICENT SLOP! ๐Ÿดโ€โ˜ ๏ธ

โฌ† Back to top

About

GenAI art + video workflow system - static panels, interactive I2V, animated shorts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors