- A complete and functioning ComfyUI installation accessible via the standard MacOS 'Terminal' app. See ComfyUI for instructions on Apple Silicon installation.
- A conda environment and ComfyUI working folder with names that match the command script’s targets (see instructions below).
- Administrative or superuser privileges if/when first using as bundled .app.
- Single click launch of your ComfyUI.
- Starts sessions with MPS Fallback flag to streamline working with quantized models on Metal.
- Quick exit with the keyword 'bye'.
- Can be packaged as a .app bundle. (see Comfy_Launcher.dmg as sample)
Comfy Launcher is a shell script capable of being launched by double-clicking (from any folder), single-clicking (while kept on the dock) or bundling into a MacOS application. The script can be easily customized as it uses a combination applescript and Bourne shell commands.
- To set up the launcher, you may choose to either rename your existing ComfyUI environment and working folder to 'comfyui' and 'ComfyUI' respectively. (see Conda documentation for renaming environments on your specific version)
- You may also choose to create a new ComfyUI install with the launcher's default convention.
- Or, you may simply edit the main.command file's 'comfyui' and 'ComfyUI' entries to match your existing ComfyUI install at "conda activate comfyui" and "cd ~/ComfyUI".
#!/bin/sh
# main.command
# Comfy Launcher for Mac MLX hardware by Tristan John.
# By default, this script assumes your working conda environment is labeled 'comfyui'
# and your working folder is labeled 'ComfyUI'.
# You can make changes here to match your unique installation.
osascript -e 'tell app "Terminal" to do script "
sleep 2s &&
cd &&
conda deactivate &&
conda activate comfyui &&
cd ~/ComfyUI &&
PYTORCH_ENABLE_MPS_FALLBACK=1 python main.py &
sleep 3s &&
open http://127.0.0.1:8188 &&
srvpid=$! &&
funtion bye() {
kill -15 $srvpid
conda deactivate
cd
clear
echo \"ComfyUI Session Terminated\"
}"'Simply double click the main.command script to launch ComfyUI. MacOS may warn the first time the script is used. The script may also be renamed, kept in the dock, or even bundled into an executable app for ultimate convenience.
Simply enter ‘bye’ in the accompanying Terminal to end the ComfyUI session. —The interrupt ‘^C’ will not stop a ComfyUI server when launched by Comfy Launcher.
Apache 2.0

