How freeupscale works, and how we tested it

Everything runs in your browser with the waifu2x models. This page explains the pipeline, shows the benchmark behind our model choices, including where it falls short, and credits the people whose work this is.

What happens when you press Upscale

  1. A quick, invisible check. A Cloudflare Turnstile check runs in the background so bots cannot drain the model downloads. It asks nothing of you.
  2. The engine is fetched once. Your browser downloads onnxruntime-web (the runtime) and the ONNX model for your image, then stores them in its cache. The first run downloads about 14 to 45 MB depending on your device; later runs download nothing.
  3. Your image is decoded locally. It is read straight from the file into memory. No upload ever happens.
  4. Tiles. The image is cut into overlapping tiles (256 px by default). Each tile goes through the model on your graphics chip (WebGPU) or processor (wasm).
  5. Seam blending. Tiles overlap and are blended with a weighted filter, so you do not see grid lines. This is the same method as waifu2x.
  6. You get a PNG. The canvas in the page is turned into a PNG file on your device.

You can check the privacy part yourself. Open your browser's developer tools, go to the Network tab and upscale an image. You will see the model files come in. You will not see your image go out.

Once an image is upscaled, the file is often much larger. To share it more easily, compress the image on stdlib.tools.

The models and what each is for

Used forModelSizeBest for
Drawing, 2xswin_unet_v3 / artabout 17 MBDrawings, anime, logos
Drawing, 4xswin_unet / artabout 17 MBSmall drawings enlarged 4x
Photoswin_unet / photoabout 19 MBCamera photos
Heavily compressed drawingswin_unet / art_scanabout 19 MBScreenshots, scans, compressed drawings
Light (no WebGPU)cunet / artabout 5 MBFast 2x on weak devices

The default tile size, TTA off and the backend order (WebGPU, then wasm) match the waifu2x browser demo. Clean-up is picked from the file: for a JPEG we read its quantization tables to estimate the quality (90 and above gets level 0, 75 to 89 level 1, 50 to 74 level 2, below 50 level 3), and PNG gets none. The type, drawing or photo, is guessed from how flat and how colorful the image is.

Why not one model for everything? Because the wrong model damages the picture. In our test, an anime-trained model turned a photographed knitted sweater into flat painted shapes. That is why the page asks what kind of image you have.

The benchmark

We tested waifu2x, Real-CUGAN and Real-ESRGAN models on nine open-licensed images: three anime drawings (Wikipe-tan, CC BY-SA), two painted comic pages (Pepper&Carrot, CC BY 4.0) and four photographs from the Kodak set. Each image was damaged four ways: shrunk 2x with clean JPEG (quality 90), shrunk 2x with heavy JPEG (quality 50), shrunk 4x, and a blur plus double-JPEG case that imitates a screenshot or chat-app picture. Each model had to rebuild the original. The score is LPIPS, a perceptual distance where lower is better.

CaseBest result (LPIPS)Best waifu2x
Clean anime, 2xwaifu2x swin_unet_v3 art, 0.022Same
Anime with bad JPEG, 2xwaifu2x swin_unet_v3 art, 0.042Same
Anime, 4xwaifu2x swin_unet art, 0.049Same
Anime screenshot or chat picturewaifu2x art_scan, 0.0740.074 (art_scan); default art model 0.112
Painted comic, clean 2xwaifu2x swin_unet_v3 art, 0.083Same
Painted comic, 4xwaifu2x swin_unet art, 0.190Same
Painted comic screenshotReal-ESRGAN anime 6B, 0.2110.212 (art_scan): a tie
Clean photo, 2xwaifu2x photo, 0.209Same
Photo, 4xwaifu2x photo, 0.322Same
Photo with bad JPEG, 2xReal-ESRGAN x2plus, 0.2990.317 (photo)
Photo screenshot or chat pictureReal-ESRGAN x2plus, 0.319Not top ranked

The headline result is for drawings that went through a screenshot or chat app: the art_scan model made 34% fewer perceptual errors than the default art model (0.074 against 0.112). That is the reason strongly compressed drawings are sent to the art_scan model. Real-CUGAN never came first in this test.

On heavily damaged photos, Real-ESRGAN x2plus did better than waifu2x. It weighs 64 MB, so we do not ship it yet. Real-CUGAN and Real-ESRGAN are not used on this site at the moment.

Limits of this test

  • Small. Nine images. Digital painting and black-and-white manga were missing because the image source blocked those downloads.
  • Synthetic damage. The first three damage types look like what waifu2x was trained on, so they favor it. The screenshot case sits outside its training and balances this.
  • A metric is not taste. GAN models (Real-ESRGAN, Real-CUGAN) often look crisper to the eye than LPIPS suggests.
  • Speed was measured on a desktop GPU and not in a browser. Real browser speed varies widely by device.
  • The 4x-only models were scaled down to 2x for the 2x cases, as other sites do.

We plan a blind test with people. Until then, read the table as a good indication, not a verdict.

Credits and licenses

  • waifu2x and nunif. The models and the browser engine code this site adapts are © nagadomi, MIT license. github.com/nagadomi/nunif. If you like them, support the author on Patreon.
  • onnxruntime-web. The runtime that executes the models. MIT license, Microsoft.
  • Test images. Wikipe-tan drawings from Wikimedia Commons (CC BY-SA), Pepper&Carrot by David Revoy (CC BY 4.0), and the Kodak Lossless True Color Image Suite.
  • Independence. freeupscale is an independent project and is not affiliated with nagadomi or the other authors.

More about privacy is on the privacy page. To try the engine, go to the upscaler.