- Research things before guessing.
- Discuss big changes before going ahead.
- Use docstrings.
- No emojis or unicode characters in production code.
- Write a dev plan (markdown) for each feature, with UML-as-a-sketch diagrams where useful.
- Each node lives in its own subfolder (e.g.
IncrementorPlus/incrementor_plus.py) - All JS frontend extensions live in
js/(one file per node) __init__.pyat the pack root dynamically loads all node subfolders- Shared Python utilities go in
allergic_utils.pyat the pack root (onsys.pathvia__init__.py) - Shared JS utilities go in
js/allergic_utils.js(imported by other JS files)
- Always suffixed with
_Allergic(e.g.AudioAnalyzer_Allergic,IncrementorPlus_Allergic) - This is the string used in
NODE_CLASS_MAPPINGSkeys and matched in JS vianodeData.name - Class names do NOT need the suffix — only
NODE_NAMEdoes
- Human-readable, suffixed with
(Allergic)(e.g."Audio Analyzer (Allergic)")
- Format:
"Comfy.<NodeName>_Allergic"(e.g."Comfy.AudioAnalyzer_Allergic") - Must match the
NODE_NAMEwhere applicable
| NODE_NAME | DISPLAY_NAME | Subfolder |
|---|---|---|
AudioAnalyzer_Allergic |
Audio Analyzer (Allergic) | AudioAnalyzer/ |
AudioAnalyzerUpload_Allergic |
Audio Analyzer Upload (Allergic) | AudioAnalyzer/ |
FolderFileCounter_Allergic |
Folder File Counter (Allergic) | FolderFileCounter/ |
IncrementorPlus_Allergic |
Incrementor Plus (Allergic) | IncrementorPlus/ |
MasterBatcher_Allergic |
Master Batcher (Allergic) | MasterBatcher/ |
RememberMe_Allergic |
Remember Me (Allergic) | RememberMe/ |
Every node class must define NODE_NAME and DISPLAY_NAME as class attributes, and use them in the mappings:
class MyNode:
"""Docstring describing what the node does."""
NODE_NAME = "MyNode_Allergic"
DISPLAY_NAME = "My Node (Allergic)"
# ...
NODE_CLASS_MAPPINGS = {MyNode.NODE_NAME: MyNode}
NODE_DISPLAY_NAME_MAPPINGS = {MyNode.NODE_NAME: MyNode.DISPLAY_NAME}- Path sanitization:
from allergic_utils import sanitize_path— do not duplicate this in node files - When adding new shared logic, add it to
allergic_utils.pyrather than copying between nodes
All JS files in js/ use "../../../scripts/app.js" to reach ComfyUI's app module (three levels up from the js/ folder inside the pack inside custom_nodes).
JS files match nodes by NODE_NAME string (e.g. nodeData.name === "IncrementorPlus_Allergic"). These must stay in sync with the Python NODE_NAME attributes.
updateSlotName(node, index, newName)— update an output slot's display namesetupIncrementDefault(nodeType, widgetName, afterQueuedOverride?)— configure the "control after generate" dropdown to default to "increment" for new nodes, with optional custom afterQueued behavior. Also handles_isFromWorkflowdetection via configure override.