Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions: How to run RuinedFooocus on M1-M4 (ARM MacOS Architecture) #213

Open
Gitterman69 opened this issue Dec 28, 2024 · 0 comments

Comments

@Gitterman69
Copy link

Here's the complete installation guide for RuinedFooocus on macOS (M1/M2):
INSTALLATION

Install system dependencies first:

brew install [email protected]
brew install osmesa

Create and navigate to the installation directory:

mkdir -p /Users/YOUR_USERNAME/ruinedFooocus
cd /Users/YOUR_USERNAME/ruinedFooocus

Clone the repository:
git clone https://github.com/runew0lf/RuinedFooocus.git .
Create and activate a virtual environment:

python3.10 -m venv venv
source ./venv/bin/activate

Create a Mac-compatible pip_modules.txt file (remove all existing content and replace with):

torch==2.2.2
torchvision==0.17.2
torchsde==0.2.6
einops==0.4.1
transformers==4.44.0
safetensors==0.4.3
accelerate==0.33.0
pyyaml==6.0
Pillow==9.2.0
scipy==1.10.0
tqdm==4.66.5
psutil==5.9.5
numpy==1.26.4
pytorch_lightning==1.9.4
omegaconf==2.2.3
gradio==3.50.2
aiohttp==3.8.5
playsound2==1.3.0
diffusers==0.30.0
ftfy==6.1.1
clip_interrogator==0.6.0
opencv-python==4.8.1.78
kornia==0.7.2
sentencepiece==0.2.0
spandrel==0.3.4
imageio[pyav]==2.34.1
beautifulsoup4==4.12.3
protobuf==4.25.4
rembg==2.0.58
trimesh==4.4.4
jaxtyping==0.2.33
gpytoolbox==0.3.2
pynim==1.0.5
slangtorch==1.2.3
numpy-stl==3.1.2
huggingface-hub==0.25.0
typing-extensions==4.12.2
diskcache==5.6.3
jinja2==3.1.4

Install all required packages:

Install base requirements

pip install -r requirements_versions.txt
Install Mac-specific packages
pip install PyObjC
pip install gguf==0.10.0
pip install pyrender
CMAKE_ARGS="-DLLAMA_METAL=on" pip install llama-cpp-python --no-cache-dir

Create a launch script (start_ruinedfooocus.sh):

#!/bin/bash
cd /Users/YOUR_USERNAME/ruinedFooocus
source venv/bin/activate
python launch.py --disable-cuda-malloc --all-in-fp16 --always-high-vram --api-port 7865
Make it executable:
chmod +x start_ruinedfooocus.sh

NOTES:
Replace YOUR_USERNAME with your actual username in all paths
First launch will take time as it downloads required models
The web interface will open at http://127.0.0.1:7865/
Ignore warnings about gradio version
Ignore any warnings about playsound efficiency
Ensure you have enough disk space for models (~10GB recommended)
Have a working internet connection for the first run to download models

These instructions have been tested on macOS with M1/M2 chips.
OPTIONAL APPLESCRIPT:
If you want to create an AppleScript for easy launching, open Script Editor and paste:


on run
tell application "Terminal"
    activate
    do script "
cd /Users/YOUR_USERNAME/ruinedFooocus
source venv/bin/activate
python launch.py --port 7865 --listen

# Wait for RuinedFooocus to start (max 30 seconds)
for i in {1..30}; do
    if curl -s http://127.0.0.1:7865 >/dev/null; then
        echo \"RuinedFooocus is ready\"
        open http://127.0.0.1:7865
        break
    fi
    sleep 1
done
"
end tell
end run

Save as an application (.app) for easy launching.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant