# ComfyUI Setup for GCP (Google Cloud Platform) This directory contains an updated and optimized ComfyUI setup workflow designed specifically for GCP Virtual Machines. ## Key Improvements over RunPod (`comfy_setup`) 1. **Non-Root & Home Workspace Integration**: - Replaced fixed `/workspace` and `/root` paths with `${HOME}/workspace` (`~/workspace/comfyui/ComfyUI`). - Runs cleanly as a standard GCP SSH user without requiring root privileges. - Logs saved to safe non-root locations (`/tmp/*.log`). 2. **Updated PyTorch 2.11.0 (CUDA 12.8)**: - Uses PyTorch `2.11.0` with CUDA 12.8 wheels index (`https://download.pytorch.org/whl/cu128`). - Uses `uv` (fast Rust-based package installer) with automatic `pip` fallback. 3. **GCP Reboot Recovery**: - Automatically generates a local `~/workspace/restart_after_reboot.sh` recovery script. - Restores ComfyUI server, Cloudflared tunnel, and Gradio helper UI screen sessions after VM restarts. 4. **Dynamic Model & Output Directories**: - `helpers.py` automatically detects and defaults model paths to `~/workspace/comfyui/ComfyUI/models/`. ## Quick Start Run the setup script on your GCP VM: ```bash cd comfy_setup_gcp bash setup.sh ``` ## Screen Sessions Monitor or attach to running background sessions: ```bash # Attach to ComfyUI server logs screen -r comfyui # Attach to Cloudflared tunnel logs screen -r tunnel8188 # Attach to Helper UI (CivitAI & HuggingFace downloader/uploader) screen -r helpers ``` ## After VM Reboot To restart all background services after rebooting your GCP instance: ```bash bash ~/workspace/restart_after_reboot.sh ```