Commit Graph

4 Commits

Author SHA1 Message Date
chinesewebman
8429f4ff85 fix: skip non-dict entries in UI-saved prompt JSON
UI-saved workflow JSON stores non-dict metadata keys at the top level
(e.g. 'last_node_id', 'last_link_id' as ints). Both validate_prompt and
NodeReplaceManager assume every value is a dict, so iterating prompt.items()
crashes with TypeError when these keys are present.

This is a regression from PR #12595 which tried to fix the same issue but
only added 'class_type' check without guarding isinstance.

Affected endpoints: /prompt (API submit of UI-saved workflow), and any
internal call to validate_prompt / node_replace_manager.

Reproducer: open ComfyUI in browser, save workflow (Ctrl+S), then submit
via API POST /prompt with that JSON. Previously: 500 TypeError.
After: 200 OK (int keys skipped silently).

Repro platform-independent (NVIDIA/CUDA users hit it too).
2026-07-05 17:54:38 +08:00
Jedrzej Kosinski
c8673542f7
fix: make NodeReplaceManager.register() idempotent (#13596) 2026-05-07 19:21:12 -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