Most browser-based video upscalers aren't actually browser-based. They upload your video to a backend GPU, queue it up, and send back a file. For personal clips or old family footage, uploading to a random site feels wrong, and waiting on upload bandwidth gets old fast.
When building ToHD, I wanted the free version to run entirely on the user's own GPU inside a browser tab: no install, no signup, no watermark, and the file stays on disk.
I extracted the core in-browser pipeline into a small MIT repository: webgpu-video-upscaler. It's 3 TypeScript files on top of Mediabunny and ONNX Runtime Web.
Quick note on licensing so there's no confusion: the in-browser AI pipeline is MIT, and the model weights keep Real-ESRGAN's BSD 3-Clause license. The ToHD website itself, its Fast mode, and the optional paid cloud service are not open source.
How the pipeline actually works in a tab
Each frame goes through five steps inside the browser:
- Mediabunny decodes the frame and draws it to a canvas (this also handles rotation metadata from phone videos).
- The canvas pixels are turned into a tensor.
- ONNX Runtime Web runs Real-ESRGAN (
realesr-general-x4v3) over the whole frame in a single pass using the WebGPU backend. No tiling. - The 4x frame is resized to the target output (e.g. 1080p or 4K).
- Mediabunny encodes back to H.264, copies the original audio track untouched, and streams the MP4 into the browser's private file storage (OPFS) so long videos don't blow up tab RAM.
One nice side effect: decoding and encoding take almost no time compared to GPU inference. Measuring 3 frames up front gives a reliable estimate for the whole clip on whatever machine the user happens to be using.
The shader-f16 surprise (benchmarks)
I benchmarked the pipeline on an Apple M2 Max in a Chromium browser (Nov 8, 2026):
| Input | Output | fp16 (shader-f16) |
fp32 fallback |
|---|---|---|---|
| 360p | 720p | 206 ms/frame | 1,067–1,765 ms/frame |
| 360p | 1080p | 200 ms/frame | not measured |
| 480p | 1080p | 360 ms/frame | not measured |
| 720p | 1080p | 830–870 ms/frame | not measured |
At 30 fps, upscaling a 30-second 360p clip to 720p took about 3 minutes.
The biggest takeaway was shader-f16. When WebGPU supports shader-f16, fp16 looked identical to fp32 in our tests while running 5 to 8 times faster. Without it, falling back to fp32 makes browser upscaling painful. I haven't measured integrated laptop GPUs or phones yet, though they will obviously be much slower.
What works and what doesn't
I tested four stock clips that were downscaled or blurred first:
- Low-res clips (360p/480p to 720p/1080p) get noticeably sharper. Text, whiskers, and thin edges come back cleanly.
- Slightly out-of-focus footage improved on all four clips.
- 720p to 1080p only gives a small bump.
- Heavily compressed clips get smoothed out, so macro-blocking looks less harsh, but missing detail doesn't magically return.
- Motion blur isn't fixed at all. Streaks stay streaks.
- Fine skin details like freckles can end up slightly smoothed.
If you want to inspect the outputs yourself, the test clips, before/after results, and notes are on Hugging Face, and the technical write-up is on tohd.video/open-source-video-upscaler.
Where the repo ends and ToHD begins
The MIT repo is just the raw upscaling pipeline. On ToHD, we added a 3-frame preview with a local speed estimate, desktop browser upscaling up to 4K with no length cap, a free in-browser 1080p upscaler, and optional paid cloud GPUs (one-time credit packs starting at $5, no subscription) for slower machines, batch jobs up to 200 clips, and old VHS/camcorder restoration.
If you're tinkering with WebGPU, ONNX Runtime Web, or Mediabunny, feel free to fork webgpu-video-upscaler or leave a comment with what kind of frame times you get on your GPU.
Top comments (1)
The 5–8x shader-f16 gap is the number that matters here — 206 ms/frame vs 1,067–1,765 ms/frame on the same 360p→720p run is a brutal difference, and it makes 'check shader-f16 first' the real takeaway for anyone trying this. Two things I'm curious about: the 360p→1080p row shows 200 ms/frame, basically the same as 360p→720p at 206 ms — I'd have expected the bigger output to cost more, so is the frame time dominated by the input pass with the resize nearly free? And the fp32 column is 'not measured' for every row except the first — was that just time, or did the fp32 runs get too slow to bother finishing? For the 'what doesn't work' list, the motion-blur note is the honest one — did you try any pre-processing pass for it, or is that firmly out of scope for this pipeline?