-
Notifications
You must be signed in to change notification settings - Fork 60
Usage for Command Line (CLI) on macOS Version
Yi Xie edited this page Dec 29, 2021
·
8 revisions
macOS version of waifu2x supports command line interface. Due to certain limitations you have to perform additional steps to use it.
- Locate installation path (normally
/Applications/waifu2x.app/
) - In command line, enter executable path:
cd /Applications/waifu2x.app/Contents/MacOS
- Print usages:
./waifu2x --help
- If you want to use CLI in other places, please specify full path to the executable (for example
/Applications/waifu2x.app/Contents/MacOS/waifu2x --help
). Alternatively, you can add/Applications/waifu2x.app/Contents/MacOS
toPATH
. Symlink won't work because of rpath issues.
Another choice is to put a launcher script under PATH, for example /usr/local/bin
:
#!/bin/sh
#Edit this line to specify the path to waifu2x.app
WAIFU2X_APP="/Applications/waifu2x.app"
if [ ! -d "${WAIFU2X_APP}" ] ; then
echo "waifu2x.app not found";exit 1;
fi
"${WAIFU2X_APP}/Contents/MacOS/waifu2x" "$@"
Due to App Sandbox which is required for App Store, by default the app does not have access to any files on the disk.
To grant both read and write access to a directory, please drop the desired directory like below:
If you cannot perform the drop, please restart the app and try again.
Alternatively, you can drop root directory /
to grant access to everything:
After the permission is granted successfully, it will show a notice:
You can then use the command line normally.
- Due to sandbox the working directory will not be respected. You have to use absolute path.
- Advanced settings (color depth, ANE, etc.) in the app are ignored. You must specify via command line flags.
©2017-2021 imxieyi