Skip to content

Comments

Fix: Compatibility with newer ComfyUI versions (v1.3.1)#144

Open
ALIoneTreE1119 wants to merge 3 commits intopydn:mainfrom
ALIoneTreE1119:fix-colon-in-variable-names
Open

Fix: Compatibility with newer ComfyUI versions (v1.3.1)#144
ALIoneTreE1119 wants to merge 3 commits intopydn:mainfrom
ALIoneTreE1119:fix-colon-in-variable-names

Conversation

@ALIoneTreE1119
Copy link

@ALIoneTreE1119 ALIoneTreE1119 commented Feb 6, 2026

Problem

Newer versions of ComfyUI use node IDs containing colons (e.g., 92:4). When these IDs were used directly in Python variable names, it created invalid syntax like cliptextencode_92:4, causing Black to fail with:

Solution

  • Added explicit colon replacement in clean_variable_name() method
  • Applied clean_variable_name() to node IDs when creating executed_variables
  • Added empty string check to prevent IndexError

Changes

  1. comfyui_to_python.py:

    • Modified clean_variable_name() to replace colons with underscores
    • Modified line 268 to clean the idx parameter
    • Added safety check for empty strings
  2. README.md:

    • Added V0.11.0 release notes documenting the fix

Result

Node IDs like 92:4 are now cleaned to 924, generating valid Python identifiers and maintaining compatibility with newer ComfyUI versions.

Testing

Tested with workflows containing nodes with colon-based IDs. Generated Python code now parses successfully with Black.

Zhu Yucheng added 3 commits February 6, 2026 17:02
- Add explicit colon replacement in clean_variable_name() method
- Apply clean_variable_name() to node IDs when creating executed_variables
- Add empty string check to prevent IndexError
- Fixes InvalidInput error when Black tries to parse generated code with colons in variable names (e.g., 'cliptextencode_92:4')

This resolves the issue where ComfyUI node IDs containing colons (like '92:4') were being used directly in Python variable names, creating invalid syntax.
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.

1 participant