Fix prompt validation: declare lm_top_k/repainting_start/repainting_end as STRING to survive stale empty-string widget values#12
Merged
Conversation
…d to STRING type; update workflow examples Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix prompt validation failures for output 3
Fix prompt validation: declare lm_top_k/repainting_start/repainting_end as STRING to survive stale empty-string widget values
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #11's
VALIDATE_INPUTSfix was based on a wrong assumption. ComfyUI'sexecution.pyrunsint(val)/float(val)unconditionally in anelsebranch (lines 901–936) beforeVALIDATE_INPUTSis ever called — so listing fields there bypasses only range (min/max) checking, not type coercion.int('')andfloat('')still raise, errors are recorded, and the prompt fails even whenVALIDATE_INPUTSreturnsTrue.Fix
Declare
lm_top_k,repainting_start, andrepainting_endasSTRINGinstead ofINT/FLOATinINPUT_TYPES. ComfyUI then runsstr('')(always succeeds). The existing_coerce_int/_coerce_floathelpers ingenerate()convert empty strings to numeric defaults at runtime.Files changed
nodes.py— Change the three fields toSTRING; updategenerate()signatures toUnion[str, int]/Union[str, float]; correctVALIDATE_INPUTSdocstring (it does not bypass type coercion).workflow-examples/*.json(all 4) — Widget positions 15, 19, 20 updated from JSON numbers to JSON strings ("0","-1.0") to match the new type declarations.tests/test_nodes.py— Three new tests assertSTRINGtype for the changed fields; updatedTestValidateInputsdocstring.tests/test_workflows.py— Workflow tests for positions 15/19/20 now check parseability (int(str(val))/float(str(val))) instead ofisinstance(…, int/float).💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.