{"id":13445254,"url":"https://github.com/nihui/realcugan-ncnn-vulkan","last_synced_at":"2025-04-04T11:15:21.475Z","repository":{"id":37721017,"uuid":"458695452","full_name":"nihui/realcugan-ncnn-vulkan","owner":"nihui","description":"real-cugan converter ncnn version, runs fast on intel / amd / nvidia / apple-silicon GPU with vulkan","archived":false,"fork":false,"pushed_at":"2023-03-12T03:13:34.000Z","size":43402,"stargazers_count":808,"open_issues_count":33,"forks_count":49,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T10:09:53.019Z","etag":null,"topics":["amd","gpu","intel","linux","macos","ncnn","nvidia","realcugan","vulkan","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},"funding":{"patreon":"nihui","custom":"paypal.me/shuizhuyuanluo"}},"created_at":"2022-02-13T03:05:45.000Z","updated_at":"2025-03-25T16:42:36.000Z","dependencies_parsed_at":"2024-01-14T04:56:11.087Z","dependency_job_id":null,"html_url":"https://github.com/nihui/realcugan-ncnn-vulkan","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealcugan-ncnn-vulkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealcugan-ncnn-vulkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealcugan-ncnn-vulkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealcugan-ncnn-vulkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nihui","download_url":"https://codeload.github.com/nihui/realcugan-ncnn-vulkan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"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","realcugan","vulkan","windows"],"created_at":"2024-07-31T05:00:28.328Z","updated_at":"2025-04-04T11:15:21.450Z","avatar_url":"https://github.com/nihui.png","language":"C","funding_links":["https://patreon.com/nihui","paypal.me/shuizhuyuanluo"],"categories":["C","超分辨率","Application projects"],"sub_categories":["特效/实用工具","Super Resolution"],"readme":"# Real-CUGAN ncnn Vulkan\n\n:exclamation: :exclamation: :exclamation: This software is in the early development stage, it may bite your cat\n\n![CI](https://github.com/nihui/realcugan-ncnn-vulkan/workflows/CI/badge.svg)\n![download](https://img.shields.io/github/downloads/nihui/realcugan-ncnn-vulkan/total.svg)\n\nncnn implementation of Real-CUGAN converter. Runs fast on Intel / AMD / Nvidia / Apple-Silicon with Vulkan API.\n\nrealcugan-ncnn-vulkan uses [ncnn project](https://github.com/Tencent/ncnn) as the universal neural network inference framework.\n\n## [Download](https://github.com/nihui/realcugan-ncnn-vulkan/releases)\n\nDownload Windows/Linux/MacOS Executable for Intel/AMD/Nvidia/Apple-Silicon GPU\n\n**https://github.com/nihui/realcugan-ncnn-vulkan/releases**\n\nThis package includes all the binaries and models required. It is portable, so no CUDA or PyTorch runtime environment is needed :)\n\n## About Real-CUGAN\n\nReal-CUGAN (Real Cascade U-Nets for Anime Image Super Resolution)\n\nhttps://github.com/bilibili/ailab/tree/main/Real-CUGAN\n\n## Usages\n\n### Example Command\n\n```shell\nrealcugan-ncnn-vulkan.exe -i input.jpg -o output.png\n```\n\n### Full Usages\n\n```console\nUsage: realcugan-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=-1)\n  -s scale             upscale ratio (1/2/3/4, default=2)\n  -t tile-size         tile size (\u003e=32/0=auto, default=0) can be 0,0,0 for multi-gpu\n  -c syncgap-mode      sync gap mode (0/1/2/3, default=3)\n  -m model-path        realcugan model path (default=models-se)\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- `syncgap-mode` = sync gap mode, 0 = no sync, 1 = accurate sync, 2 = rough sync, 3 = very rough sync\n- `load:proc:save` = thread count for the three stages (image decoding + realcugan 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/realcugan-ncnn-vulkan.git\ncd realcugan-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## 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 Real-CUGAN\n\n```shell\nrealcugan-ncnn-vulkan.exe -i origin.jpg -o output.png -s 2 -n 1 -x\n```\n\n![realcugan](images/2.png)\n\n## Original Real-CUGAN Project\n\n- https://github.com/bilibili/ailab/tree/main/Real-CUGAN\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%2Frealcugan-ncnn-vulkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihui%2Frealcugan-ncnn-vulkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Frealcugan-ncnn-vulkan/lists"}