How lxfater/inpaint-web works
Inpaint-web is a browser-based image restoration and upscaling application using ONNX models with WebGPU/WASM execution. Users select or drop an image, edit a mask in the editor, run inpainting or super-resolution, review edits, and download results. The graph includes documented modification history and the separate model-download/cache and runtime-capability layers. Relationships are limited to imports and calls visible in excerpts, the source index, or README; unsampled implementation details are not inferred.
Main entry points: App.tsx App screen · Editor.tsx Canvas editor · cache.ts Model cache · inpainting.ts Inpainting
Components 16
Application flow
- React entry
src/index.tsx - App screen
src/App.tsx - Image selection
src/components/FileSelect.tsx
Image editing
- Image utilities
src/utils.ts - Canvas editor
src/Editor.tsx - Edit history
src/Editor.tsx
Model inference
- Inpainting
src/adapters/inpainting.ts - Super-resolution
src/adapters/superResolution.ts - Model cache
src/adapters/cache.ts - Runtime detection
src/adapters/util.ts
Interface components
- Button control
src/components/Button.tsx - Slider control
src/components/Slider.tsx - Modal display
src/components/Modal.tsx - Progress display
src/components/Progress.tsx
Other components
- Image user
- ONNX Runtime CDN
Connections 24
- Image user → App screen: opens
README.md - React entry → App screen: renders
src/index.tsx - App screen → Image selection: renders
src/App.tsx - App screen → Image utilities: resizes
src/App.tsx - App screen → Canvas editor: renders
src/App.tsx - Image selection → App screen: selects image
src/App.tsx - Canvas editor → Inpainting: runs inpainting
src/Editor.tsx - Canvas editor → Super-resolution: runs upscale
src/Editor.tsx - Canvas editor → Edit history: maintains
README.md - Canvas editor → Image utilities: loads and downloads
src/Editor.tsx - Canvas editor → Button control: renders
src/Editor.tsx - Canvas editor → Slider control: renders
src/Editor.tsx - App screen → Button control: renders
src/App.tsx - App screen → Modal display: renders
src/App.tsx - App screen → Progress display: renders
src/App.tsx - Canvas editor → Modal display: renders
src/Editor.tsx - Canvas editor → Progress display: renders
src/Editor.tsx - App screen → Model cache: downloads model
src/App.tsx - Inpainting → Model cache: ensures model
src/adapters/inpainting.ts - Super-resolution → Model cache: ensures model
src/adapters/superResolution.ts - Inpainting → Runtime detection: checks runtime
src/adapters/inpainting.ts - Super-resolution → Runtime detection: checks runtime
src/adapters/superResolution.ts - Runtime detection → ONNX Runtime CDN: loads runtime
src/adapters/util.ts - Model cache → Image user: fetches model
src/adapters/cache.ts