Skip to content

Fix empty-string coercion for INT/FLOAT optional inputs in AcestepCPPGenerate#10

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

Fix empty-string coercion for INT/FLOAT optional inputs in AcestepCPPGenerate#10
lmangani merged 2 commits into
mainfrom
copilot/fix-comfyui-node-issues

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Older ComfyUI workflows serialize unset optional widget values as "" instead of their numeric defaults, causing runtime failures when Python tries to cast them: int("") and float("") both raise.

Changes

  • nodes.py: Added _coerce_int(value, default) helper mirroring the existing _coerce_float; extended the coercion block in AcestepCPPGenerate.generate() to cover the three missing fields:

    lm_top_k = _coerce_int(lm_top_k, 0)
    repainting_start = _coerce_float(repainting_start, -1.0)
    repainting_end = _coerce_float(repainting_end, -1.0)
  • tests/test_nodes.py: Added TestCoerceInt covering passthrough, float truncation, valid string, empty string, and whitespace cases.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…op_k, repainting_start, repainting_end

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ComfyUI nodes and review overall logic Fix empty-string coercion for INT/FLOAT optional inputs in AcestepCPPGenerate Mar 14, 2026
Copilot AI requested a review from lmangani March 14, 2026 13:41
@lmangani lmangani marked this pull request as ready for review March 14, 2026 13:53
@lmangani lmangani merged commit 05991a2 into main Mar 14, 2026
2 checks passed
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