hjLabs AI Playground

Starting the on-device runtime…

MODNet — remove background running in your browser

MODNet is a 6.5M-parameter ONNX model that predicts an alpha matte separating the subject from the background. On this page it runs entirely inside your browser: the 26 MB download comes straight from the Hugging Face repository “Xenova/modnet” into your browser cache, and every inference after that executes on your own GPU through WebGPU. At this size the download is over before you have finished reading this paragraph, even on a phone tethered to a hotspot, and it costs almost nothing to keep cached alongside a dozen other models.

At a glance

Hugging Face repository
Xenova/modnet
Task
Remove Background
Download size
26 MB
Parameters
6.5M
Precisions
fp32, q8
Monthly downloads
91k
Runs on
WebGPU in your browser (WebAssembly fallback)
Price
Free — your GPU does the work

Only 26 MB and built for portraits — the one to choose on a phone or a slow connection. In practice people reach for a model like this for cutting out product shots and portraits into transparent PNGs, with no credits, watermark or resolution cap.

Available precisions: fp32 (full precision) and q8 (8-bit). fp32 comes first because at this size full precision is both the fastest WebGPU path and the best quality; the quantized variant exists for the WebAssembly fallback and for tight cache budgets. It is this playground's default pick for the task, and Hugging Face records about 91k downloads a month for the repository — a good sign that it is maintained and that the ONNX export is not abandoned.

Because there is no inference server behind this page, there is nothing to rate-limit and nothing to bill: the only cost of running MODNet here is the one-off 26 MB download, and once that is cached the page keeps working with the network switched off.

modnetmodnet onnxmodnet browserrun modnet locallyxenova/modnetremove background modelmodnet webgpumodnet download sizefree remove background modeltransformers.js model

Frequently asked questions

How large is the MODNet download?

About 26 MB for the fp32 build, including the tokenizer and config files the runtime also has to fetch — this is the whole payload, not just the weights file. It is downloaded once and then served from the browser Cache Storage API.

Can MODNet run without a GPU?

Yes, through the WebAssembly fallback, which is slower but works anywhere. WebGPU (Chrome or Edge 113+, Safari 26+) is what makes it feel interactive. On WASM, prefer the smaller quantized build.

Do I need a Hugging Face token or an API key?

No. Xenova/modnet is a public repository, so your browser fetches the ONNX files directly over HTTPS. There is no account, no key and no server in between.

Is my data uploaded to a server?

No. The model weights are downloaded from Hugging Face to your browser once, and every inference after that runs on your own GPU through WebGPU. Your text, images and audio are never sent anywhere — hjLabs.in has no inference server and no way to see your input.