GPU-accelerated AI image upscaler.
sharp <input image folder path> <output image folder path> [<options>]
or
sharp_uv <input image folder path> <output image folder path> [<options>]
{f} : input relative file path
{d} : input relative directory path
{n} : input file name
{s} : input file stem
{e} : input file extension
{r} : output scaling ratio
{w} : output width
{h} : output height
--include <input_image_file_path_filter>
--exclude <input_image_file_path_filter>
--template <output_image_file_path_template={d}{s}.png>
--model <model_name=remacri>
--min-width <minimum_width=0>
--min-height <minimum_height=0>
--max-ratio <maximum_ratio=4>
--max-width <maximum_width=0>
--max-height <maximum_height=0>
--max-upscaled-width <maximum_upscaled_width=0>
--max-upscaled-height <maximum_upscaled_height=0>
--tile-size <tile_size=400|0>
--compression <compression>
--avif-compression <avif_compression=85>
--jpeg-compression <jpeg_compression=85>
--webp-compression <webp_compression=85>
--alpha-mode <alpha_mode=lanczos|realesrnet|remove>
--alpha-color <alpha_color=FFFFFF>
--skip
--cpu
--cuda
--rocm
--include and --exclude filters are applied in order, so a later --include can re-include paths excluded earlier.
If none of --cpu, --cuda, or --rocm is passed, Sharp uses CUDA when available, otherwise ROCm when available, otherwise CPU.
bsrgan— real-world blind super-resolutionbsrnet— smooth real-world blind super-resolutionhighfidelity— anime with high-frequency detailrealanime— anime and mangarealdigital— digital artrealesrgan— sharp texturesrealesrnet— smooth output with minimal invented detailremacri— strong on skin, faces, and fine texturesultramix— balanced detail and smoothnessultrasharp— aggressive detail recovery
sharp "IN/" "OUT/"
sharp "IN/" "OUT/" --model remacri
sharp "IN/" "OUT/" --include "**/*.jpg" --include "**/*.png" --template "{d}{s}.jpg" --skip
sharp "IN/" "OUT/" --include "**/*.jpg" --include "**/*.png" --template "{d}{s}_{r}x.jpg" --max-ratio 3 --skip
sharp "IN/" "OUT/" --include "**/*.jpg" --include "**/*.png" --template "{d}{s}_{w}x{h}.png" --max-width 3840 --compression 85 --skip
sharp "IN/" "OUT/" --include "**/*.jpg" --include "**/*.png" --exclude "alpha/*.*" --exclude "anime/*.*" --exclude "architectural/*.*" --exclude "digital/*.*" --exclude "**/small/*.*" --include "building/small/*.*" --template "{d}{s}.jpg" --min-width 3840 --max-upscaled-width 3840 --skip
Run one of:
install_packages_cuda.bat/install_uv_packages_cuda.bat— NVIDIA CUDAinstall_packages_rocm.bat/install_uv_packages_rocm.bat— AMD ROCminstall_packages_cpu.bat/install_uv_packages_cpu.bat— CPU only
- Python 3.12.10
- CUDA 12.4 (NVIDIA) or ROCm 7.2.1 (AMD), optional
- Only reads and writes AVIF, JPEG, PNG, and WebP images.
- Output resolution is limited to 4× the original resolution.
0.1
Eric Pelzer ([email protected]).
This project is licensed under the GNU General Public License version 3.
See the LICENSE.md file for details.
