feat: multi-pipeline coexistence with CPU↔GPU swap and zombie worker cleanup
Main changes:
Multi-pipeline support (worker.py + nodes.py)
- Worker now holds a Dict[cache_key → PIPE_PTR] instead of a single
pipeline, so multiple loaders (e.g. Z-Image + Qwen-Image-Edit) can
coexist in one workflow.
- Before creating a new pipeline or running t2i/i2i on one, all other
pipelines are quantfunc_unload()'d to CPU so VRAM is exclusive to the
target. Target auto-reloads from CPU on next call (~2s vs 7s from disk).
- Python manager tracks generate_node_id → cache_key ownership so that
(a) changing a loader's transformer path destroys the old pipeline and
(b) deleting/disconnecting a Generate node evicts its cached ref.
- Generate node reads UNIQUE_ID + PROMPT hidden inputs to know which
Generate nodes are currently alive (excludes nodes whose `pipeline`
input is dangling) and forwards this to ensure_pipeline for cleanup.
Worker subprocess lifecycle (nodes.py + worker.py)
- Linux: set PR_SET_PDEATHSIG via preexec_fn so worker receives SIGTERM
when ComfyUI dies (including SIGKILL / crash), releasing VRAM on exit.
Worker also re-applies prctl itself as belt-and-suspenders.
- Startup scans /proc (Linux) / wmic (Windows) for leftover worker.py
subprocesses from previous ComfyUI runs that didn't exit cleanly and
kills them before spawning a new worker.
ref_img_resize dropdown (nodes.py)
- Re-applied the `ref_img_resize` ("720" / "1024" / "origin") dropdown
on ImageList (reverted yesterday); maps legacy keep_ref_img_size=True
workflows to "1024".
Auto-update guardrail (auto_update.py)
- Skip update if local lib version is higher than all remote versions
(prevents auto-downgrading a locally compiled dev build).
- If lib file exists but version unreadable, don't overwrite.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Y
yejianhui committed
d2979039295525634c5aaae3295d677e2078e828
Parent: fe42c61