#!/bin/bash
PID=$(pgrep -f 'python main.py' | head -1)
if [ -z "$PID" ]; then echo "NO PROCESS"; exit 1; fi
echo "PID: $PID"
echo ""
# py-spy needs to be run from the venv or with full path
/home/fabian/ComfyUI/venv/bin/py-spy dump --pid $PID 2>&1
