Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Three Things That Broke When I Moved AI Image Models into the Browser

A developer moving background removal, LaMa inpainting and Real-ESRGAN upscaling into the browser hit a GPU buffer limit, silent wrong pixels and an fp16 decoding bug. Here is what broke and how to test for it.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Moving 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
GMKtec AI Mini PC Ryzen Al Max+ 395 (up to 5.1GHz) Mini Gaming Computers
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
AMD Ryzen™ AI Halo - Personal AI Desktop Computer - Developer Platform - Linux OS
  • 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
GMKtec EVO-X2 AI Mini PC Ryzen Al Max+ 395 Superchip 128GB LPDDR5X 2TB SSD
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The 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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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 Uint16Array bit 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.