What is waifu2x? How the anime upscaler works
Waifu2x is a free neural network that upscales anime-style images and removes JPEG noise. Learn where it came from, how it works and when to use it.
Waifu2x is an open-source program that enlarges images and removes JPEG compression noise using a deep convolutional neural network. It was created by the developer nagadomi in 2015 and was trained mainly on anime-style art, which is where the name comes from: a "waifu" is a fan term for a favourite anime character, and "2x" is the scale factor.
You can try it right now, for free, with our online waifu2x upscaler.
Why normal resizing is not enough
When you enlarge an image in a regular editor, the program has to invent the new pixels. Classic methods such as bilinear or bicubic interpolation simply average the neighbouring pixels. That works for smooth gradients, but it turns the clean, hard outlines of a drawing into soft, blurry edges, and it also enlarges any JPEG blocks or noise that were already there.
Waifu2x takes a different approach. Instead of averaging, it uses a model that has learned what sharp line art looks like, so it can reconstruct crisp edges and flat colour areas when it doubles the resolution.
How waifu2x works
Waifu2x is based on the idea behind SRCNN (Super-Resolution Convolutional Neural Network), published by Dong et al. in 2014. The model is trained on pairs of images: a high-quality original and a version of the same image that was shrunk and saved as a low-quality JPEG. During training the network learns to turn the damaged version back into the original. After training, it can apply that knowledge to images it has never seen.
The same technique is used for two jobs, which you can combine:
- Noise reduction removes the square blocks, ringing and colour smearing that JPEG compression leaves behind. There are several strength levels, from light to aggressive.
- Upscaling doubles the width and height of the image (four times as many pixels) while keeping edges sharp.
Models and implementations
Over the years the project has gained several model architectures. The older VGG7 and UpConv7 models are small and fast. CUnet is larger and usually gives cleaner results on illustrations. Newer releases of nagadomi's code also include transformer-based models.
The original code was written for Lua and Torch, and the community has ported it to many platforms, such as waifu2x-caffe for Windows and waifu2x-ncnn-vulkan, a fast cross-platform version that runs on almost any GPU. Waifu2x.pro runs waifu2x-ncnn-vulkan on our servers: the UpConv7 anime and photo models for 2x upscaling, and the CUnet model when you only want to remove noise.
What waifu2x is good at
- Anime screenshots, fan art, manga pages and other drawings with clear outlines.
- Cleaning up images that were saved and re-saved as JPEG many times.
- Making small icons, avatars or stickers big enough for print or a high-resolution screen.
- Photos, with the dedicated photo model, when you need a moderate quality boost without a heavy "AI painted" look.
Limitations
Waifu2x cannot recover information that is completely missing. A face that is only a few pixels wide will not gain new detail, and very blurry photos will stay soft. It also works best on 2x steps: you can run an image through it twice for 4x, but each pass adds a little smoothing. For realistic photos, newer models such as Real-ESRGAN can produce more texture, sometimes at the cost of inventing details that were never there.
Is waifu2x free?
Yes. The original project is open source under the MIT licence, and you can use it online here without an account or watermark. If you want to get the best results, read our guide to the waifu2x settings.