Guides · How it works
WebGPU vs WebAssembly: which setting to use for in-browser AI
What the CPU (WebAssembly) and GPU (WebGPU) settings actually do, why WebAssembly is the default, when WebGPU is faster, and how to troubleshoot slow or failed processing.
By the developer of ImgCutout · Published · 4 min read
In the tool's Settings there is a choice between CPU / WASM (most compatible) and GPU / WebGPU (faster, if supported, falls back to CPU). Both run the same AI model on your own device, and both produce essentially the same result. The difference is which part of your computer does the work. This article explains the two options, why WebAssembly is the default, and how to choose.
WebAssembly: fast code on your CPU
WebAssembly (WASM) is a compact binary format that browsers can run at close to native speed. ONNX Runtime, the engine that executes the AI model, is compiled to WebAssembly, so the same engine that runs on servers can run inside a browser tab on your CPU.
Modern WebAssembly supports SIMD (processing several numbers in one instruction) and multithreading (using several CPU cores), both of which speed up neural networks considerably. Browsers enable multithreading only on pages that are configured for it securely, and the engine falls back to a single thread otherwise.
Strengths: works in every modern browser, on every device, with predictable memory use and well-tested numerical behavior.
Weakness: a CPU, even with SIMD and several cores, does far fewer operations in parallel than a GPU.
WebGPU: your graphics card, from the browser
WebGPU is a newer browser API that gives web pages access to the graphics card for both rendering and general computation. Neural networks are mostly large matrix multiplications, which GPUs are built to do in parallel, so on a capable GPU the model can run several times faster than on the CPU.
Strengths: much faster on computers with a decent GPU, especially for the larger 16-bit and 32-bit models.
Weaknesses: not available everywhere; the first run includes compiling GPU programs (shaders), which adds a delay; driver differences between GPUs can occasionally cause failures or tiny numerical differences; and GPU memory on integrated graphics is shared with the rest of the system.
Browser support
WebGPU is supported in recent desktop versions of Chrome and Edge, and support has been rolling out in Safari and Firefox and on mobile. Availability also depends on your operating system and graphics driver: a browser that supports WebGPU may still disable it on hardware with known driver issues. MDN's WebGPU page, linked below, has an up-to-date compatibility table.
Why WebAssembly is the default
The default is the option that works for everyone. WebAssembly runs on every phone, tablet, and computer the tool supports, uses less memory, and has fewer surprises. Since the default model is the compact 8-bit version, CPU speed is usually good enough: a few seconds per photo on a typical laptop.
WebGPU is offered as an opt-in. When you choose it, ONNX Runtime first tries to initialize WebGPU and automatically falls back to WebAssembly if your browser or GPU does not support it or initialization fails. You do not risk a broken tool by trying it.
When to switch to WebGPU
WebGPU is worth trying if:
- You have a desktop or laptop with a dedicated graphics card, or a recent Apple Silicon Mac.
- You process many images, for example in the bulk tool, and a second or two per image adds up.
- You use the larger 16-bit or 32-bit model, which is much heavier for the CPU.
On phones, tablets, and devices with 4GB of memory or less, the option is not offered at all: those devices always use CPU / WASM and the 8-bit model, to stay within the browser's memory limits. WebGPU is also rarely worth it on older laptops with basic integrated graphics, or when you only process the occasional photo.
How to compare on your own device
- Open Settings, keep CPU / WASM selected, and process a photo once to warm up (the first run includes loading the model).
- Process a second photo and note roughly how long it takes.
- Switch to GPU / WebGPU, process one photo to warm up (shader compilation), then time a second photo.
- Keep whichever is faster for you.
If the result with WebGPU ever looks different or broken (for example, an empty or noisy mask), switch back to CPU / WASM. That points to a driver issue, not a problem with your photo.
Troubleshooting slow or failed processing
- The first image is slow: expected. The model downloads once, then loads from your browser cache.
- Everything is slow on a phone: close other tabs and apps, and try a smaller photo. Very large photos need a lot of memory.
- Processing fails on large photos: export a smaller JPG (for example 4000 pixels on the longest side) and try again. See reducing image file size.
- WebGPU option seems to have no effect: your browser may not expose WebGPU, so the tool fell back to CPU. That is fine.
- The page feels sluggish while processing: both tools run the model in a background worker so the page stays usable, but on slow devices with little memory the whole browser can still slow down. Close other tabs and apps.
Privacy is the same either way
Both options run entirely on your device. WebGPU uses your graphics card, not a cloud GPU, so switching does not change what leaves your device: nothing. See how to check that your images are never uploaded.
Summary
WebAssembly runs the model on your CPU and works everywhere, which is why it is the default. WebGPU runs it on your graphics card and can be considerably faster on capable hardware, with an automatic fallback to WebAssembly if it is not available. Try WebGPU on a desktop with a good GPU or for large batches, and keep WebAssembly on phones and older machines.
Try it on your own photo
Free, no sign-up, and processed on your device. Nothing is uploaded.
Open the background removerOfficial sources (last checked October 2, 2026)
Rules change. If you spot something out of date, please let us know.