RENVI (or Real-ESRGAN ncnn Vulkan Improved) is sligthly improved version of Real-ESRGAN ncnn Vulkan with additional features like piping and fast PNG output.
- Improved performance: Uses libpng with low compression level for faster PNG writing.
- Piping: Supports reading from stdin and writing to stdout, allowing easy integration into pipelines.
Important
Only PNG format supports piping currently. JPEG and WebP formats are not supported for stdin/stdout operations. See the example usage below.
You can download the latest release from the Releases page or build it from source:
Dependencies
libpng, ... (TODO: add rest of dependencies)
git clone --recurse-submodules -j8 [email protected]:ONdraid/Real-ESRGAN-ncnn-vulkan-improved.git
cd Real-ESRGAN-ncnn-vulkan-improved
mkdir build && cd build
cmake ../src
cmake --build . -j 4
You can create a full ffmpeg pipeline to upscale a video!
ffmpeg \
-hide_banner -loglevel error \
-i input.mkv -f image2pipe -vcodec png - \
| ./realesrgan-ncnn-vulkan-improved \
-n realesr-animevideov3 -s 2 \
| ffmpeg \
-f image2pipe -vcodec png -i - output.mkv
Tip
Ffmpeg defaults to 25 fps, use -r
option to set the desired frame rate for the output video.
Usage: realesrgan-ncnn-vulkan-improved [options]...
-h show this help
-i input-path input image path (jpg/png/webp) or directory (reads from stdin if not provided)
-o output-path output image path (jpg/png/webp) or directory (outputs to stdout if not provided)
-s scale upscale ratio (can be 2, 3, 4. default=4)
-t tile-size tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu
-m model-path folder path to the pre-trained models. default=models
-n model-name model name (default=realesr-animevideov3, can be realesr-animevideov3 | realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)
-g gpu-id gpu device to use (default=auto) can be 0,1,2 for multi-gpu
-j load:proc:save thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu
-x enable tta mode
-f format output image format (jpg/png/webp, default=ext/png)
-v verbose output
Note
When utilizing stdin/stdout, load/save threads are fixed at 1:1, only proc threads can be adjusted in this configuration.