Skip to content

Fix ComfyUI prompt validation errors for lm_top_k, repainting_start, repainting_end#11

Merged
lmangani merged 2 commits into
mainfrom
copilot/fix-comfyui-node-validation-issue
Mar 14, 2026
Merged

Fix ComfyUI prompt validation errors for lm_top_k, repainting_start, repainting_end#11
lmangani merged 2 commits into
mainfrom
copilot/fix-comfyui-node-validation-issue

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

ComfyUI's prompt validation was failing before any node code ran because the widget positional order in INPUT_TYPES didn't match what the workflow files had saved, and VALIDATE_INPUTS didn't cover the three fields ComfyUI was choking on.

Two distinct bugs

1. Widget order mismatch — the primary crash

src_audio (STRING) was defined at widget position 18 in INPUT_TYPES, but all four example workflows were serialized with audio_cover_strength=0.5 at position 18 and src_audio='' at position 22. This shifted the slot mapping so that position 21 — a '' string saved for the lego dropdown — was assigned to repainting_end (FLOAT), causing float('') to blow up in ComfyUI's validation layer, before generate() or _coerce_float were ever called.

Fix: moved src_audio in INPUT_TYPES (and generate() signature) to after lego, aligning positions with the saved workflow files:

# Before (broken)          # After (correct)
18: src_audio  ← STRING   18: audio_cover_strength ← FLOAT
19: audio_cover_strength   19: repainting_start
20: repainting_start       20: repainting_end
21: repainting_end ← ''   21: lego              ← '' ✓
22: lego                   22: src_audio

2. VALIDATE_INPUTS incomplete — empty-string bypass missing

ComfyUI skips its own int()/float() conversion only for inputs explicitly named in VALIDATE_INPUTS. lm_top_k, repainting_start, and repainting_end were not listed, so older user workflows with "" serialized for those fields still hit int('')/float('') directly. Added all three alongside the existing lm_top_p / audio_cover_strength entries.

Tests that weren't catching this

  • Workflow tests only verified indices 14 (lm_top_p) and 18 (audio_cover_strength) were numeric — missing 15, 19, 20
  • No test on total widget count (25) or src_audio position relative to lego
  • No tests for VALIDATE_INPUTS at all

Added: TestValidateInputs (22 cases), test_src_audio_after_lego_in_widget_order, test_generate_widget_count, and numeric-type assertions for all three previously unchecked indices across all four workflow files.

README

Added a "Updating an existing installation" section (git pull + restart) with a note that users whose workflows show validation errors after an update should delete and re-add the Generate node to reset stale widget values.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…README

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ComfyUI node output validation errors Fix ComfyUI prompt validation errors for lm_top_k, repainting_start, repainting_end Mar 14, 2026
Copilot AI requested a review from lmangani March 14, 2026 14:22
@lmangani lmangani marked this pull request as ready for review March 14, 2026 14:23
@lmangani lmangani merged commit b24de9f into main Mar 14, 2026
2 checks passed
@lmangani

Copy link
Copy Markdown
Contributor

The issue was not resolved:

Failed to validate prompt for output 3:

  • AcestepCPPGenerate 2:
    • Failed to convert an input value to a FLOAT value: repainting_end, , could not convert string to float: ''
    • Failed to convert an input value to a INT value: lm_top_k, , invalid literal for int() with base 10: ''
      Output will be ignored
      invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants