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).
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.
FixesComfy-Org/ComfyUI#12517