Commit Graph

3 Commits

Author SHA1 Message Date
Jedrzej Kosinski
2ff1d3d042 fix: make NodeReplaceManager.register() idempotent
When the same (old_node_id, new_node_id) pair is registered more than
once in the same process, the duplicate is now silently ignored (with a
debug log). Previously every call appended a new entry, so reloading a
custom node — e.g. via ComfyUI-Manager hot-reload — would accumulate
stale duplicate replacements that surfaced through GET /node_replacements.

Multiple distinct alternatives for the same old_node_id (different
new_node_ids) are still preserved, matching the existing 'list of
alternatives' design used by apply_replacements().

Adds unit tests in tests-unit/app_test/node_replace_manager_test.py
covering normal registration, multi-alternative support, dedupe, and
first-write-wins ordering.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dd37c-4751-72ef-9927-3182b5825db0
2026-04-28 03:03:41 -07:00
Jedrzej Kosinski
33f83d53ae
Fix KeyError when prompt entries lack class_type key (#12595)
Skip entries in the prompt dict that don't contain a class_type key
in apply_replacements(), preventing crashes on metadata or non-node
entries.

Fixes Comfy-Org/ComfyUI#12517
2026-02-24 16:02:05 -05:00
Jedrzej Kosinski
596ed68691
Node Replacement API (#12014) 2026-02-15 02:12:30 -08:00