| # Setup script for HuggingFace Spaces | |
| # Installs ComfyUI and required dependencies | |
| set -e | |
| echo "🚀 Setting up Product Photography Generator..." | |
| # Install ComfyUI if not already installed | |
| if [ ! -d "ComfyUI" ]; then | |
| echo "📦 Installing ComfyUI..." | |
| git clone https://github.com/comfyanonymous/ComfyUI.git | |
| cd ComfyUI | |
| pip install -r requirements.txt | |
| # Install custom nodes | |
| cd custom_nodes | |
| # Install IP-Adapter Plus | |
| if [ ! -d "ComfyUI_IPAdapter_plus" ]; then | |
| git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git | |
| fi | |
| # Install ControlNet Aux | |
| if [ ! -d "comfyui_controlnet_aux" ]; then | |
| git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git | |
| fi | |
| # Install WAS Node Suite (for background removal) | |
| if [ ! -d "was-node-suite-comfyui" ]; then | |
| git clone https://github.com/WASasquatch/was-node-suite-comfyui.git | |
| pip install rembg[new] | |
| fi | |
| cd ../.. | |
| fi | |
| echo "✅ Setup complete!" | |