{"id":13441992,"url":"https://github.com/nihui/waifu2x-ncnn-vulkan","last_synced_at":"2025-05-14T22:07:40.902Z","repository":{"id":40789658,"uuid":"179304752","full_name":"nihui/waifu2x-ncnn-vulkan","owner":"nihui","description":"waifu2x converter ncnn version, runs fast on intel / amd / nvidia / apple-silicon GPU with vulkan","archived":false,"fork":false,"pushed_at":"2025-05-04T07:21:03.000Z","size":33787,"stargazers_count":3092,"open_issues_count":83,"forks_count":221,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-05-04T07:24:20.525Z","etag":null,"topics":["amd","gpu","intel","linux","macos","ncnn","nvidia","vulkan","waifu2x","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nihui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"nihui","custom":"paypal.me/shuizhuyuanluo"}},"created_at":"2019-04-03T14:14:34.000Z","updated_at":"2025-05-03T15:52:09.000Z","dependencies_parsed_at":"2024-12-25T23:13:43.303Z","dependency_job_id":null,"html_url":"https://github.com/nihui/waifu2x-ncnn-vulkan","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fwaifu2x-ncnn-vulkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fwaifu2x-ncnn-vulkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fwaifu2x-ncnn-vulkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Fwaifu2x-ncnn-vulkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nihui","download_url":"https://codeload.github.com/nihui/waifu2x-ncnn-vulkan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","gpu","intel","linux","macos","ncnn","nvidia","vulkan","waifu2x","windows"],"created_at":"2024-07-31T03:01:40.403Z","updated_at":"2025-05-14T22:07:35.878Z","avatar_url":"https://github.com/nihui.png","language":"C","funding_links":["https://patreon.com/nihui","paypal.me/shuizhuyuanluo"],"categories":["HarmonyOS","C","超分辨率","C++","Tools","Application projects"],"sub_categories":["Windows Manager","特效/实用工具","Super Resolution"],"readme":"# waifu2x ncnn Vulkan\n\n![CI](https://github.com/nihui/waifu2x-ncnn-vulkan/workflows/CI/badge.svg)\n![download](https://img.shields.io/github/downloads/nihui/waifu2x-ncnn-vulkan/total.svg)\n\nncnn implementation of waifu2x converter. Runs fast on Intel / AMD / Nvidia / Apple-Silicon with Vulkan API.\n\nwaifu2x-ncnn-vulkan uses [ncnn project](https://github.com/Tencent/ncnn) as the universal neural network inference framework.\n\n## [Download](https://github.com/nihui/waifu2x-ncnn-vulkan/releases)\n\nDownload Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU\n\n**https://github.com/nihui/waifu2x-ncnn-vulkan/releases**\n\nThis package includes all the binaries and models required. It is portable, so no CUDA or Caffe runtime environment is needed :)\n\n## Usages\n\n### Example Command\n\n```shell\nwaifu2x-ncnn-vulkan.exe -i input.jpg -o output.png -n 2 -s 2\n```\n\n### Full Usages\n\n```console\nUsage: waifu2x-ncnn-vulkan -i infile -o outfile [options]...\n\n  -h                   show this help\n  -v                   verbose output\n  -i input-path        input image path (jpg/png/webp) or directory\n  -o output-path       output image path (jpg/png/webp) or directory\n  -n noise-level       denoise level (-1/0/1/2/3, default=0)\n  -s scale             upscale ratio (1/2/4/8/16/32, default=2)\n  -t tile-size         tile size (\u003e=32/0=auto, default=0) can be 0,0,0 for multi-gpu\n  -m model-path        waifu2x model path (default=models-cunet)\n  -g gpu-id            gpu device to use (-1=cpu, default=auto) can be 0,1,2 for multi-gpu\n  -j load:proc:save    thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu\n  -x                   enable tta mode\n  -f format            output image format (jpg/png/webp, default=ext/png)\n```\n\n- `input-path` and `output-path` accept either file path or directory path\n- `noise-level` = noise level, large value means strong denoise effect, -1 = no effect\n- `scale` = scale level, 1 = no scaling, 2 = upscale 2x\n- `tile-size` = tile size, use smaller value to reduce GPU memory usage, default selects automatically\n- `load:proc:save` = thread count for the three stages (image decoding + waifu2x upscaling + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with \"4:4:4\" for many small-size images, and \"2:2:2\" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.\n- `format` = the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded\n\nIf you encounter a crash or error, try upgrading your GPU driver:\n\n- Intel: https://downloadcenter.intel.com/product/80939/Graphics-Drivers\n- AMD: https://www.amd.com/en/support\n- NVIDIA: https://www.nvidia.com/Download/index.aspx\n\n## Build from Source\n\n1. Download and setup the Vulkan SDK from https://vulkan.lunarg.com/\n  - For Linux distributions, you can either get the essential build requirements from package manager\n```shell\ndnf install vulkan-headers vulkan-loader-devel\n```\n```shell\napt-get install libvulkan-dev\n```\n```shell\npacman -S vulkan-headers vulkan-icd-loader\n```\n\n2. Clone this project with all submodules\n\n```shell\ngit clone https://github.com/nihui/waifu2x-ncnn-vulkan.git\ncd waifu2x-ncnn-vulkan\ngit submodule update --init --recursive\n```\n\n3. Build with CMake\n  - You can pass -DUSE_STATIC_MOLTENVK=ON option to avoid linking the vulkan loader library on MacOS\n\n```shell\nmkdir build\ncd build\ncmake ../src\ncmake --build . -j 4\n```\n\n## Speed Comparison with waifu2x-caffe-cui\n\n### Environment\n\n- Windows 10 1809\n- AMD R7-1700\n- Nvidia GTX-1070\n- Nvidia driver 419.67\n- CUDA 10.1.105\n- cuDNN 10.1\n\n```powershell\nMeasure-Command { waifu2x-ncnn-vulkan.exe -i input.png -o output.png -n 2 -s 2 -t [block size] -m [model dir] }\n```\n\n```powershell\nMeasure-Command { waifu2x-caffe-cui.exe -t 0 --gpu 0 -b 1 -c [block size] -p cudnn --model_dir [model dir] -s 2 -n 2 -m noise_scale -i input.png -o output.png }\n```\n\n### cunet\n\n||Image Size|Target Size|Block Size|Total Time(s)|GPU Memory(MB)|\n|---|---|---|---|---|---|\n|waifu2x-ncnn-vulkan|200x200|400x400|400/200/100|0.86/0.86/0.82|638/638/197|\n|waifu2x-caffe-cui|200x200|400x400|400/200/100|2.54/2.39/2.36|3017/936/843|\n|waifu2x-ncnn-vulkan|400x400|800x800|400/200/100|1.17/1.04/1.02|2430/638/197|\n|waifu2x-caffe-cui|400x400|800x800|400/200/100|2.91/2.43/2.7|3202/1389/1178|\n|waifu2x-ncnn-vulkan|1000x1000|2000x2000|400/200/100|2.35/2.26/2.46|2430/638/197|\n|waifu2x-caffe-cui|1000x1000|2000x2000|400/200/100|4.04/3.79/4.35|3258/1582/1175|\n|waifu2x-ncnn-vulkan|2000x2000|4000x4000|400/200/100|6.46/6.59/7.49|2430/686/213|\n|waifu2x-caffe-cui|2000x2000|4000x4000|400/200/100|7.01/7.54/10.11|3258/1499/1200|\n|waifu2x-ncnn-vulkan|4000x4000|8000x8000|400/200/100|22.78/23.78/27.61|2448/654/213|\n|waifu2x-caffe-cui|4000x4000|8000x8000|400/200/100|18.45/21.85/31.82|3325/1652/1236|\n\n### upconv_7_anime_style_art_rgb\n\n||Image Size|Target Size|Block Size|Total Time(s)|GPU Memory(MB)|\n|---|---|---|---|---|---|\n|waifu2x-ncnn-vulkan|200x200|400x400|400/200/100|0.74/0.75/0.72|482/482/142|\n|waifu2x-caffe-cui|200x200|400x400|400/200/100|2.04/1.99/1.99|995/546/459|\n|waifu2x-ncnn-vulkan|400x400|800x800|400/200/100|0.95/0.83/0.81|1762/482/142|\n|waifu2x-caffe-cui|400x400|800x800|400/200/100|2.08/2.12/2.11|995/546/459|\n|waifu2x-ncnn-vulkan|1000x1000|2000x2000|400/200/100|1.52/1.41/1.44|1778/482/142|\n|waifu2x-caffe-cui|1000x1000|2000x2000|400/200/100|2.72/2.60/2.68|1015/570/459|\n|waifu2x-ncnn-vulkan|2000x2000|4000x4000|400/200/100|3.45/3.42/3.63|1778/482/142|\n|waifu2x-caffe-cui|2000x2000|4000x4000|400/200/100|3.90/4.01/4.35|1015/521/462|\n|waifu2x-ncnn-vulkan|4000x4000|8000x8000|400/200/100|11.16/11.29/12.07|1796/498/158|\n|waifu2x-caffe-cui|4000x4000|8000x8000|400/200/100|9.24/9.81/11.16|995/546/436|\n\n## Sample Images\n\n### Original Image\n\n![origin](images/0.jpg)\n\n### Upscale 2x with ImageMagick\n\n```shell\nconvert origin.jpg -resize 200% output.png\n```\n\n![browser](images/1.png)\n\n### Upscale 2x with ImageMagick Lanczo4 Filter\n\n```shell\nconvert origin.jpg -filter Lanczos -resize 200% output.png\n```\n\n![browser](images/4.png)\n\n### Upscale 2x with waifu2x noise=2 scale=2\n\n```shell\nwaifu2x-ncnn-vulkan.exe -i origin.jpg -o output.png -n 2 -s 2\n```\n\n![waifu2x](images/2.png)\n\n## Original waifu2x Project\n\n- https://github.com/nagadomi/waifu2x\n- https://github.com/lltcggie/waifu2x-caffe\n\n## Other Open-Source Code Used\n\n- https://github.com/Tencent/ncnn for fast neural network inference on ALL PLATFORMS\n- https://github.com/webmproject/libwebp for encoding and decoding Webp images on ALL PLATFORMS\n- https://github.com/nothings/stb for decoding and encoding image on Linux / MacOS\n- https://github.com/tronkko/dirent for listing files in directory on Windows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Fwaifu2x-ncnn-vulkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihui%2Fwaifu2x-ncnn-vulkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Fwaifu2x-ncnn-vulkan/lists"}