source: simon willison: porting the moebius 0.2b image inpainting model to run in the browser with claude code

level: technical

simon willison ported the moebius 0.2b image inpainting model to run entirely in a web browser. the original model required pytorch and nvidia cuda, but he used claude code to convert it to onnx and build a webgpu-powered demo. the tool lets users open an image, mark regions to remove, and have the model fill them in. the entire process was done through agentic coding, with willison providing high-level direction and testing while claude handled code generation and debugging.

the project began with research into feasibility, using claude to explore options like onnx runtime web. willison prepared source code and model weights in a temporary directory, then instructed claude code to port the model and build a simple ui. claude converted the pytorch model to onnx, published the 1.24gb weights to hugging face, and created a github pages frontend. caching was added via the cachestorage api to avoid re-downloading weights on each page load.

the demo works in chrome, firefox, and safari, showing that client-side inpainting is possible with a 1.3gb download. willison noted that this approach limited his learning about the underlying technologies, but he later used claude to generate an explanation of onnx and the conversion process. the project highlights how coding agents can handle complex tasks like model conversion and web deployment with minimal human intervention.

why it matters: this shows that small inpainting models can run locally in browsers, enabling privacy-preserving image editing without server costs.


source: simon willison: porting the moebius 0.2b image inpainting model to run in the browser with claude code