Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsMoving AI image models into the browser broke three things in one developer’s project, and none of the failures threw an error that pointed at the real cause. A background-removal model that won an offline comparison could not run on the target GPU. An inpainting model returned a successful, correctly shaped tensor whose hole was nearly white. A super-resolution model’s half-precision output rendered as a black image because the code read the numbers in the wrong representation.
The account comes from a first-person DEV Community post by alex.toolkit, published September 28, 2026. The author rebuilt a retired photo-editing site so that object removal, background removal and 4× upscaling run client-side through ONNX Runtime Web, using WebGPU with a WebAssembly (WASM) fallback. Every measurement below is the author’s observation from that one implementation, not an independent benchmark.
As an Amazon Associate I earn from qualifying purchases.
What the author was building
The site offers three tools: object removal (LaMa), background removal (a choice between BiRefNet-lite and RMBG-1.4) and 4× upscaling (Real-ESRGAN x4plus). Each model runs in the visitor’s browser, so no image is uploaded for processing. The architecture is the point of the project, and each failure below is a consequence of running the models in that environment rather than on a server.
Recommended Free Tools
Failure 1: the better background model would not run
The author’s offline comparison on ten images favored BiRefNet-lite over RMBG-1.4, and BiRefNet-lite is MIT-licensed according to the post. In the browser, the preferred model failed on its first session.run() on an Apple GPU. The error read:
#1 Best Overall
- EVOLUTION AMD RYZEN AI MAX+ 395 MINI PC - GMKtec EVO-X2 is the next evolution in AI mini PC Ryzen Strix Halo series. Thanks to AMD Simultaneous Multithreading (SMT) the core-count is effectively doubled, to 32 threads. Ryzen AI Max+ 395 has 64 MB of L3 cache and can boost up to 5.1 GHz, depending on the workload. The Ryzen AI Max+ 395 is currently rated as the "most powerful x86 APU" on the market for AI computing.
- AI NPU with XDNA 2 ARCHITECTURE - Powered by 16 “Zen 5” CPU cores, 50+ peak AI TOPS XDNA 2 NPU and a truly massive integrated GPU driven by 40 AMD RDNA 3.5 CUs, the Ryzen AI MAX+ 395 is a transformative upgrade and delivers a significant performance boost over the competition. The Ryzen AI Max+ 395 excels in consumer AI workloads like the llama.cpp-powered application: LM Studio. Shaping up to be the must-have app for client LLM workloads, LM Studio allows users to locally run the latest language model without any technical knowledge required and unleash their creativity and productivity.
- AMD RADEON 8090S iGPU GAMING PC - The AMD Radeon RX 8060S offers all 40 CUs with up to 2.9 GHz graphics clock and uses the new RDNA 3.5 architecture. The powerful iGPU is positioned between an RTX 4060 and 4070 laptop GPU and therefore enables gaming in FHD at maximum details in most demanding games. The 8060S can also utilize the full 128GB pool, which is perfect for running LLMs such as Deepseek 70B Q8, which runs comfortably on this machine.
- EIGHT CHANNEL LPDDR5X - LPDDR5X is a new ground breaking memory small form factor installed on-board. With blazing speeds up to to 8000MT/s, it runs 1.5x faster than the DDR5 SODIMMs; 90% better performance over DDR5 SODIMMs in video conferencing and photo editing; 30% better performance in productivity apps; 12% better performance in digital content workloads.
- QUAD SCREEN 8K DISPLAY SUPPORT - EVO-X2 AI Mini PC support 4-screen 4K/8K output via HDMI 2.1 (8K@60Hz), DisplayPort 1.4 (4K@60Hz), and dual USB 4 40Gbps Transfer speed (supporting PD3.0/DP1.4/DATA). Ideal for gaming, video editing, and multitasking, it provides expansive and crisp multi-display support.
Too many storage buffers in shader. Current: 11, Max is 10
The author explains that the target exposed a maximum of ten storage buffers per shader stage, while the fused kernel that ONNX Runtime generated for this graph needed eleven. Reducing graph optimization did not resolve it. The WASM route did not rescue the model either: it failed with std::bad_alloc, because the 1024×1024 transformer activations did not fit in the 4 GB wasm32 heap the author cites. BEN2, which the author also tried, failed in a similar way.
The speed gap that favored the smaller model
RMBG-1.4 ran in roughly 0.25 seconds on WebGPU and about 6 seconds on WASM in the author’s setup. Those are project timings on the author’s hardware, and they are useful mainly as a sense of scale: the WebGPU path was about 24 times faster in that one test, but the WASM path was still usable for a single image.
The lesson the author draws
Model quality is measured on a workstation, but the browser imposes its own limits on buffers, memory and kernels. The author’s advice is to benchmark candidate models in the target browser on the weakest GPU the project intends to support, before comparing output quality.
Rank #2
- Built for Local AI Development: AMD Ryzen AI Halo is designed for local AI development and inference, featuring 128GB unified memory and support for up to 200B parameter models to build and run intensive AI workloads locally.
- 128GB Unified Memory: Features 128GB LPDDR5x unified memory at 8000 MT/s with 256 GB/s memory bandwidth, providing a shared memory pool across the CPU, GPU, and NPU to support larger AI models.
- AMD Ryzen AI Max+ 395 Processor: Features 16 cores, 32 threads, and Zen 5 architecture, paired with AMD Radeon 8060S integrated graphics featuring 40 RDNA 3.5 compute units and an AMD XDNA 2 NPU with up to 50 TOPS.
- Linux AI Developer Platform: Purpose-built for Linux-based AI development with full AMD ROCm software support and preloaded tools, models, and workflows optimized for local AI development.
- Compact, Connected Design: Includes a 2TB M.2 SSD, 10GbE LAN, Wi-Fi 7, Bluetooth 5.4, USB-C connectivity, and HDMI 2.1b.
Failure 2: LaMa finished and returned a wrong picture
LaMa ran on WebGPU without raising an exception. Its output had the expected shape and values in the 0–255 range. The inpainted area was almost white, which is not what object removal should produce. The author’s measurements were:
- WebGPU: hole mean 254.3, outside-hole mean 127.0
- WASM: hole mean 107.3, outside-hole mean 127.0
The author attributes the discrepancy to LaMa’s Fourier convolutions (RFFT and IRFFT) producing wrong values through the WebGPU execution provider in this setup. The more important point is about detection. The fallback chain switched to WASM only when an exception was thrown, so it never fired. The author routed LaMa to WASM directly and changed the end-to-end tests to inspect pixel colors in real outputs, instead of checking that the call succeeded.
Failure 3: fp16 output turned the upscale black
Real-ESRGAN x4plus takes and returns half-precision (fp16) data. The initial code encoded inputs into a Uint16Array and decoded outputs by treating each value as raw half-float bits. The author reports that when Chrome exposed native Float16Array support, ONNX Runtime Web returned fp16 outputs as ordinary numbers. Reading those ordinary numbers as bit patterns produced a black image.
Rank #3
- EVOLUTION RYZEN AI MAX+ 395 MINI PC - GMKtec EVO-X2 is the next evolution in AI mini PC Ryzen Strix Halo series. Thanks to AMD Simultaneous Multithreading (SMT) the core-count is effectively doubled, to 32 threads. Ryzen AI Max+ 395 has 64 MB of L3 cache and can boost up to 5.1 GHz, depending on the workload. The Ryzen AI Max+ 395 is currently rated as the "most powerful x86 APU" on the market for AI computing.
- AI NPU with XDNA 2 ARCHITECTURE - Powered by 16 “Zen 5” CPU cores, 50+ peak AI TOPS XDNA 2 NPU and a truly massive integrated GPU driven by 40 AMD RDNA 3.5 CUs, the Ryzen AI MAX+ 395 is a transformative upgrade and delivers a significant performance boost over the competition. The Ryzen AI Max+ 395 excels in consumer AI workloads like the llama.cpp-powered application: LM Studio. Shaping up to be the must-have app for client LLM workloads, LM Studio allows users to locally run the latest language model without any technical knowledge required and unleash their creativity and productivity.
- AMD RADEON 8090S iGPU GAMING PC - The AMD Radeon RX 8060S offers all 40 CUs with up to 2.9 GHz graphics clock and uses the new RDNA 3.5 architecture. The powerful iGPU is positioned between an RTX 4060 and 4070 laptop GPU and therefore enables gaming in FHD at maximum details in most demanding games. The 8060S can also utilize the full 128GB pool, which is perfect for running LLMs such as Deepseek 70B Q8, which runs comfortably on this machine.
- EIGHT CHANNEL LPDDR5X - LPDDR5X is a new ground breaking memory small form factor installed on-board. With blazing speeds up to to 8000MT/s, it runs 1.5x faster than the DDR5 SODIMMs; 90% better performance over DDR5 SODIMMs in video conferencing and photo editing; 30% better performance in productivity apps; 12% better performance in digital content workloads.
- QUAD SCREEN 8K DISPLAY SUPPORT - EVO-X2 AI Mini PC support 4-screen 4K/8K output via HDMI 2.1 (8K@60Hz), DisplayPort 1.4 (4K@60Hz), and dual USB 4 40Gbps Transfer speed (supporting PD3.0/DP1.4/DATA). Ideal for gaming, video editing, and multitasking, it provides expansive and crisp multi-display support.
The fix was to accept both representations: bit patterns from a Uint16Array and plain numeric values. Because the representation depends on browser and runtime support, code that works in one browser can fail silently in another.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11The WebGPU shape error
The same model also raised Shape mismatch attempting to re-use buffer on WebGPU. The author resolved it by pinning the symbolic dimensions (N: 1, H: 192, W: 192) and processing the image in fixed-size tiles, so every buffer had a stable shape.
The three failures side by side
| Failure | Visible symptom | Why no error was raised | Author’s fix |
|---|---|---|---|
| Background model (BiRefNet-lite) | Session run failed on an Apple GPU with a storage-buffer limit error (11 needed, 10 allowed) | The error was explicit, but it named a limit rather than a model problem | Not stated as fixed; the author did not run the model in the browser and switched to a model that fits |
| LaMa on WebGPU | Inpainted hole almost white (hole mean 254.3 vs. 107.3 on WASM) | The call succeeded, so the exception-only fallback never triggered | Routed LaMa to WASM; tests inspect pixel colors |
| Real-ESRGAN x4plus fp16 | Black upscaled image in Chrome with native Float16Array support | Outputs were valid numbers, but were decoded as bit patterns | Accept both Uint16Array bit patterns and numeric values |
Delivery choices the author reports
The post also describes how the site handles downloads and hosting. Model and runtime loading wait until the visitor consents, and the download size is shown before the first task starts. Models are cached in Cache Storage after download. Large model files exceed a 25 MB host limit, so the author splits them into chunks of at most 20 MiB, verifies each chunk with SHA-256, joins them in a worker and passes the resulting WebAssembly binary to ONNX Runtime. The editor runs on a separate origin with connect-src 'self' and is embedded in the content site through an iframe.
Rank #4
These are design decisions the author chose and describes. They are not an independent security or privacy audit of the live site.
A checklist for browser-based image models
- Test each candidate model in the target browser on the weakest GPU and memory profile you plan to support, and record which runtime path it actually uses.
- Treat a failed
session.run()as a model-specific result. Check the error for buffer, shader or heap limits before changing the model code. - Do not treat a resolved promise or a correctly shaped tensor as a pass. Check representative output pixels against expected values, including the masked region for inpainting.
- Make the fallback trigger on wrong results as well as exceptions, or run a known-good test image on the active path at startup.
- Check how the runtime returns fp16 data in each browser you support, and handle both
Uint16Arraybit patterns and plain numbers. - Pin symbolic dimensions and tile large images when a WebGPU buffer-reuse error appears.
What this account does and does not establish
This is one developer’s account of one implementation. The Apple GPU limits, the ten-image comparison set, the timings and the 4 GB wasm32 heap all describe that setup and its particular browser and runtime versions. The author does not claim that every Apple GPU, browser or ONNX Runtime release behaves the same way, and neither should readers. The useful transferable lesson is the method: check the real target environment and the real output, because a successful run and a plausible-looking shape do not prove that the model produced a correct image.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




