Skip to content

fix: handle unknown node IDs in comfy run without crashing#385

Merged
bigcat88 merged 1 commit intomainfrom
fix/unknown-node-id-keyerror
Mar 15, 2026
Merged

fix: handle unknown node IDs in comfy run without crashing#385
bigcat88 merged 1 commit intomainfrom
fix/unknown-node-id-keyerror

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

When workflows use loop/iteration nodes (like ComfyUI-Loop-image or Easy-Use), the ComfyUI server sends websocket messages with composite node IDs like 406.0.0.428 that don't exist in the original workflow dict. This caused comfy run to crash with a KeyError even though the workflow executed successfully and all outputs were saved.

Changed get_node_title() and log_node() to use dict.get() instead of dict[] for workflow lookups. Unknown node IDs now fall back to displaying the raw ID string instead of crashing. The workflow execution itself is unaffected since remaining_nodes.discard() was already safe for unknown keys.

Added tests covering unknown node IDs through all message types (executing, progress, executed, execution_cached) in both normal and --verbose modes.

Fixes #278

@bigcat88 bigcat88 marked this pull request as ready for review March 15, 2026 11:58
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Mar 15, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   66.59%   67.04%   +0.44%     
==========================================
  Files          33       33              
  Lines        3706     3711       +5     
==========================================
+ Hits         2468     2488      +20     
+ Misses       1238     1223      -15     
Files with missing lines Coverage Δ
comfy_cli/command/run.py 73.95% <100.00%> (+7.76%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88 bigcat88 merged commit af4d136 into main Mar 15, 2026
14 checks passed
@bigcat88 bigcat88 deleted the fix/unknown-node-id-keyerror branch March 15, 2026 12:04
bigcat88 added a commit that referenced this pull request Apr 2, 2026
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comfy-cli crash at end of execution but not comfyui

1 participant