Briefing

Moebius Inpainting Model Ported to Browser with ONNX Runtime Web

ai-dev
Claude

Deploy the Moebius web demo by hosting the UI on GitHub Pages and the ONNX weights on Hugging Face, and ensure CacheStorage is used to cache the 1.3 GB model.

What to do now

Host the UI on GitHub Pages, upload the ONNX weights to Hugging Face, and configure a service worker to cache the model weights for efficient browser loading.

Summary

The Moebius 0.2B lightweight image inpainting model, originally requiring PyTorch and CUDA, was ported to run in a browser using ONNX Runtime Web on WebGPU. Claude Code was used to convert the model to ONNX, build a web UI, and implement caching with the CacheStorage API to avoid re‑downloading the ~1.3 GB weights on each load. The demo is hosted at simonw.github.io/moebius-web and demonstrates real‑time inpainting with a "Run inpaint" button.

The project involved cloning the original repo, downloading weights from Hugging Face, using transformers.js and onnxruntime, and iterating with Claude Code. The final deployment uses GitHub Pages for the UI and Hugging Face Spaces for the model weights, with a service worker to cache the model weights for efficient browser loading.

Key changes

  • Ported Moebius 0.2B inpainting model to ONNX Runtime Web on WebGPU
  • Built a browser UI using Claude Code and Pyodide
  • Implemented caching via CacheStorage API to avoid re‑downloading ~1.3 GB weights
  • Hosted UI on GitHub Pages and weights on Hugging Face Spaces
  • Used transformers.js and onnxruntime for model inference
  • Demonstrated real‑time inpainting in the browser
  • Developed a GitHub Actions workflow to build and deploy the demo
  • Provided a service worker to cache model weights

Affects

internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting