nagadomi /waifu2x

Image Super-Resolution for Anime-Style Art

★ 28,237⑂ 2,652
LuaCreated 2015-05-17waifu2x.udp.jp/
28,237
stars
+-1+-4+12
2,652
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

waifu2x

Image Super-Resolution for Anime-style art using Deep Convolutional Neural Networks.
And it supports photo.

The demo application can be found at https://waifu2x.udp.jp/ (Cloud version), https://unlimited.waifu2x.net/ (In-Browser version).

 2023/02 PyTorch version

nunif

waifu2x development has already been moved to the repository above.

 Summary

Click to see the slide show.

!slide

 References

waifu2x is inspired by SRCNN [1]. 2D character picture (HatsuneMiku) is licensed under CC BY-NC by piapro [2].

- [1] Chao Dong, Chen Change Loy, Kaiming He, Xiaoou Tang, "Image Super-Resolution Using Deep Convolutional Networks", http://arxiv.org/abs/1501.00092
- [2] "For Creators", https://piapro.net/intl/en_for_creators.html
 Public AMI

TODO

 Third Party Software

Third-Party

If you are a windows user, I recommend you to use waifu2x-caffe(Just download from releases tab), waifu2x-ncnn-vulkan or waifu2x-conver-cpp.

 Dependencies

 Hardware
- NVIDIA GPU

 Platform

- Torch7
- NVIDIA CUDA

 LuaRocks packages (excludes torch7's default packages)
- lua-csnappy
- md5
- uuid
- csvigo
- turbo

 Installation

 Setting Up the Command Line Tool Environment
 (on Ubuntu 16.04)

 Install CUDA

See: NVIDIA CUDA Getting Started Guide for Linux

Download CUDA


sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install cuda


 Install Package


sudo apt-get install libsnappy-dev
sudo apt-get install libgraphicsmagick1-dev
sudo apt-get install libssl1.0-dev  for web server


Note: waifu2x requires little-cms2 linked graphicsmagick. if you use macOS/homebrew, See 174.

 Install Torch7

See: Getting started with Torch.

- For CUDA9.x/CUDA8.x, see 222
- For CUDA10.x, see 253

 Getting waifu2x


git clone --depth 1 https://github.com/nagadomi/waifu2x.git


and install lua modules.


cd waifu2x
./install_lua_modules.sh


 Validation

Testing the waifu2x command line tool.

th waifu2x.lua


 Web Application

th web.lua


View at: http://localhost:8812/

 Command line tools
Notes: If you have cuDNN library, than you can use cuDNN with -force_cudnn 1 option. cuDNN is too much faster than default kernel. If you got GPU out of memory error, you can avoid it with -crop_size option (e.g. -crop_size 128).

 Noise Reduction

th waifu2x.lua -m noise -noise_level 1 -i input_image.png -o output_image.png


th waifu2x.lua -m noise -noise_level 0 -i input_image.png -o output_image.png
th waifu2x.lua -m noise -noise_level 2 -i input_image.png -o output_image.png
th waifu2x.lua -m noise -noise_level 3 -i input_image.png -o output_image.png


 2x Upscaling

th waifu2x.lua -m scale -i input_image.png -o output_image.png


 Noise Reduction + 2x Upscaling

th waifu2x.lua -m noise_scale -noise_level 1 -i input_image.png -o output_image.png


th waifu2x.lua -m noise_scale -noise_level 0 -i input_image.png -o output_image.png
th waifu2x.lua -m noise_scale -noise_level 2 -i input_image.png -o output_image.png
th waifu2x.lua -m noise_scale -noise_le

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON