PSA: if you run ComfyUI on a cloud pod (Runpod/Vast etc), your python deps get wiped on every stop/start. quick fix so it stops "randomly breaking"
Learned this the hard way after thinking I'd corrupted my install like 3 times.
On most cloud GPU pods only your volume (usually /workspace) survives a stop->start. The container layer, where all your pip installs live, gets reset to the base image. So ComfyUI that ran perfectly yesterday boots up today with ModuleNotFoundError (sqlalchemy, av, etc) and you assume you broke something.
You didn't. The fix is just reinstalling the python deps on each fresh start:
cd /workspace/ComfyUI pip install --break-system-packages -r requirements.txt
The --break-system-packages flag is needed on the newer images that throw "externally-managed-environment" (PEP 668). Without it pip just refuses and you get a confusing exit.
Two gotchas that ate my time:
- If core files actually went missing (nodes.py, protocol.py, requirements.txt, etc) after a disk-full or migration event, and your ComfyUI is a git checkout, "git checkout -- ." restores every tracked file in one shot. Way faster than reinstalling from scratch. - comfy-aimdo is a real upstream dependency now (it's in requirements.txt). If it's the thing missing, that's just a pip install, not a sign your install is broken.
Drop the pip line into a tiny start.sh on your volume so you don't rediscover this every single morning. Saved me a lot of "why is it broken AGAIN" panic.