Skip to content

AI-powered design application for transforming sketches into photorealistic renders using ComfyUI.

Notifications You must be signed in to change notification settings

IngeniaWorks/openviz

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenViz ๐ŸŽจ

OpenViz Interface

OpenViz is an AI-powered design application that transforms hand-sketched drawings and imported images into photorealistic renders using advanced text-to-image models. Built with a modern, intuitive workflow, it seamlessly bridges creative sketching with AI generation.

โœจ Features

๐ŸŽจ Studio โ€” The Creative Canvas

A focused, high-performance workspace for sketching and AI generation.

Drawing Tools

  • Brush & Eraser โ€” Configurable size, opacity, hardness, and stabilizer
  • Shape Tools โ€” Rectangles, circles, and lines with stroke/fill options
  • Paint Bucket โ€” Quick fills with tolerance control
  • Transform โ€” Move, scale, and rotate objects after placement
  • Keyboard Shortcuts โ€” B brush, E eraser, R rect, O circle, L line, S select

Layer System

  • Full layer management with reorder, rename, hide, delete
  • Real-time thumbnails for every layer
  • Opacity and blend modes (Normal, Multiply, Screen, Overlay)
  • Support for sketch, image, and render layers
  • Copy/paste layers between projects

Canvas

  • Smooth zoom (10%โ€“500%) and pan
  • Viewport controls with fit-to-screen
  • Grid and symmetry guides
  • Background color customization

AI Rendering

  • ComfyUI Integration โ€” Connect to local ComfyUI for generation
  • Style Presets โ€” Switch between Photorealistic, Cyberpunk, Watercolor, and more
  • Reference Images โ€” Upload reference images to guide generation
  • Influence Slider โ€” Balance between sketch adherence and prompt creativity
  • Batch Generation โ€” Generate 1โ€“4 variations at once
  • Results Gallery โ€” Browse, compare, and add renders to layers or workbench

๐Ÿ› ๏ธ Workbench โ€” Node-Based Flow

A powerful visual editor for managing complex projects with multiple assets.

Node Types

  • Image Nodes โ€” Sketch canvases with full Studio integration
  • Animate Nodes โ€” Keyframe-based animation with AI interpolation
  • Video Nodes โ€” Video processing and generation pipelines
  • Render Nodes โ€” AI render settings and batch configurations

Flow Features

  • Visual Connections โ€” Wire nodes together to create processing pipelines
  • Drag & Drop โ€” Add new sketches with preset formats (Square, A4, 16:9, etc.)
  • Context Menu โ€” Right-click nodes for copy, paste, duplicate, delete, and layer ordering
  • Batch Operations โ€” Select and move multiple nodes
  • Smart Navigation โ€” Auto-center on nodes when switching from Studio

๐Ÿ“Š Dashboard โ€” Project Management

Your central hub for organizing creative work.

Project Browser

  • Grid and list view layouts
  • Sort by last viewed, name, or creation date
  • Search and filter projects
  • Thumbnail previews

Quick Actions

  • Create new projects in Studio or Workbench mode
  • Jump directly to recent work
  • Persistent project state across sessions

๐Ÿ” Authentication

  • GitHub OAuth โ€” Sign in with your GitHub account
  • Google OAuth โ€” Sign in with Google
  • Email โ€” Passwordless magic link login (optional)
  • Development Mode โ€” Quick dev login for local testing

๐Ÿš€ Getting Started

Prerequisites

Environment Setup

  1. Clone the repository

    git clone https://github.com/Sander-HR/openviz.git
    cd openviz
  2. Install dependencies

    npm install
  3. Configure environment

    cp .env.example .env

    Edit .env with your credentials:

    # Database
    DATABASE_URL=postgresql://user:password@localhost:5432/openviz
    
    # Redis (for BullMQ job queues)
    REDIS_URL=redis://localhost:6379
    
    # NextAuth
    NEXTAUTH_URL=http://localhost:3000
    NEXTAUTH_SECRET=your-secret-key-here
    
    # OAuth (optional)
    GITHUB_ID=your-github-client-id
    GITHUB_SECRET=your-github-client-secret
    GOOGLE_CLIENT_ID=your-google-client-id
    GOOGLE_CLIENT_SECRET=your-google-client-secret
    
    # AWS S3 (for asset storage)
    AWS_REGION=us-east-1
    AWS_ACCESS_KEY_ID=your-access-key
    AWS_SECRET_ACCESS_KEY=your-secret-key
    AWS_BUCKET_NAME=your-bucket-name
    
    # ComfyUI
    COMFYUI_URL=http://localhost:7821
  4. Initialize database

    npm run db:push
  5. Launch ComfyUI

    # In your ComfyUI directory
    python main.py --listen --port 7821

    Required Models:

    • Checkpoints: sd3.5_large_fp8_scaled.safetensors โ†’ ComfyUI/models/checkpoints/
    • ControlNet: sd3.5_large_controlnet_canny.safetensors โ†’ ComfyUI/models/controlnet/
  6. Start development server

    npm run dev
  7. Open in browser

    http://localhost:3000
    

๐Ÿ—๏ธ Architecture

OpenViz follows a modern, modular architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Presentation Layer                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    Dashboard    โ”‚     Studio      โ”‚       Workbench         โ”‚
โ”‚  (Project Mgmt) โ”‚ (Canvas Editor) โ”‚   (Node Flow Editor)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    State Layer     โ”‚
                    โ”‚    (Zustand)       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                     โ”‚                     โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Next.js API   โ”‚  โ”‚   ComfyUI Proxy    โ”‚  โ”‚    S3       โ”‚
โ”‚   (tRPC/REST)  โ”‚  โ”‚    (WebSocket)     โ”‚  โ”‚  (Assets)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚                     โ”‚                     โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Data & Infrastructure                        โ”‚
โ”‚     PostgreSQL    โ”‚    Redis    โ”‚    BullMQ Jobs         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Tech Stack

Category Technology Purpose
Framework Next.js 16 App Router, SSR, API routes
Language TypeScript Type safety
Styling Tailwind CSS Utility-first CSS
UI Components Radix UI Accessible primitives
State Zustand Global state management
Animation Framer Motion Transitions & gestures
Canvas Konva.js + React-Konva 2D drawing engine
Node Editor React Flow Visual flow editor
Auth NextAuth.js Authentication
ORM Drizzle ORM Database queries
Database PostgreSQL Data persistence
Queue BullMQ + Redis Job processing
Storage AWS S3 Asset storage
AI ComfyUI Image generation
Testing Vitest + React Testing Library Unit tests

๐Ÿ“ Project Structure

openviz/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                 # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ api/            # API routes (NextAuth, projects, jobs, generate)
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/      # Dashboard page
โ”‚   โ”‚   โ”œโ”€โ”€ login/          # Authentication page
โ”‚   โ”‚   โ”œโ”€โ”€ projects/[id]/  # Project workspace
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx      # Root layout
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx        # Landing/redirect
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/      # Dashboard components
โ”‚   โ”‚   โ”œโ”€โ”€ studio/         # Studio canvas UI
โ”‚   โ”‚   โ”œโ”€โ”€ workbench/      # Workbench node editor
โ”‚   โ”‚   โ”œโ”€โ”€ nodes/          # React Flow node components
โ”‚   โ”‚   โ””โ”€โ”€ common/         # Shared components
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ store/              # Zustand state management
โ”‚   โ”‚   โ”œโ”€โ”€ slices/         # State slices (layer, tool, render, workbench)
โ”‚   โ”‚   โ”œโ”€โ”€ useStore.ts     # Main store hook
โ”‚   โ”‚   โ””โ”€โ”€ storeTypes.ts   # TypeScript types
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ services/           # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ ai/            # Workflow registry, prompt handling
โ”‚   โ”‚   โ”œโ”€โ”€ renderService.ts
โ”‚   โ”‚   โ””โ”€โ”€ apiRenderService.ts
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ lib/               # Utilities & config
โ”‚   โ”‚   โ”œโ”€โ”€ auth.ts        # NextAuth configuration
โ”‚   โ”‚   โ”œโ”€โ”€ db/schema.ts   # Drizzle schema
โ”‚   โ”‚   โ””โ”€โ”€ services/      # S3, job services
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ hooks/             # Custom React hooks
โ”‚   โ”œโ”€โ”€ types/             # Global TypeScript types
โ”‚   โ””โ”€โ”€ utils/             # Utility functions
โ”‚
โ”œโ”€โ”€ public/                # Static assets
โ”œโ”€โ”€ drizzle/               # Database migrations
โ””โ”€โ”€ tests/                 # Test files

๐Ÿงช Available Scripts

# Development
npm run dev           # Start Next.js dev server
npm run db:studio     # Open Drizzle Studio (DB GUI)

# Build
npm run build         # Production build
npm start            # Start production server

# Database
npm run db:push       # Push schema changes to DB
npm run db:generate   # Generate migration files

# Testing
npm run test          # Run Vitest tests
npm run test:ui       # Open Vitest UI

# Code Quality
npm run lint          # Run ESLint

๐Ÿ›ฃ๏ธ Roadmap

โœ… Completed

  • Studio Mode โ€” Full canvas with drawing tools and layer system
  • Workbench Mode โ€” Node-based flow editor with multiple node types
  • Dashboard โ€” Project management with authentication
  • ComfyUI Integration โ€” Real-time AI rendering
  • Undo/Redo โ€” Full history management
  • Keyboard Shortcuts โ€” Tool switching and actions
  • Batch Generation โ€” Generate multiple variations

๐Ÿšง In Progress

  • Animate Mode โ€” Full animation pipeline with interpolation
  • Video Generation โ€” AI video synthesis workflows
  • Workflow Presets โ€” Save/load custom ComfyUI workflows
  • Import/Export โ€” PNG/JPG export and .openviz project files
  • Collaboration โ€” Real-time multi-user editing

๐Ÿ”ฎ Future

  • AI Prompt Assistant โ€” Auto-suggest prompts based on sketches
  • Mobile App โ€” Touch-optimized iOS/Android companion
  • Cloud Sync โ€” Cross-device project synchronization
  • Plugin System โ€” Third-party workflow extensions
  • Template Marketplace โ€” Community-contributed templates

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • ComfyUI for the amazing AI generation backend
  • Konva.js for the powerful canvas library
  • React Flow for the node-based editor
  • All the open-source contributors who make this project possible

Made with โค๏ธ by the OpenViz Team

About

AI-powered design application for transforming sketches into photorealistic renders using ComfyUI.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.3%
  • Other 0.7%