Custom Node Process Isolation
Background
Custom nodes often have Python dependency issues when being installed in the same environment. Our current solution is to offer a way to install custom nodes into other python environments, and be able to run different custom nodes in different python processes.
In Scope
- Add ability to run custom nodes in separate isolated processes
- Create a virtual environment for each node pack (using
uv) - Goal: 50% of custom node packs (by usage) should be able to run in an isolated process for initial launch.
- ‘Repair’ that simply deletes a node environment and recreates it.
@guill @robinjhuang Hey guys, how is this going? :)
I noticed "v3-process-isolation" and "venv-management" branches exist but don't seem to be very far along.
I have implemented process isolation in https://github.com/PozzettiAndrea/ComfyUI-SAM3DObjects and people have been using it for a while now.
Happy to share what I've learned or contribute code. Discord: @AndrewWellies
Hey @PozzettiAndrea! I'll reach out to you on Discord. For public visibility on the progress though:
- We have a PR in review now to finish getting the
pyisolatelibrary ready to release: https://github.com/Comfy-Org/pyisolate/pull/3 - There will be a follow-up PR to ComfyUI that adds some scaffolding for using that library.
- We ended up going down a route that actually means custom nodes may be compatible with process isolation out of the box without any changes.