How richardawe/sketchgpt works
sketchgpt is a browser-based picture-book and drawing app, with an optional Ollama-backed chat page for local development. The main visitor workflow is to enter an idea, have an in-browser model write a story and picture plans, then apply page-side continuity and scene rules to render and download an illustrated book. Sketch mode separately turns a description into a validated SVG. README documents device-aware model selection, offline caching, selfie and sharing capabilities; those branches are included where the tree supports them. Source excerpts are partial, so links between unsampled app modules are limited to documented behavior.
Main entry points: browser.html Browser app · book.mjs Book mode · sketch.mjs SVG drawing · index.html Ollama chat
Components 17
Browser runtime
- Browser app
web/browser.html - WebLLM model
- Offline worker
web/sw.js
Book and drawing
- Book mode
web/book.mjs - Scene planning
web/scene.mjs - SVG drawing
web/sketch.mjs - Illustration assets
web/art.mjs - Stamp assets
web/stamps.mjs - Book animation
web/animate.mjs
Creative tools
- Selfie caricature
web/face.mjs - Face detection
web/face-find.mjs - Book sharing
web/share.mjs
Local chat
- Ollama chat
web/index.html
Other components
- Visitor
- Model CDN
- Browser cache
- Ollama service
Connections 21
- Visitor → Browser app: opens
- Browser app → WebLLM model: runs inference
- WebLLM model → Model CDN: downloads weights
- WebLLM model → Browser cache: caches weights
- Offline worker → Browser cache: serves cached app
- Browser app → Offline worker: registers
- Browser app → Book mode: dispatches Book
- Book mode → WebLLM model: requests story and plans
- Book mode → Scene planning: plans pictures
- Book mode → SVG drawing: renders pages
- Scene planning → SVG drawing: resolves stamps
- SVG drawing → Illustration assets: draws illustrations
- SVG drawing → Stamp assets: uses icons
- Book mode → Visitor: offers book export
- Book animation → Book mode: reads book data
- Browser app → Selfie caricature: dispatches selfie
- Selfie caricature → Face detection: uses face landmarks
- Browser app → Book sharing: dispatches sharing
- Browser app → Ollama chat: opens local chat
- Ollama chat → Ollama service: sends chat requests
- Ollama service → Ollama chat: streams replies