mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
[refactor] reorganize devtools test nodes into modules (#6020)
## Summary
Refactored monolithic devtools node definitions into organized module
structure for better maintainability and separation of concerns.
## Changes
- **What**: Split 700+ line `dev_nodes.py` into modular structure under
`tools/devtools/nodes/` with categorized files: `errors.py`,
`inputs.py`, `models.py`, `remote.py`
- **Dependencies**: None
## Review Focus
Module import structure and ensure all node registrations are properly
preserved in the consolidated mappings.
**Before:**
```
tools/devtools/
├── __init__.py
└── dev_nodes.py (738 lines)
```
**After:**
```
tools/devtools/
├── __init__.py
├── dev_nodes.py (65 lines - imports only)
└── nodes/
├── __init__.py (consolidated mappings)
├── errors.py (error/debug nodes)
├── inputs.py (input/widget nodes)
├── models.py (model/patch nodes)
└── remote.py (remote/combo nodes)
```
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6020-refactor-reorganize-devtools-test-nodes-into-modules-2896d73d365081e89efef7e88ca8fee3)
by [Unito](https://www.unito.io)
This commit is contained in:
93
tools/devtools/nodes/__init__.py
Normal file
93
tools/devtools/nodes/__init__.py
Normal file
@@ -0,0 +1,93 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from .errors import (
|
||||
DeprecatedNode,
|
||||
ErrorRaiseNode,
|
||||
ErrorRaiseNodeWithMessage,
|
||||
ExperimentalNode,
|
||||
NODE_CLASS_MAPPINGS as errors_class_mappings,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as errors_display_name_mappings,
|
||||
)
|
||||
from .inputs import (
|
||||
LongComboDropdown,
|
||||
NodeWithBooleanInput,
|
||||
NodeWithDefaultInput,
|
||||
NodeWithForceInput,
|
||||
NodeWithOptionalComboInput,
|
||||
NodeWithOptionalInput,
|
||||
NodeWithOnlyOptionalInput,
|
||||
NodeWithOutputList,
|
||||
NodeWithSeedInput,
|
||||
NodeWithStringInput,
|
||||
NodeWithUnionInput,
|
||||
NodeWithValidation,
|
||||
NodeWithV2ComboInput,
|
||||
SimpleSlider,
|
||||
NODE_CLASS_MAPPINGS as inputs_class_mappings,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as inputs_display_name_mappings,
|
||||
)
|
||||
from .models import (
|
||||
DummyPatch,
|
||||
LoadAnimatedImageTest,
|
||||
ObjectPatchNode,
|
||||
NODE_CLASS_MAPPINGS as models_class_mappings,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as models_display_name_mappings,
|
||||
)
|
||||
from .remote import (
|
||||
MultiSelectNode,
|
||||
NodeWithOutputCombo,
|
||||
RemoteWidgetNode,
|
||||
RemoteWidgetNodeWithControlAfterRefresh,
|
||||
RemoteWidgetNodeWithParams,
|
||||
RemoteWidgetNodeWithRefresh,
|
||||
RemoteWidgetNodeWithRefreshButton,
|
||||
NODE_CLASS_MAPPINGS as remote_class_mappings,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as remote_display_name_mappings,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
**errors_class_mappings,
|
||||
**inputs_class_mappings,
|
||||
**remote_class_mappings,
|
||||
**models_class_mappings,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
**errors_display_name_mappings,
|
||||
**inputs_display_name_mappings,
|
||||
**remote_display_name_mappings,
|
||||
**models_display_name_mappings,
|
||||
}
|
||||
|
||||
__all__ = [
|
||||
"DeprecatedNode",
|
||||
"DummyPatch",
|
||||
"ErrorRaiseNode",
|
||||
"ErrorRaiseNodeWithMessage",
|
||||
"ExperimentalNode",
|
||||
"LoadAnimatedImageTest",
|
||||
"LongComboDropdown",
|
||||
"MultiSelectNode",
|
||||
"NodeWithBooleanInput",
|
||||
"NodeWithDefaultInput",
|
||||
"NodeWithForceInput",
|
||||
"NodeWithOptionalComboInput",
|
||||
"NodeWithOptionalInput",
|
||||
"NodeWithOnlyOptionalInput",
|
||||
"NodeWithOutputCombo",
|
||||
"NodeWithOutputList",
|
||||
"NodeWithSeedInput",
|
||||
"NodeWithStringInput",
|
||||
"NodeWithUnionInput",
|
||||
"NodeWithValidation",
|
||||
"NodeWithV2ComboInput",
|
||||
"ObjectPatchNode",
|
||||
"RemoteWidgetNode",
|
||||
"RemoteWidgetNodeWithControlAfterRefresh",
|
||||
"RemoteWidgetNodeWithParams",
|
||||
"RemoteWidgetNodeWithRefresh",
|
||||
"RemoteWidgetNodeWithRefreshButton",
|
||||
"SimpleSlider",
|
||||
"NODE_CLASS_MAPPINGS",
|
||||
"NODE_DISPLAY_NAME_MAPPINGS",
|
||||
]
|
||||
Reference in New Issue
Block a user